Fast offline code-graph CLI in Rust: lets AI agents ask "where is X / who calls X" with tiny outputs. Requirements: docs/REQUIREMENTS.md.
- Check all (run before saying you're done):
just check - Refresh exact call data:
just scip(run it after code changes, before using the codegraph MCP tools to answer;just installfirst if the code changed) - Test:
just test· one test:cargo test <name> - Lint:
just lint· Format:just fmt - Run:
cargo run -- <args>· Build:cargo build - Without just:
cargo test,cargo clippy -- -D warnings,cargo fmt
src/— Rust source (entry:src/main.rs; one module per command, languages insrc/lang/). Big test blocks live beside their file assrc/<name>/tests.rs(query,lang/rust): read the code file without its tests.docs/—REQUIREMENTS.md(phases, commands, output format)src/html/— the graph page in small parts. Per-area rules load automatically from.claude/rules/(html, typescript, rust, scip) when you touch those files.- Generated, never edit:
target/,.claude/codemap.md
- Graphify v0.9.97 (Python) is installed locally, no download needed:
/home/lain/.local/share/uv/tools/graphifyy/lib/python3.12/site-packages/graphify/(CLI:~/.local/bin/graphify). Read-only; never edit it. - Many files are huge (extract.py 540KB, cli.py 270KB): use the
readeragent orrg, don't read them whole. - Rule: before building a feature, find how Graphify does it (e.g. web view:
exporters/html.py,callflow_html.py) and port that behaviour, don't invent a different one. Keep its notice on ported logic. - Rule: keep a checklist in
docs/PROGRESS.mdof every Graphify feature (commands, exports, analysis, web view), compared against our code: mark each done / partial / todo, with the Graphify file it comes from. Update it whenever a feature lands.
.claude/codemap.md: every symbol aspath:line name, plususes:imports per file; refreshed automatically.- First choice: the codegraph MCP tools (
def,callers,explain,affected); they answer in a few lines. Fallback:rg '<symbol>' .claude/codemap.md. Then read only those lines.
- Match the style of surrounding code; small functions, clear names.
- Follow YAGNI: build only what's asked, the simplest thing that works; never skip input validation, error handling or security.
- No new dependencies without asking.
- No
unwrap()outside tests; clippy clean.
- Plan, progress and new decisions:
docs/PROGRESS.md(read it at the start of a task; /handoff updates it). Older dated decisions and measurements:docs/HISTORY.md(never read it whole, search it withrg). Open work:docs/TODO.md. - Non-trivial change: plan first (plan mode), then small steps.
- New behaviour or bug: write the failing test first, see it fail, then write the code.
- Noisy test output →
test-runnersubagent; a tiny suite can run directly. - Searches: codegraph MCP tools first, then codemap, then
explorer. Before every commit: Default model isopusplan(Opus plans, Sonnet writes); for a hard task pick/model opusbefore the first message, never mid-session (a switch re-reads the whole context uncached).code-reviewerruns on sonnet, given only the diff (git diff) plus the touched function names, not whole files. Fix real findings, then run it again on the new diff; stop when it says "no remaining issues" (tell the reviewer to answer with exactly that phrase) or after 3 rounds, whichever comes first, and list anything still open indocs/TODO.md. Once per finished feature, not after every small fix. - Context > 50% on unfinished work: /handoff, then /clear.
- No Co-Authored-By or other AI attribution in commits or PRs.
- Conventional Commits (
feat:,fix:, …) via /commit. - Never push, force-push or rewrite history unless asked.
- Never commit secrets, .env or HANDOFF.md.
- Read files before writing code; don't re-read unchanged files.
- Prefer targeted edits over rewriting whole files.
- Skip files over 100KB unless explicitly needed.
- Concise output, thorough reasoning. No openers or recap fluff.
- Stop when the task is done and tests pass; no unrequested extras.
- Credit Graphify (safishamsi/graphify) in README and keep its notice for ported logic.