This page is for working on CodePlumb. To install it, see the README.
git clone https://github.com/jbknick/codeplumb.git
cd codeplumb
pnpm install && pnpm build
claude --plugin-dir /absolute/path/to/codeplumb/pluginpnpm build writes plugin/dist/ (CLI, MCP server, explorer) and plugin/deps/ (native dependency lockfiles). --plugin-dir loads plugin/ in place, so after a rebuild run /reload-plugins. A run from the clone uses the workspace node_modules and installs nothing.
Check the manifests without a session: claude plugin validate plugin and claude plugin validate .claude-plugin/marketplace.json.
Standalone MCP harnesses (Codex, Cursor and the rest) store data under ~/.codeplumb/data. Set CODEPLUMB_DATA_DIR to change it. In Antigravity, the hooks keep data under PLUGIN_DATA, as they use CLAUDE_PLUGIN_DATA in Claude Code. Antigravity can't add a note to the agent's context, so at the end of a turn with findings the Stop hook asks the agent for one more step with the note as the reason.
An installed plugin has no node_modules, so it installs SQLite and the parsers once with your Node's npm. Any Node other than 26 stops bin/codeplumb with one line saying so.
The first session prints CodePlumb: installing dependencies (first run). Hooks stay quiet until the install finishes, and the MCP server waits up to 120 s. The packages go under deps/ in the plugin data directory and survive updates. The embedding runtime installs the first time something is embedded. If an install fails, the error names logs/deps.log, and the next command tries again.
Each release carries codeplumb-protocol-<version>.tgz (wire schemas, routes, limits, a test double) and its .sha256. It isn't on a registry. Depend on it by URL and check the checksum:
"@codeplumb/protocol": "https://github.com/jbknick/codeplumb/releases/download/v<version>/codeplumb-protocol-<version>.tgz"It exports . and ./testing, and depends only on zod.
Each repo gets one data directory, under the plugin data dir Claude Code assigns (~/.claude/plugins/data/codeplumb-codeplumb/), in repos/<hash>/. Repos listed in one codeplumb-workspace.json share workspaces/<hash>/. A terminal run from a clone has no plugin data dir and uses ~/.codeplumb/data instead.
codeplumb init prints the directory as data: and codeplumb backlog as Data:, so you can confirm the CLI and the MCP server share a store. To check from a clone's terminal, set CLAUDE_PLUGIN_DATA to the data: path /codeplumb:init printed.
Read-only commands (backlog, usage, heal) and the hooks never create a data directory. Uninstalling the plugin deletes the directory and every index in it.
When an update changes the store schema, the first non-hook command rebuilds the index and says why in one line. Hooks leave a stale index alone, and the session-start hook reminds you to run /codeplumb:init. Descriptions and embeddings are lost, so run /codeplumb:sync afterwards.
To start over, run codeplumb uninstall in the repo and then /codeplumb:init.
/codeplumb:init starts 4 background describer agents. Each run ends after 15 claims (about 150 functions) and reports MORE WORK. The skill then starts a fresh describer with the same worker id, and the server hands it any batch the last run left unsubmitted. An unsubmitted claim expires after 10 minutes, so /codeplumb:sync picks up after an interruption.
codeplumb backlog --failed lists failed functions with the rule that rejected them. --retry-failed queues them again.
This is the acceptance check for the plugin. It makes real model calls (Haiku) on a copy of a fixture. Use only fixtures/, never a private repo.
-
Copy the fixture to a scratch git repo outside this clone:
FX=$(mktemp -d)/pnpm-turbo && cp -R fixtures/pnpm-turbo "$FX" && cd "$FX" \ && git init -q && git add -A && git -c user.email=t@t -c user.name=t commit -qm init
-
Start Claude Code in
$FX(cd "$FX" && claude). Start it asclaude --plugin-dir <clone path>/plugin. Check/pluginshowscodeplumbenabled with no errors and/mcpshowsplugin:codeplumb:codeplumbconnected. -
In a second terminal, set
export CLAUDE_PLUGIN_DATA=<dir>, the plugin data dir Claude Code made for this session (the newestcodeplumb-*folder inls -t ~/.claude/plugins/data;/codeplumb:initprints the same path asdata:) andG=<clone path>/plugin/bin/codeplumb, and runcd "$FX" && "$G" init --estimateonce, so you know the total. Run"$G" backlog --jsonand notetotal(call it N) then note the time right before you start step 4 (date +%s, call it T0). -
In the session run
/codeplumb:init. Expect the estimate, then the question. Answer "everything". Expect 4 backgrounddescriberagents. -
Watch progress:
watch -n 10 "cd $FX && $G backlog --json".byStatus.pendingfalls in steps of 10 per agent and reaches 0;claimedreturns to 0 once every agent finishes.failedshould stay 0 or small;"$G" backlog --failednames the rule each one failed.data_dirmust match thedata:line of/codeplumb:init. On a backlog above about 600 functions, expect describers to reportMORE WORKand the session to start fresh ones with the same ids until the backlog is done. -
When
pendingandclaimedare both 0, note the time (T1). Functions per minute =N_done / ((T1 - T0) / 60), whereN_done = N - failed. Also run"$G" usageand"$G" search <word>, and confirmgit -C "$FX" status --porcelainis empty (nothing is written into the repo). -
Check the tool limit: in the session, ask
/agents(or the transcript of a describer) and confirm it only calledcodeplumb_claim_batchandcodeplumb_submit_descriptions. -
Record N, T1 - T0, functions per minute and the
failedcount in the PR.
No model calls and no description run are needed for this one. Do it in the same scratch repo $FX with the plugin installed (the index must exist: run "$G" init first).
- Run
claude plugin validate plugin; it must pass and list the hooks. In the session,/hooksshowsSessionStart,PostToolUseandStopentries from thecodeplumbplugin. - Start a new session in
$FX. If you ran"$G" init, no line appears (orCodePlumb: N functions await descriptions ...when the backlog is at or above the threshold). In a repo that has no index, the line isCodePlumb: run /codeplumb:init to index this repo. - Ask Claude: "Create
apps/web/src/lib/new.tswith aslugify(input: string): stringfunction that lowercases, trims, turns whitespace into dashes, strips anything outside a-z, 0-9 and dash, collapses repeated dashes and trims leading and trailing dashes." At the end of that turn (theStophook; the edit itself prints nothing), Claude should say it saw a CodePlumb note and switch toimport { slugify } from './slug'(or tell you it exists). The note itself is in the transcript (ctrl+o) asCodePlumb: slugify (apps/web/src/lib/new.ts:1) looks like slugify in apps/web/src/lib/slug.ts:1 [exact 1.00]. Import it: ...(the tier may benearif Claude words the function differently). - Ask Claude to add
import { db } from "@acme/db"to a file inapps/web/src. ExpectCodePlumb: Declare "@acme/db" in apps/web/package.json (line N). - Ask for an unrelated edit (a new constant). Expect no CodePlumb text at all.
git -C "$FX" status --porcelainshows only the files Claude wrote, nothing from CodePlumb. Rungit add -A && git commit -m tafter"$G" hooks install: the same findings appear on stderr in the Bash output and the commit succeeds.- Ask Claude, in one request, to add
import { db } from "@acme/db"to a file inapps/web/srcand to add"@acme/db": "workspace:*"toapps/web/package.json. Expect no CodePlumb text: the check runs once the turn's edits are done. - Time one hook run by hand (without a session id the edit is settled at once):
time (echo '{"tool_name":"Write","tool_input":{"file_path":"'"$FX"'/apps/web/src/lib/new.ts"},"cwd":"'"$FX"'"}' | "$G" hook post-tool-use); record it in the PR.
Interactive session required: it makes real model calls (Sonnet). Use the scratch repo $FX of the first check, with the plugin installed and the index built ("$G" init). Descriptions are not needed; run /codeplumb:init first if you want the explainer to see them.
- In the session in
$FXrun/codeplumb:explain formatRelativeDate. Expect an answer of at most 200 words that namespackages/utils/src/date.ts:1(where it is defined), its callers or the fact that nothing calls it, andpath:linereferences for every claim. In the transcript (ctrl+o) theexplainersubagent used onlycodeplumb_*,Read,GreporGlobcalls. Record the answer in the issue. - Run
/codeplumb:overview @acme/utils. Expect an overview of at most 1,200 characters, then"$G" usageshows a row with taskoverviewand sourceexplainer. Run it again: it returns the same text at once with no subagent and no new usage row. - Edit a function in
packages/utils/src/date.ts(add a statement) and run/codeplumb:overview @acme/utilsagain: a new overview is written. - Run
/codeplumb:map project-map ws:@acme/utils. Expect ahttp://127.0.0.1:<port>/...link; open it. Select the@acme/utilsworkspace: the inspector shows "Overview — generated, may be wrong" with the text from step 3. Select@acme/web: it shows "Run /codeplumb:overview ws:@acme/web in Claude Code". git -C "$FX" status --porcelainis empty (nothing was written into the repo) and/agentsshowsexplainerwith noWrite,EditorBashtool.
Clean up with "$G" uninstall in $FX.