← sources

I built a tool that turns "how does X work in this codebase?" into a map tracing the complete flow

source: reddit (reddit:developersIndia)published 2026-10-18 16:57ingested 2026-10-19 02:38

retained text

hey all,

with more and more code being written by ai, its getting hard to read thro how specific things actually work in a codebase. i often find myself exploring new codebases on how specific things work and its hard to skim thro them quickly.

so built codemap, a cli tool. you ask it about any specific flow, like

`codemap trace "what happens on uploading a file/how this X works"`

and after a few mins it opens a graph map in your browser. it shows the complete trace of the flow as high level nodes first. clicking one it opens into its steps. each node has a right panel with a "how it works", input/output, the db tables it touched (read/write) and any external effects.

how it works:

\- an agent starts at the entry point and walks the flow at the high level stages, using read only tools like ripgrep search and tree-sitter  
\- tree-sitter then resolves the calls inside each stage, and the agent turns them into steps  
\- a separate verifier agent double checks every indirect hop (queues, string dispatch, callbacks etc), so the map sticks to real code paths  
\- each node's reads and writes are pulled from the code it covers, each anchored to real table and field names  
\- the "how it works" panel is generated the first time you open a node, and every line cites the code it came from

open source, bring your own openai/anthropic key. a trace costs a few cents to about 30 cents depending on model and repo size. runs locally, agent has read-only tools, and only the model call leaves your machine, so its safe for your private repos. btw video showing codemap's own pipeline!

Repo: [https://github.com/capGoblin/codemap](https://github.com/capGoblin/codemap)

try it on a repo, and lmk how it goes :)

document fetched 2026-10-19 00:23 · canonical https://reddit.com/r/developersIndia/comments/1x986nl/i_built_a_tool_that_turns_how_does_x_work_in_this