cranot/roam-code/roam
Claude Code and agent skill by cranot/roam-code
- community
Checking that the SKILL.md file is still in the repository.
Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring, refactoring guidance, code review. Requires roam-code installed (`pip install roam-code`) and an indexed project (`roam init`).
Install
npx vskill@latest install cranot/roam-code/roamSKILL.md
Roam — Codebase Comprehension Skill
Repository: <https://github.com/Cranot/roam-code>
Roam pre-indexes codebases into a semantic graph (symbols, dependencies, call graphs, architecture layers, git history) stored in a local SQLite DB. Query it via CLI instead of repeatedly grepping files and guessing structure.
Setup
Ensure roam-code is installed and the project is indexed:
After git pull or major changes, run roam index to refresh (incremental, near-instant if few files changed). After large refactors: roam index --force.
Command Decision Table
Use this table to pick the right command for the situation:
| Situation | Command | ||||
|---|---|---|---|---|---|
| First time in a repo | roam understand then roam tour | ||||
| Need a compact codebase overview | roam map or roam minimap | ||||
| Find a symbol by name | roam search <pattern> | ||||
| Need files to read for a symbol | roam context <symbol> | ||||
| Inspect a file's structure | roam file <path> | ||||
| Inspect a directory | roam module <path> | ||||
| Before modifying a symbol | roam preflight <symbol> | ||||
| What breaks if I change X? | roam impact <symbol> | ||||
| Blast radius of uncommitted changes | roam diff | ||||
| Debugging a failure | roam diagnose <symbol> | ||||
| Which tests cover a symbol? | roam affected-tests <symbol> | ||||
| Check codebase health | roam health | ||||
| Find hotspots (churn x complexity) | roam weather | ||||
| Detect dead/unused code | roam dead | ||||
| PR risk assessment | roam pr-risk | ||||
| Find dependency paths | roam trace <source> <target> | ||||
| Who calls/imports this? | roam uses <symbol> (alias: roam refs) | ||||
| Find every reference to X (replaces multi-shape grep) | roam refs <symbol> | ||||
| Algorithm anti-patterns | roam algo | ||||
| Side effects of a function | roam effects <symbol> | ||||
| Safe to delete? | roam safe-delete <symbol> | ||||
| Simulate a refactor | `roam simulate move | extract | merge | delete` |
Core Workflow
1. Orientation (first time in a repo)
2. Before Making Changes
Always run roam preflight <symbol> before modifying code. It combines blast radius + affected tests + complexity + coupling + fitness into one check:
If you only need files to read:
3. After Making Changes
4. Debugging
Output Modes
- Default: Human-readable text (also optimized for LLM consumption)
- `roam --json <cmd>`: Structured JSON with consistent envelope
- `roam --budget N <cmd>`: Token-capped output (N = max tokens)
- `roam complexity --select '.symbols[:5]'`: Project one bounded JSON field without shell parsing (
--selectis repeatable) - `roam grep <pattern> -C 5`: Search source and return bounded live code packets in one call
- `roam grep <pattern> --whole-symbol --max-packets 3`: Deduplicate hits into enclosing functions/classes; stale spans fall back safely
- `roam --sarif <cmd>`: SARIF 2.1.0 for CI integration
Prefer --json when you need to parse output programmatically. Prefer --budget 2000 when context window is tight. Prefer --select '.summary' or a bounded list slice when only one envelope section is needed.
Key Commands Reference
roam search <pattern>
Find symbols by name (regex). Results ranked by PageRank.
roam context <symbol>
AI-optimized file list with line ranges for reading. Supports --task modify|debug|review for context tuning.
roam preflight <symbol|file>
Compound pre-change check. Run this before every modification.
roam health
Composite score (0-100). Use --gate for CI (reads .roam-gates.yml).
roam diff
Blast radius of uncommitted or committed changes.
roam algo
Detect algorithm anti-patterns (23 patterns: O(n^2) loops, N+1 queries, quadratic string building, etc.) with confidence levels and fix suggestions.
roam impact <symbol>
Full blast radius using Personalized PageRank.
roam symbol <name>
Symbol definition + callers + callees + metrics.
roam affected-tests <symbol|file>
Trace reverse call graph to find covering tests.
roam agent-export --write
Auto-generate agent instructions for the project. Detects CLAUDE.md, AGENTS.md, .cursor/rules, etc.
roam minimap --update
Inject/refresh annotated codebase snapshot in CLAUDE.md.
Discovering More Commands
This skill covers the most common commands, but roam has 288 commands. To explore what's available:
For full documentation, examples, and the latest features, see the roam-code repository.
Tips
- One
roamcommand replaces 5-10 grep/read cycles. Always try roam first. - Use
roam searchinstead of grep/glob for finding symbols — it understands
definitions vs. usage and ranks by importance.
roam contextgives exact line ranges — more precise than reading whole files.- After
git pull, runroam indexto keep the graph fresh. - For disambiguation, use
file:symbolsyntax:roam symbol myfile:MyClass.
"Find every reference to X" — prefer roam refs over multi-shape grep
A common agent pattern is:
The intent is "find all references to symbol ekfpa". The multi-shape regex tries to catch function calls (->ekfpa), attribute access (.ekfpa), and string literal mentions ('ekfpa', "ekfpa"). It works, but:
- False positives. Matches comments, docstrings, and unrelated string
literals — the agent must filter those out manually.
- Unstructured. Returns raw line text; the agent has to parse to learn
which symbol owns each match.
- Misses one-off shapes. Ruby
obj.ekfpa!, Python f-stringf"{ekfpa}",
decorator @ekfpa, etc. each need another regex shape.
roam refs <symbol> (alias for roam uses) walks the indexed call/import/ inherit graph and returns only real references — every result is a named symbol with kind/file/line, grouped by edge type:
Latency on this repo: ~700ms via subprocess, sub-100ms via the MCP server (`roam_uses` tool, which agents in MCP-enabled clients should prefer because the import-cost is paid once at server start). 2-5× slower than ripgrep in raw wall-time, but the result is already usable — there's no follow-up "now read the matching files and figure out the structure" step.
Use roam refs when:
- Finding every caller / importer / inheritor of a symbol.
- Planning an API change ("what would break if I rename X").
- Sweeping for usages before a deletion.
Stay with grep / Grep when:
- The target is a literal string, not a symbol (e.g. an error message,
a translation key, a SQL fragment).
- The codebase isn't indexed yet (
roam initfirst if you'll be doing
many of these queries).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/roam/SKILL.md
Popularity
- Repository stars
- 517
- Repository forks
- 50
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/cranot/roam-code/roam)