repowatch v2.0.0

Ask your code where it lives.

repowatch reads the files, pulls the symbols out of the syntax tree, and links the imports and calls between them. The index stays on disk in a SQLite file, so you get the next answer in milliseconds instead of another walk of the tree. CLI, MCP server, Agent Skill.

bench log

cold index 292 ms, warm 14 ms, one file edited 14 ms, index on disk 280 KB

Measured on this repository with Bun 1.4.3 and Node 24.21 on Linux: 35 files, 283 symbols, 499 edges, 51,989 tokens. The command that produced them is repowatch bench.

A persistent index changes what a question costs.

repomix, gitingest and code2prompt hand you a wall of source text and let the model read it. Run the same command for the next question and the work starts over. The model cannot tell which file defines the function it wants to change, or which files would break if it did. repowatch keeps the graph and answers those questions directly.

tool index kept ranked who calls this incremental
repomix no no no no
gitingest no no no no
code2prompt no no no no
aider repomap in session only yes no per session
repowatch SQLite on disk PageRank yes per file

Every file, sized by how much the code depends on it.

The rank comes from a weighted PageRank pass over the import and call graph. A file that ten other files import scores higher than a leaf nobody touches, and the map leads with that order. The picture below is this repository, generated by the tool itself.

Treemap of this repository, each tile one file, sized by its PageRank score.
repowatch map --svg --all, run against the repowatch repository. Regenerated by the release workflow.

What it stores

  • Files with language, size, line count, token estimate and content hash.
  • Symbols with kind, parent, signature, line range and export flag.
  • Edges for imports, calls and framework routes, each pointing at a name.
  • Rank per file, with in-degree and out-degree.
  • Snapshots so you can diff the structure against last week.

What it reads

  • TypeScript, TSX, JavaScript, Python, Rust, Go, C, C++, C#, Java, Ruby, PHP.
  • Twelve tree-sitter grammars, compiled to WebAssembly, loaded on demand.
  • Next.js app and pages routes, plus Remix route files, resolved as edges.
  • Your .gitignore and .repowatchignore, plus a builtin list of build and cache folders.

Four commands cover most of the work.

repowatch find extractFile --kind function

# rank order, not alphabetical
function   extractFile  src/extract.ts:544  score 0.0228  exported

repowatch symbol extractFile

defined  function extractFile at src/extract.ts:544
         function extractFile(lang: string, root: SyntaxNode, file: string): ExtractResult {
called   src/build.ts:144
called   tests/extract.test.ts:8
imported src/build.ts:4

repowatch why src/extract.ts

src/extract.ts
  score        0.022805
  imported by  3 files
  tokens       5,738
  lines        593
  language     typescript

repowatch diff last-week

+ src/new-file.ts  7 tokens
~ src/core.ts  24 -> 23 tokens
- src/old.ts

The full set is map, find, symbol, refs, why, tree, diff, snapshot, watch, bench and mcp. Exit codes are 0 for a result, 1 for nothing found, 2 for a usage mistake and 3 for a broken index.

Six tools an agent can call on your codebase.

The server speaks JSON-RPC over stdio and starts the index on first use. It reports the same numbers the CLI prints, so an agent can ask where something is defined without asking you to paste a file tree.

get_map The ranked map, as Markdown, JSON or a treemap SVG, inside a token budget.
query_symbols Search symbols by name or kind, with the file, line and rank of each hit.
get_refs Where a symbol is defined, who calls it and which files import it.
get_deps The dependency neighbourhood of one file: what it imports, what imports it.
get_diff Structural change between two snapshots: files added, removed or resized.
get_stats File, symbol, edge and token counts, plus the age of the index.

bunx @qexle/repowatch mcp

Add the same server to Claude Code, OpenCode, Codex or Cursor with the JSON block in the README. The registry manifest for this server lives in server.json.

Install it with one command. You do not need an account.

The package ships the CLI, the grammar files and the skill. Node 22.13 or newer, because the index runs on the built-in SQLite module. Bun works the same way.

Run it

# no install, one shot
bunx @qexle/repowatch map

# keep it on the PATH
bun add -g @qexle/repowatch
repowatch map

Install the skill

# from a GitHub repo
npx skills add 1QEXLE/repowatch

# from npm
npm i @qexle/repowatch
npx skills experimental_sync -y

The skill teaches an agent when to reach for the index: before editing an unfamiliar file, to find the caller, to check what a change touches. It ships in skills/repowatch/SKILL.md and the same copy sits in .agents/ and .claude/.

What repowatch will not do.

  • It does not summarise code. Version 1 asked a model to write a sentence about each file. That cost money, needed a key, and made the output impossible to diff. Version 2 stores the parsed structure.
  • It does not pack a repository for a model. Use repomix for that. repowatch gives an agent the map and the callers, not the whole tree in context.
  • It does not run your code. No build, no test execution, no type check. The index reads source text.
  • Dynamic calls stay invisible. The parser cannot link a symbol reached through a string, a registry or reflection to its definition. It sees syntax, not runtime behaviour.
  • The index grows with the graph. A 3,400 file tree produced a 104 MB database here, mostly edges. The map command reads a token budget, but the index on disk sets the ceiling.
repowatch v2.0.0 / MIT / Node 22.13+ / 12 languages Mapped by bunx @qexle/repowatch (index once, query forever).