Knowledge graph · MCP server · for Claude Code

Give your coding agent a map of the codebase.

SpecShip builds a live knowledge graph of your code, specs, and tests — so your AI agent explores structurally instead of re-reading files, your requirements never silently drift, and every token is accounted for.

$npm i -g @specship/specship
specship · knowledge graph ● live index
/exploreexploreGraphapplyLayoutREQ-GRAPH-002SqliteStorevalidateSessioncheckExpiryREQ-AUTH-005auth.test
Built on the tools you already run
tree-sitter Model Context Protocol better-sqlite3 Claude Code transcripts
The two silent taxes on AI-assisted work

Your agent forgets the codebase. Your specs forget the code.

Context burns, turn after turn

Every session your agent re-reads the same files to rebuild the same mental map — paying input tokens to relearn what it already knew an hour ago.

session 7b2e0a44
Read(src/auth.ts) ×17 · 22.8k tokens each
Bash(grep parseTranscript)82,400 tokens

Specs and code quietly diverge

A function gets refactored, a field gets renamed — and the requirement that depended on it is now a lie. Nobody notices until production does.

⚠ REQ-AUTH-005 drifted (code axis)
src/auth.ts:checkExpiry moved 41 lines
field code: token_expired → renamed
One desktop app, eight connected tools

Everything your agent's work touches, in one graph.

SpecShip indexes your repository into a typed knowledge graph, then layers analytics, drift detection, and automation on top of it. Each surface reads from the same source of truth.

core

Knowledge graph

tree-sitter extracts functions, classes, routes and tests; SpecShip synthesizes the edges between them. 4,000+ nodes, force or hierarchical.

specs

Drift detection

Link RFC-2119 requirements to the symbols that satisfy them. When code moves, the link drifts and lands in a review queue — not in prod.

mcp

MCP server

specship_explore & specship_search let agents query structure, not files.

analytics

Cost analytics

Every Claude Code session, priced by model, prompt and cache rate — across all your projects.

tips

Self-improving

SpecShip mines your transcripts for recurring patterns and proposes durable fixes — memory rules, skills, hooks — that you preview and apply in one click on the Improvements page.

runs

Workflows

spec-implement, verify and fix — run in isolated git worktrees with an approval gate before merge.

memory

Memory

See the whole CLAUDE.md hierarchy — managed, user, project, imports — plus the notes your agent writes itself.

The knowledge graph

Your codebase, as a graph the agent can reason over.

SpecShip parses every file with tree-sitter and stores the result in a local SQLite graph: typed nodes for code, specs, tests and routes, with extracted and synthesized edges between them.

Four node types, distinct at a glance. Code, specs, tests and routes each carry their own color — readable down to 4px.
Hierarchical or force layouts. Toggle Dagre for structure or force-directed for clusters; your choice persists.
Scales past 20k nodes. The renderer culls to your viewport plus one hop, so panning stays smooth on big repos.
graph · hierarchical
⌘K explore
code spec test route 4,218 nodes · 9,743 edges
Spec linking & drift

Requirements that stay true to the code.

Write requirements in plain RFC-2119 prose and link each one to the symbol that satisfies it. SpecShip re-verifies those links on every index and surfaces anything that has drifted, broken, or was never implemented. One principle everywhere: a surface may only promise what it can prove.

MUST / SHOULD / MAY, highlighted. Normative keywords are parsed and color-coded so intent is unmissable.
Five honest states — and verified is earned. A spec only turns verified when a test linked to it as evidence has passed; a green suite alone proves nothing. Never a green check that's lying.
A drift queue, not a surprise. Stale links collect in one place with the exact symbol and axis that changed.
specs/auth.md · REQ-AUTH-005
REQ-AUTH-005 drifted P0
Reject expired tokens with 401
Expired tokens MUST return 401 with a machine-readable code: token_expired. The clock-skew tolerance SHOULD be 30 seconds.
drifted src/auth.ts:checkExpiry 1d
broken src/graph/render.tsx:cull 6h
orphaned REQ-GRAPH-009 · no code yet 4d
MCP server

Stop paying to re-read the same files.

SpecShip exposes the graph to your agent over the Model Context Protocol. Instead of dumping whole files into context, the agent asks a structural question and gets back exactly the symbols, callers and linked specs it needs.

You read auth.ts 17× last session — one query covers it
specship_explore --symbol validateSession --depth 2
~$2.10/session
context · per query
Raw grep + Read
82.4k
tokens, every matching line dumped into context
specship_search
600
tokens — just the qualified symbols and their files
137× less context for the same answer
Cost analytics

See exactly where the money goes.

SpecShip reads your Claude Code session transcripts and turns them into a real ledger: cost over time, by model, by prompt, by project — with cache-hit analytics that show what you're already saving and what you're leaving on the table.

Per-prompt attribution. Subagent spend is split out by isSidechain so nothing hides in the total.
Editable price table. Override per-model rates and every rollup recomputes instantly.
Compare across projects. Rank repos by cost, sessions and cache hit rate side by side.
dashboard · last 30 days
Spend
$184.42
38 sessions
Cache hit
71%
▲ 6% w/w
Saved
$38.40
by cache
Opus 4
$121.40
Sonnet 4
$52.80
Haiku 4
$10.20
Workflows

Let the agent do the work — and still review every diff.

Bundled workflows like spec-implement run in an isolated git worktree: plan, implement, test, then pause for your approval before anything merges. Reject with a comment and the agent revises in the same worktree, then pauses again — rejection is feedback, never lost work.

run 9f3a2b1c · spec-implement · REQ-AUTH-005
paused
agent
plan
done · $0.41
agent
implement
done · $1.88
shell
run tests
12 passed
approval
review diff
awaiting you
shell
merge
pending
4,218
nodes indexed locally
137×
less context per query
71%
cache hit rate
7
drifts caught this week
npm · self-contained runtime · 100% local core

Ship specs, not drift.

Index your first repo in under a minute. The core runs entirely local — your code and transcripts never leave your machine. The two optional integrations that do talk to a service (JIRA, Designer) are strictly opt-in.

$npm i -g @specship/specship