A code graph plugin for Claude Code
Claude is about to edit utils/url.ts in hono. 10 files import it and 30 more are within three imports.
CodePlumb is a free, open-source Claude Code plugin. It indexes your repository into a code graph, and the agent asks the graph what a change reaches before making it. This map is hono's real source.
Install the pluginIt is free and needs no account.
- helper/route/index.ts uses getPattern, splitRoutingPath
- hono-base.ts uses getPath, getPathNoStrict, mergePath
- middleware/serve-static/index.ts uses tryDecodeURI
- request.ts uses getQueryParam, getQueryParams, tryDecodeURIComponent
- router/linear-router/router.ts uses checkOptionalParameter
- router/reg-exp-router/router.ts uses checkOptionalParameter
- router/trie-router/node.ts uses getPattern, splitPath, splitRoutingPath
- router/trie-router/router.ts uses checkOptionalParameter
- utils/cookie.ts uses tryDecodeURIComponent
- utils/mount.ts uses getPattern, splitRoutingPath, tryDecode
The interactive map is drawn by a script that has not run. The list headed "Imports it directly" names the ten files that import utils/url.ts; thirty more are two or three imports away.
Arrow keys move between files. Enter marks the focused file as the changed one. The Changed file menu does the same.
Changed Directly affected: imports it Potentially affected: two or three imports away Reachable: four or more Solid: imports the change Dashed: points to the file it imports through
Install the Claude Code plugin
The plugin installs from its marketplace on GitHub. You need Node 26 and Claude Code. On first use it installs its own native dependencies, and the first session prints CodePlumb: installing dependencies (first run). It reads TypeScript, Go, Java, Python, C# and Rust by static analysis of their syntax, so none of their compilers need to be installed and nothing in your repository is run.
In Claude Code, inside your repository
/plugin marketplace add jbknick/codeplumb
/plugin install codeplumb@codeplumb
/reload-plugins
/codeplumb:init
/codeplumb:init indexes the repository, tells you how many functions there are to describe and roughly how many tokens that takes, and asks whether to describe all of them, only the exported ones, or none for now. You can keep working while it runs.
The index is a SQLite file on your disk, kept outside the repository. There is no account, and the free plugin uploads nothing. The plugin adds six skills that only you can start: /codeplumb:init, /codeplumb:sync, /codeplumb:explain, /codeplumb:overview, /codeplumb:map and /codeplumb:review.
A codebase map in your browser
/codeplumb:map opens the explorer on 127.0.0.1. It draws the code graph as a 2D project map of workspaces, folders, files and functions, with the dependency graph of imports and calls between them. It also has a caller graph for any function and a list of duplicated code. The map at the top of this page is laid out the same way, one level up, with a tile for each file. It is a quick way to understand a codebase you did not write.
MCP tools Claude Code can call before it opens a file
Without a graph, Claude Code finds its way around a repository by searching text and reading files, and every file it reads takes up context. CodePlumb adds an MCP server whose tools answer from the index. Six of them are for the agent's own questions. Each answer below is the tool's real output on hono at 75ff8e3, shortened.
codeplumb_search- Code search over the index, by words or by meaning.
- parse cookie header First hit:
parseatsrc/utils/cookie.ts:110, signature(cookie: string, name?: string): Cookie. Second:parseSignedat line 147. codeplumb_browse- List what is one level below a workspace, a folder or a file.
- src/router Five router folders (
linear-router,pattern-router,reg-exp-router,smart-router,trie-router),utils.tsand one test file. codeplumb_node- Look up one function or file with its neighbors: what it calls, what calls it and what imports it.
- src/utils/cookie.ts:110
parseis called bygetCookieinhelper/cookie/index.ts, byparseSigned, and from two test files. codeplumb_impact- The blast radius of a change, one hop at a time.
- src/utils/url.ts 21 symbols changed, 36 direct callers, 45 two hops out, 39 more reachable. Risk: medium. CodePlumb counts functions and test files, so these are larger than the file counts on the map above.
codeplumb_find_similar- Check for code that already does the same thing before writing a helper.
- A draft helper that builds a 401 response for a bearer token The matches include
bearerAuthatsrc/middleware/bearer-auth/index.ts:105and two copies ofunauthorizedResponse, shown below. codeplumb_get_overview- Read the stored plain-language summary of a workspace or folder.
- dir:src/adapter
cached: false, 82 functions. An overview is written only when you ask for one with/codeplumb:overview, and nobody has asked here.
The server has eleven tools. The other five follow a page to its API and its tables (codeplumb_trace, which has no routes to follow in a library like hono), open the explorer, save an overview, and hand work to the agents that write descriptions.
The index stays on disk between sessions. It is brought up to date at the start of each session and, if you install the git hooks, after each checkout, commit or merge.
Every function gets a one-sentence description
A function's name does not always say what it does, so CodePlumb writes a plain-language description of each one and searches those as well. The writing is done by Claude Code subagents on your own plan, in the background. CodePlumb has no model bill to pass on and no key to ask you for.
A guard against writing the same function twice
CodePlumb records each file Claude edits and checks them all when the turn ends. If a new function looks like one that already exists, Claude gets a short note naming the file, the existing function and what to do, and can use that one instead. The edit itself prints nothing. Hono's JWT and JWK middleware each carry their own copy of one helper.
function unauthorizedResponse(opts: {
ctx: Context
error: string
errDescription: string
statusText?: string
realm?: string
}) {function unauthorizedResponse(opts: {
ctx: Context
error: string
errDescription: string
statusText?: string
realm?: string
}) {The two functions are identical for all 21 lines. For each copy, codeplumb_find_similar gave the advice "Export it from src/middleware/jwk/jwk.ts, then import it" (or the same for jwt.ts).
Change impact analysis for a branch or a pull request
Give it a range of commits or a pull request, with /codeplumb:review or codeplumb review main...feature --open, and the blast radius of the code change is drawn on the map you already know, with every file where it was. The code the range did not touch fades to gray and the rest takes the color of what happened to it.
- Added
- Modified
- Signature changed
- Renamed or moved
- Removed
- Deeper blast radius. Past the files that use the change directly, the review follows two and three steps out, then gathers everything further away into one outer ring, with heavily used code shown as a single hub you can open.
- Your own labels on the map. Rename a node, hide the parts you never look at, and collect functions into groups. Save a view and reopen it later. All of it is stored beside the index.
A copy-paste detector for the technical debt agents write
Duplicated code is one of the oldest code smells, and a function that exists twice has to be fixed twice. The duplicates report lists groups of functions that are copies of each other, biggest first, with the copy worth keeping and a side-by-side comparison. It looks across the workspaces of a monorepo too. Copies that were renamed or rewritten are found once you run codeplumb embed, which runs a small model on your own CPU. To get the same finding as a comment on each pull request, add the CodePlumb GitHub Action to your own workflow.
Everything in this section is free. The pull request comment is the one part that needs the GitHub Action in your repository.
See overlapping changes before they turn into merge conflicts
The team service is in early access and has not shipped yet. It is paid, and this section describes what it is built to do. A blast radius is most useful when you can lay two of them over each other, so the service will keep one shared map of every open change, whether it is still a ticket, a branch or a pull request, and mark where they meet.
#5652 changed utils/cookie.ts. #5639 changed utils/jwt/jwt.ts. Neither touches the other's file, but within three imports both reach the same four: jwt.ts and index.ts in middleware/jwt, and jwk.ts and index.ts in middleware/jwk. These are two merged hono commits from the same week, replayed here as if they were open together. The map is cropped to the five folders the two changes reach, and files under 120 lines are drawn at that size so the small ones can be seen.
- One map of every open change. Each will carry its blast radius and its overlaps with the others.
- Groups become boundaries. The groups you draw on the map will be shared with the team and checked in CI, which gives code ownership a line the build can check. A change that crosses one will get a warning by default, and you will be able to make it a required check.
- Agents hear about it while editing. When an agent crosses a boundary, or touches code that another open change touches, it will be told at that moment instead of in review.
- It will follow your tracker. Linear and GitHub Issues sync, and alerts in Slack.
- Planned after that: a hosted map with share links, an organization hub, session insights, SSO and an audit log.
Priced per person, with as many agents as you like
| Plan | Price | What it covers |
|---|---|---|
| Free | $0, for good | The whole plugin: the index, descriptions, the agent tools, the explorer, the reuse guard, the duplicates report, the pull request comment (through the GitHub Action), curation and the deeper blast radius. Local, no account. |
| Solo | $9 a month* | The team service for one developer. |
| Team | $15 a seat a month* | The shared map of open changes, boundaries in CI, warnings to agents while they edit, Linear and GitHub Issues sync, Slack alerts. |
| Organization | Early access | For several teams under one roof. |
A seat is a human. Agents are unlimited on every plan. An organization whose repositories are all public pays nothing.
*The paid service is in early access and its prices are not set. These two are working figures.
What leaves your machine
| Plan | Uploaded | Stays local |
|---|---|---|
| Free | Nothing. | Everything. The index is a local SQLite file. |
| Paid plans | Graph metadata may be uploaded: names, paths, line ranges, edges and hashes. Descriptions too, behind a separate switch you can leave off. | Source code and function signatures never leave the machine. |
Questions about CodePlumb and Claude Code
What is a Claude Code plugin?
A plugin is a package that Claude Code installs with the /plugin command. It can add MCP servers, skills, agents and hooks to a session. The CodePlumb plugin adds one MCP server with eleven tools, six skills such as /codeplumb:init and /codeplumb:map, two agents that describe and explain code, and hooks at session start, after edits and at the end of a turn.
How do I give Claude Code a map of my codebase?
Install the plugin and run /codeplumb:init inside the repository. CodePlumb indexes it into a code graph of functions, files, calls and imports, stored in a SQLite file on your disk. From then on the agent can search the graph, browse it, trace a path through it and ask what a change reaches. /codeplumb:map opens the same graph as a map in your browser.
What is the blast radius of a code change?
It is everything that could behave differently because of the change. CodePlumb sorts it by distance. Directly affected code uses the changed code. Potentially affected code is two or three steps away. Anything further is counted as reachable. This is also called change impact analysis.
Does my code leave my machine?
Not with the free plugin. It has no account and uploads nothing. The paid team service may upload graph metadata, which means names, paths, line ranges, edges and hashes. Descriptions are uploaded only if you leave their separate switch on. Source code and function signatures never leave the machine on any plan.
Do I need an API key, and what does indexing cost?
No key is needed. Building the graph makes no model calls. The optional function descriptions are written by Claude Code subagents on your own Claude plan, and /codeplumb:init shows an estimate of the functions and tokens involved before you agree to anything. Optional embeddings for search by meaning run a small model locally on your CPU, with codeplumb embed.
Is CodePlumb a memory for Claude Code?
CodePlumb keeps an index of the code on disk and does not store your conversations. The index is brought up to date at the start of each session and, if you install the git hooks, after each checkout, commit or merge. The agent can look things up in it from the first message.
Which languages does it index?
TypeScript, Go, Java, Python, C# and Rust. TypeScript has its own indexer and monorepos are handled first, including pnpm, npm and yarn workspaces, Nx and Turborepo. The other languages are read from their syntax with no compiler installed.
How is this different from Sourcegraph?
CodePlumb runs on one developer's machine, with no hosted service and no account, and its first reader is the coding agent. Its tools answer the questions an agent has before an edit, such as what a change reaches and whether a function already exists. We have not measured it against Sourcegraph and make no claim about which is better at code search.