roam-code
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@roam-codecheck the blast radius of function open_db"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
roam-code
The local codebase intelligence layer that lets AI coding agents earn the right to change code — and prove they did.
Credential-free · 100% local by default (opt-in metrics-push is the only outbound surface) · tamper-evident ChangeEvidence packets · Apache 2.0 · runs entirely on your machine
241 commands · 227 MCP tools (57 in the default core preset) · 28 languages

Why Roam is different
Cursor, Cody, Aider, and Windsurf are human-first IDE surfaces that log a session. Roam is an agent-first CLI surface that gates the change and emits proof. Four properties no competitor combines today:
Credential-free. No account, no API key, no cloud login.
pip installand run.100% local by default. Source code never leaves the machine; air-gapped repos work like cloud repos. The single outbound surface (
roam metrics-push) is opt-in, summary-only, and prints its exact payload under--dry-run.Tamper-evident
ChangeEvidencepackets. Each AI-assisted change compiles into one portable packet — HMAC-chained run ledger + signed Code Graph Attestation + signed PR bundle — answering eight questions: who acted, what authority existed, what context was read, what changed, what could break, what policy applied, what verified it, who accepted risk. PR Replay answers 7 of 8 today; the remaining approvals question surfaces asproducer_not_available, never silently dropped. Cursor logs the run; Roam proves the change.MCP runtime security at the wrapper boundary. Every MCP response is scrubbed for secrets on egress, gated against the active mode (
read_only/safe_edit/migration/autonomous_pr) with a closed-enumpolicy_decision, and each decision receipt is HMAC-linked into the signed run ledger. Inside-server controls; the gateway layer (Interlock / Lasso / Portkey) composes on top — seedev/MCP-SECURITY-POSTURE.md.
Underneath sits a SQLite-backed graph of symbols, calls, imports, layers, git history, runtime traces, smells, clones, security flows, and algorithmic patterns across 28 languages — the same local facts queried before, during, and after a change.
Dependency-aware, not string-based. Roam knows Flask has 47 dependents and 31 affected tests; grep knows it appears 847 times. One command replaces 5-10 tool calls — <0.5s per query, plain-ASCII output, --json and --sarif envelopes for agents and CI.
Without Roam | With Roam | |
Tool calls | 8 | 1 |
Wall time | ~11s | <0.5s |
Tokens consumed | ~15,000 | ~3,000 |
Illustrative — a typical agent workflow on a 200-file Python project (Flask). Reproducible smoke transcript in docs/fresh-install-smoke.md; full indexing-rate harness in benchmarks/. Exact numbers vary with repo size, agent prompt, and model.
Install + first four commands
Ten minutes from pip install to a verdict on whether your next edit is safe.
pip install "roam-code[mcp]" # 1. install with MCP server for Claude Code / Cursor / Continue
cd /path/to/your/repo
roam init # 2. index the repo into .roam/index.db (one-time, ~30s on most repos)
roam health # 3. composite 0-100 score: complexity, cycles, dark-matter coupling, dead code
roam preflight <symbol> # 4. blast radius + tests + complexity + architecture rules before you editPython 3.10+. pipx install roam-code and uv tool install roam-code work too. Drop [mcp] for CLI-only. See docs/fresh-install-smoke.md for a verbatim transcript of these four commands against a clean venv.
Step 4 is the payoff — roam preflight on a hot symbol returns a verdict before you touch it:
$ roam preflight open_db
VERDICT: Significant risk — CRITICAL, 1847 symbols in blast radius
Pre-flight check for `open_db (src/roam/db/connection.py:799)`:
Blast radius: 1847 symbols in 382 files [CRITICAL]
Affected tests: 617 direct, 962 transitive [OK]
Complexity: cc=30, nest=4 [CRITICAL]
Coupling: 2 files often change together [MEDIUM]
Conventions: no violations [OK]
Overall risk: CRITICAL
Risk driver: complexity (cc=30, CRITICAL)An agent sees the blast radius before it edits — not after the tests fail.
pipx install roam-code # isolated environment (recommended)
uv tool install roam-code # uv-managed tool
pip install git+https://github.com/Cranot/roam-code.git # from source
# Docker (alpine-based)
docker build -t roam-code .
docker run --rm -v "$PWD:/workspace" roam-code index
docker run --rm -v "$PWD:/workspace" roam-code healthWorks on Linux, macOS, and Windows. Windows: if roam is not found after installing with uv, run uv tool update-shell and restart your terminal.
What's New
v13.4 (released 2026-05-21) — Perf wave + Pattern-1 stabilisation + assurance hardening. Major detector speed-ups (clones 43.8s → 13.1s, intent 66s → 12s, doc-staleness 93s → 19s, sbom 30s → 9s — all byte-identical output), 17 commands now emit isError/status on error envelopes + 11 commands route their argless --json path through a proper envelope (Pattern-1C drift-guards added), a persisted per-snapshot spectral gap powering a real roam forecast failure budget, MCP prompt-injection marker scan on tool-call egress, release supply-chain hardening (PEP 740 attestations, tag-bound artifacts), and large false-positive cuts in feature-envy / shotgun-surgery / god-components. Full diff in CHANGELOG.md.
v13.3 (released 2026-05-19) — MCP runtime security + UX polish
Egress secret-redaction at the MCP wrapper boundary, 4-mode
policy_decisionenforcement with shadow-mode (ROAM_MODE_DRY_RUN), HMAC-linkedMcpDecisionReceipt+receipt_integrityverdict onroam runs verify.3 new persisting detectors (
boundary,test-hermeticity,compatibility),roam doctoradvisory-vs-blocking split, and--jsonwarnings-channel discipline.
v13.2 (released 2026-05-16) — Evidence freshness + resolution disclosure
Canonical unresolved-path envelopes across
impact/preflight/trace/test-map/context/safe-delete/split/why— one explicit "not found" shape in JSON mode.Evidence freshness stamped at the producer. Runs record hashes for
.roam-rules.yml,.roam/constitution.yml,.roam/control-map.yml.PR Replay evidence coverage improved. Replay path answers 7 of the 8 evidence questions completely; remaining approvals question marked
producer_not_availableinstead of silently omitted.
v13.1 (released 2026-05-15) — Pattern-2 propagation + shared YAML helper + 3 flagship silent-fallback seals
3 flagship silent-fallback seals.
cmd_taint,cmd_health,cmd_doctornow emitstate="empty_corpus"+partial_success=Trueon unanalyzed repos instead of falseHealthy 100/100/No taint findings/all checks passedverdicts.Shared YAML config-loader helper (
load_yaml_with_warnings). 5 of 7 surveyed loaders migrated; ~125 LOC removed.5 new live smell detectors.
type-switch,speculative-generality,empty-catch,cross-layer-clone,parallel-hierarchy—roam smellsnow ships 24 deterministic detectors.30+ behavioral Pattern-2 fixes + empty-corpus smoke sweep across 25+ detectors.
v13.0 (released 2026-05-13) — Agent-OS substrate + Laravel idioms + Vue SFC
Agent-OS control plane. Repo-local substrates under
.roam/: constitution, HMAC-chained run ledger, multi-agent leases, portable agent memory, 4 cumulative modes (read_only→safe_edit→migration→autonomous_pr).World-model classifiers (R28).
roam side-effects,roam idempotency,roam causal-graph,roam tx-boundaries.Laravel dynamic-dispatch idioms. 7 of 8 implicit-edge idioms (Route closures, Eloquent scopes, Policy resolution, Observer registration, Job/Queue/Artisan dispatch).
Vue SFC import graph.
.vuetemplate/script/style blocks parsed; component registrations resolved across the SFC boundary.~20 new CLI commands (
brief,next,mode,constitution,laws,memory,lease,runs,replay,agent-score,agents-md, …) and schema bump (USER_VERSION 12 → 13).
Full release notes in CHANGELOG.md.
Best for
Agent-assisted coding — structured answers that cut tokens vs raw file exploration
Large codebases (100+ files) — graph queries beat linear search at scale
Architecture governance — health scores, CI quality gates, budget enforcement, fitness functions
Safe refactoring — blast radius, affected tests, pre-change safety checks, graph-level editing
Multi-agent orchestration — partition codebases for parallel agents with conflict-aware planning
Security analysis — vulnerability reachability, auth gaps, CVE path tracing, taint analysis
Algorithm optimization — detect O(n²) loops, N+1 queries, and 32 other anti-patterns with suggested fixes
When NOT to use Roam
Real-time type checking — use an LSP (pyright, gopls, tsserver). Roam is static and offline.
Small scripts (<10 files) — read the files directly.
Pure text search — ripgrep is faster for raw string matching.
Core commands
Lead with the 5 verbs. The 5 core commands cover ~80% of agent workflows: understand, context, retrieve, preflight, critique. The remaining ~236 commands are detail surface for specialised workflows (taint, fleet, cga, oracle, eval, …) — they're called by agents on demand, not memorised. This is intentional design; under the hood the canonical surface is 241 commands (234 canonical + 7 aliases) organised into 7 categories (aliases for muscle memory: math → algo, churn → weather, digest / snapshot / trend → trends, onboard → understand, refs → uses), but you don't need to know that to start.
Verb | What it does |
| Full codebase briefing: stack, architecture, key abstractions, health, conventions, entry points |
| AI-optimized context: definition + callers + callees + files-to-read with line ranges |
| Graph-aware context for free-form tasks ("trace login flow", "where is the n+1?") — FTS5 + structural rerank within a token budget |
| Pre-change safety gate: blast radius + tests + complexity + coupling + fitness |
| Verify a patch against the graph: clones-not-edited + blast radius + intent vs semantic-diff. Pipe |
The full surface spans 7 categories — Getting Started, Daily Workflow, Codebase Health, Architecture, Exploration, Reports & CI, and Multi-Repo Workspace. Run roam --help for the 5-verb core, roam --help-all for every command name, and roam surface --json for the machine-readable inventory. Every command accepts roam --json <cmd> for structured output and roam --sarif <cmd> for CI integration (SARIF 2.1.0, honoured by 37 commands).
The complete, always-current list with flags and examples lives in the Command Reference.
A few representative commands beyond the core five:
Health & architecture:
roam health(0-100 score),roam weather(churn × complexity hotspots),roam smells(24 deterministic detectors),roam algo(34-task anti-pattern catalog),roam clusters/roam layers/roam cycles.Change safety:
roam impact <symbol>(blast radius),roam diff(uncommitted-change blast radius),roam pr-risk(0-100 PR risk),roam diagnose <symbol>(root-cause ranking).Backend quality:
roam n1(N+1 queries),roam auth-gaps,roam missing-index,roam over-fetch,roam taint(graph-reach taint, 10 rule packs).Index-aware search:
roam search <pattern>,roam grep <pattern>(grep + reachability + PageRank),roam uses <name>(graph-precise references, no string-literal false positives).Multi-agent:
roam orchestrate --agents N(conflict-aware partitioning),roam fleet plan,roam lease(parallel-agent coordination).
Walkthrough
How you'd use Roam to understand a project you've never seen before, using Flask as an example.
$ roam understand
Tech stack: Python (flask, jinja2, werkzeug)
Architecture: Monolithic — 3 layers, 5 clusters
Key abstractions: Flask, Blueprint, Request, Response
Health: 78/100 — 1 god component (Flask)
Entry points: src/flask/__init__.py, src/flask/cli.py
$ roam file src/flask/app.py # file skeleton: definitions + signatures + health
$ roam deps src/flask/app.py # what imports this file
$ roam weather # hotspots ranked by churn × complexity
$ roam health # composite 0-100 + god components / cycles / layer violations
$ roam context Flask # AI-ready context: files to read with line ranges
$ roam preflight Flask # pre-change gate: blast radius + tests + complexity + fitness
$ roam split src/flask/app.py # internal symbol groups + extraction suggestions
$ roam why Flask url_for Blueprint # role classification (Hub/Bridge/Core) + reach + risk
$ roam health --gate # CI quality gate (exit 5 on failure)Ten commands. Complete picture: structure, dependencies, hotspots, health, context, safety checks, decomposition, and CI gates.
Integration with AI coding tools
Roam is designed to be called by coding agents. Instead of repeatedly grepping and reading files, the agent runs one roam command and gets a verdict-first envelope. roam preflight (above) replaces grep+read+test-impact+complexity+fitness in one ~3KB call; roam health rolls the whole codebase into one score:
$ roam health
VERDICT: Fair codebase (75/100) — 47 critical, 9 warnings, focus: god_components
Health Score: 75/100 | Tangle: 0.0% (7/33395 symbols in cycles)
Propagation Cost: 0.1% | Algebraic Connectivity: 0.0074
Health: 67 issues — 47 CRITICAL, 9 WARNING, 19 INFO
Breakdown: cycles [1 CRITICAL, 1 WARNING], god [31 CRITICAL, 8 WARNING, 11 INFO], bottlenecks [15 CRITICAL]
Top CRITICAL issues (run `roam --detail health` for the full breakdown):
cycle (5 symbols): _COMMANDS, complete, _reconstruct_command
god component: path (prop, degree=2408)The verdict line works alone — an agent that reads nothing else still knows where to look. Pipe --json for the structured envelope your agent consumes.
Fastest setup: point your agent at Roam by writing instructions into its config file.
roam describe --write # auto-detects CLAUDE.md, AGENTS.md, .cursor/rules, etc.
roam describe --agent-prompt # compact ~500-token prompt — copy-paste into an existing config
roam minimap --update # inject/refresh an annotated codebase minimap (won't touch other content)This teaches the agent which command fits each situation: roam preflight before changes, roam context for files to read, roam diagnose for debugging.
Tool | Config file |
Claude Code |
|
OpenAI Codex CLI |
|
Gemini CLI |
|
Cursor |
|
Windsurf |
|
GitHub Copilot |
|
Aider |
|
Continue.dev |
|
Cline |
|
MCP Server
Roam includes a Model Context Protocol server for direct integration with MCP-aware tools.
pip install "roam-code[mcp]"
roam mcpDefault preset: core (58 tools: 57 core + roam_expand_toolset meta-tool).
227 tools span seven presets (core, review, refactor, debug, architecture, compliance, full); core stays narrow to keep the prompt tight. Most tools are read-only index queries; side-effect tools are explicitly annotated. Set ROAM_MCP_PRESET=full roam mcp for the complete toolset.
Cold-start envelope. Any wrapper that can't complete normally — missing index, stale index, partial failure — returns one canonical structured envelope (status, error_code, summary.verdict, hint, next_command) instead of hanging or emitting empty output. Agents always get an actionable signal, never a silent failure.
MCP runtime security. Three controls run at the wrapper boundary inside the server, protecting every client even with no gateway present: egress secret-redaction, mode-gated policy_decision enforcement (opt-in shadow-mode via ROAM_MODE_DRY_RUN), and HMAC-linked decision receipts bound into the signed run ledger. Gateway integrators: see dev/MCP-SECURITY-POSTURE.md.
See Using Roam via MCP for the first-run flow and canonical agent sequence.
Tool | Description |
| Discover Architecture Decision Records (ADRs) and link them to code modules. Scans well-known ADR directories ( |
| Frame architectural issues in changed files as challenges the developer must defend: CRITICAL (new cyclic dependencies), HIGH (layer violations, high-confidence anti-patterns), WARNING (cross-cluster coupling, high fan-out), INFO (orphaned symbols). Composes cycles + clusters + layers + catalog + dead + complexity. Different from |
| Adversarial architecture review: challenges about cycles, anti-patterns, coupling. |
| Monorepo impact analysis: find all affected packages/modules from changes. |
| List the tests you actually need to run after editing a symbol or file. Use when user asks 'which tests do I run?', 'what tests cover X?', or after Edit/Write. Walks reverse-dependencies with hop distance — closer hops run first. For a full pre-commit check (blast radius + fitness + tests), use roam_prepare_change. |
| Extract a single agent's partition from the full agent plan: write scope, read-only dependencies, interface contracts, coordination instructions, and key symbols. Different from |
| Generate AI agent context file (CLAUDE.md/AGENTS.md/.cursorrules) from index. |
| Decompose partitions into dependency-ordered multi-agent tasks: per-task write scope, read-only dependencies, interface contracts, phase schedule, and merge sequencing. Supports |
| Aggregate runs from the local ledger and score each agent on a 0..100 composite (run completion, gate adherence, preflight compliance, blast accuracy, replay survival). Empty state (no runs / no matching runs) returns a clean envelope with |
| Estimate AI-generated code percentage from git commit heuristics. |
| AI readiness score (0-100): how effectively AI agents can work on this codebase. |
| Active health alerts: thresholds breached on tangle, complexity, churn, or coverage. |
| Detect suboptimal algorithms with better alternatives and complexity analysis. |
| Add persistent annotation to a symbol/file for future agent sessions. |
| List the public API surface — exported public symbols with signatures and docs. |
| Detect breaking and non-breaking API changes vs a git ref. |
| Mismatches between backend models and frontend interfaces. |
| Compute per-week growth rates for symbols / edges / cycles across a sliding window of persisted |
| Run a 6-item EU AI Act Article 12 readiness checklist over the indexed repo: audit-trail directory, audit-trail records, retention policy doc, technical docs, attestation surface, high-risk classification heuristic. Emits a structured envelope mapping each item to its Article (12, 18, 19) or Annex (III). Different from |
| Route a natural-language codebase question to the right roam recipe. Use when user asks 'is it safe to delete X?', 'where does login validate?', 'what just broke?', 'who owns module Y?', 'trace the n+1 in checkout'. Maps intent to one of 25 composed recipes (onboard / trace-task / find-bug / verify-patch / explore-impact / security-audit / who-owns / what-changed / explore-tests / dependency-update / ...). Try this BEFORE falling back to Grep+Read — the dispatcher covers most workflows in one tool call. Even low-confidence results contain signal. |
| Proof-carrying PR attestation: evidence bundle + merge verdict. |
| Run a one-shot codebase architecture audit: bundles health, debt, dead-code, risk, test-pyramid, coverage, and API-surface signals into a single envelope. Designed as the structured artifact a written audit report attaches. Different from |
| Score the audit trail against an EU AI Act Article 12 checklist. |
| Export the audit trail as markdown / json / csv for procurement review. |
| Verify SHA-256 chain integrity of a roam audit trail. |
| Endpoints missing authentication or authorization checks. |
| Get details for up to 50 symbols in one call. Replaces 50 sequential roam_symbol calls. |
| Search up to 10 patterns in one call. Replaces 10 sequential roam_search_symbol calls. |
| Find snapshots that caused architectural degradation, ranked by impact. |
| Surface public-by-accident exports + changed-range layer violations. Two closed-enum kinds: public_by_accident (warning, _-prefixed name in all) and wrong_direction_import (high, lower-layer module imports from higher-layer caller). |
| Detect breaking API changes between git refs: removed exports, changed signatures. |
| Compose a one-page agent briefing covering five sections: |
| Check changes against architectural budgets (cycles, health floor, complexity). |
| Score knowledge-concentration risk per directory: Shannon entropy over unique authors, primary-author share, last activity, and a staleness factor. Flags CRITICAL / HIGH / MEDIUM / LOW per module. Different from |
| Sanitized structural graph export without code bodies (privacy-safe). |
| Return the full machine-readable list of every roam MCP tool currently registered, including title, description, and capability flags (core / read_only / destructive). Use this once at session start to discover what's available without enumerating tools. |
| Build per-symbol causal graphs: edges from inputs (parameters / globals / env reads) to sinks (side-effecting calls / return / raise / mutation). Six causal kinds: |
| Emit a Code Graph Attestation — in-toto v1 statement with predicate type |
| Verify a Code Graph Attestation — re-derives the Merkle root + edge-bundle digest from the live DB and compares to the bundled predicate, AND verifies the cosign signature on the sibling |
| List commits since last tag, optionally formatted as a markdown CHANGELOG draft. |
| Run 10 built-in structural rules: cycles, fan-out, complexity, tests, god classes, layer violations. |
| Remove orphaned index entries (files deleted from disk) without full rebuild. |
| Detect near-duplicate code via AST structural hashing (Type-2 clones). |
| Minimal set of changes needed for rename/delete/modify (exact files + lines). |
| Show Louvain code clusters and directory mismatches. Returns per-cluster size, cohesion, conductance, modularity Q, mega-cluster sub-group breakdowns, and inter-cluster coupling. Different from |
| CODEOWNERS coverage, ownership distribution, unowned files, drift detection. |
| Diff two roam indices structurally: reports symbols added/removed/moved, per-file complexity deltas above a threshold, language counts, and a one-line health verdict (improved / regressed / sideways). Different from |
| Detect outbound surface regressions vs a baseline snapshot. Closed-enum verdicts: no regressions / surface additions / surface drift / breaking changes. Compares commands, flags, envelope summary fields, MCP tools, and preset counts. Capture the baseline via CLI: roam compatibility --write-baseline PATH. |
| Prefix completion for symbols / file paths / commands. Faster than search; returns just names. |
| Functions ranked by cognitive complexity above threshold. |
| Detect developer congestion: files with too many concurrent authors within a sliding time window. Combines author count, churn intensity, and complexity into a congestion score that predicts merge conflicts and coordination failures. Different from |
| Get the minimum files + line ranges needed to understand or modify a symbol. Use when user says 'show me X', 'I need to change Y', 'how does Z work?'. Returns targeted reads ranked by PageRank — cheaper than Read'ing whole files. For pre-change safety (blast radius + tests + effects), use roam_prepare_change instead. |
| Auto-detect codebase naming, file, import, and export conventions with outliers. |
| Show temporal coupling: file pairs that change together. Reads git history to find files with high co-change frequency. Different from |
| Find unprotected entry points: top-level exported functions / methods that have no call-graph path to a required gate symbol (auth / permission / validation). Supports exact gate names, regex patterns, framework presets (python / javascript / go / java-maven / rust), and a |
| Verify a unified diff against the codebase graph BEFORE merge. Use when user asks 'review my patch', 'is this PR safe?', or after generating any non-trivial diff. Catches clones-not-edited (missed duplicates the agent should have updated together) + blast-radius hop count. Pass |
| Find fragile domain boundaries via minimum-cut analysis. Computes the thinnest edge cuts between architectural clusters and the highest-impact 'leak edges' whose removal would best improve domain isolation. Different from |
| Minimum cut analysis: fragile domain boundaries, highest-impact leak edges. |
| File pairs that co-change without structural links (hidden coupling). |
| Unified single-screen codebase status: health, hotspots, bus factor, dead code, AI rot. |
| Unreferenced exported symbols (dead code candidates). |
| Prioritized tech debt with SQALE remediation cost estimates. |
| Gate the diff (working / staged / PR / HEAD) on surviving references to deleted symbols and files. Per-deletion verdict: SAFE (no surviving references), LIKELY-SAFE (survivors only in tests / docs / unreachable code), or BREAK-RISK (survivors in reachable code). Different from |
| File-level imports and importers (what depends on this file). |
| Auto-generate a project description for AI coding agents: multi-section Markdown report covering overview, directories, entry points, key abstractions, architecture, and testing. Different from |
| Developer behavioral profiling: commit time patterns, change scatter (Gini), burst detection. |
| Root cause analysis: upstream/downstream suspects ranked by composite risk. |
| Find root-cause suspects for a failing symbol. Use when user reports 'X is broken', 'test Y fails', 'why does Z return null?', 'this exception traces to ...'. Ranks upstream / downstream callers by composite risk and lists side effects + transactional boundaries. Replaces manual Grep+Read traversal of the call graph. Pass the suspect symbol. |
| Show the blast radius of your edits BEFORE you commit. Run after Edit/Write tools to see affected symbols, files, tests, plus coupling and fitness warnings. Use when user asks 'what did my change break?', 'safe to commit?'. Replaces ad-hoc |
| List every symbol matching a name with file/line/kind/signature/PageRank — pick the right overload. |
| Link documentation to code: find drift, dead refs, undocumented symbols. |
| Detect stale docstrings: docs whose body has drifted since the comment was written. Uses |
| Doc coverage + stale-doc drift with PageRank-ranked missing docs. |
| Setup diagnostics: Python version, tree-sitter, git, index existence, freshness, SQLite. |
| One-shot full-stack run: audit + pr-analyze + audit-trail + conformance. |
| Triage view over the dogfood eval corpus: totals, per-command findings count, by-status / by-severity / by-type breakdowns. Reads |
| Ownership drift detection: declared CODEOWNERS vs actual time-decayed contributors. |
| Detect semantically duplicate functions via structural similarity. |
| Side effects of functions: DB writes, network, filesystem (direct + transitive). |
| List all REST/GraphQL/gRPC endpoints with handlers, methods, and locations. |
| Catalog every entry point into the codebase: HTTP routes, CLI commands, scheduled jobs, event handlers, message consumers, main functions, and exports. Reports per-entry reachability coverage -- what fraction of symbols each entry transitively reaches through the call graph. |
| Run the retrieval eval harness over a labeled task set. Reports recall@K, mean reciprocal rank, and per-task diagnostics. Supports a weight sweep and CodeRAG-Bench / BEIR emit formats for public leaderboard submission. |
| Diff two |
| Diagnose a ChangeEvidence packet's health: schema validity, closed-enum conformance, content_hash integrity, completeness banner tier (STRONG / PARTIAL / INSUFFICIENT), declared redactions, and actionable next steps for partial / missing evidence questions. Read-only. |
| Emit an OSCAL v1.2 document. Default kind='control-mapping' compiles the roam control map (maps roam evidence to EU AI Act, ISO/IEC 42001, NIST AI RMF, NIST AI 600-1, NIST SP 800-218A, SOC 2, internal AI-change policy). kind='assessment-results' compiles a per-run AR document from a ChangeEvidence packet (requires evidence_path); AR mandates an Assessment Plan reference — pass import_ap_ref for an external AP or omit it to inline a synthesized stub AP. Supports evidence for the listed frameworks — does not certify compliance. Two roam-specific concepts (authority_refs, redactions) surface as OSCAL |
| List available tool presets or show contents of a preset. Presets: core (57), review (70), refactor (70), debug (69), architecture (71), compliance (13), full (227). |
| Codebase exploration bundle: understand overview + optional symbol deep-dive in one call. |
| Show fan-in / fan-out: the most-connected symbols or files. Flags hub / spreader / HIGH-RISK structural hotspots based on cross-file import / call edges. Different from coupling (co-change frequency) -- this measures structural connectivity. |
| Fetch all or part of a large payload by handle — supports byte slice, section pick, jq projection. |
| File skeleton: all symbols with signatures, kinds, line ranges. |
| Show per-detector finding counts. Useful for spotting which detectors have migrated to the central registry vs which are still only emitting to their detector-specific tables. |
| List rows from the central findings registry, optionally filtered by detector or subject. Cross-detector view -- every migrated detector (clones, dead, complexity, smells, n1, missing-index, ...) emits here behind one schema. |
| Show full detail for a single finding by its stable |
| Topology fingerprint for cross-repo comparison or structural drift tracking. |
| Run architectural fitness functions from |
| Detect potentially stale feature-flag code: flags referenced only once, flags always checked with the same boolean default, and flags clustered in a single file. Recognises LaunchDarkly, Unleash, Split, generic |
| Plan a multi-agent fleet for a goal — graph-aware partition (Louvain + co-change) emits .roam-fleet.json for Composio / Copilot CLI / raw. |
| Show function-level temporal coupling: symbol pairs that change together across commits. Different from |
| Compound: diagnose + affected_tests + diff + context for a symbol you're about to debug. |
| Compound: understand + search + context + complexity for an area you're about to add code to. |
| Compound: preflight + impact + complexity_report + clones for a symbol you're about to refactor. |
| Compound: taint + vuln + critique + adversarial for a security review pass. |
| Predict when metrics will exceed thresholds (Theil-Sen regression). |
| Structured execution plan for code modification: read order, invariants, tests. |
| Read annotations for symbols, files, or project. Filter by tag/date. |
| Implicit contracts for symbols: signature stability, usage spread, breaking risk. |
| Show the structural graph delta between two snapshots. Surfaces new / removed symbols, edge churn, degree shifts, new cycles, layer migrations, and likely renames. Reads persisted snapshots from |
| Report graph-level invariants: density, connected components, average in/out degree, top in-degree symbols, and approximate diameter. One overview number for 'how dense, connected, and cyclic is this codebase'. |
| Run index-aware grep across the codebase. Returns matches with their enclosing symbol, reachability badge, PageRank, clone-class, and bridge annotations. Supports multi-pattern, source-only / test-only filters, reachable-from / unreachable filters, co-occurrence across patterns, and rank-by importance. |
| Check breaking-change risk for a symbol before editing: 0..100 risk score with component breakdown (blast radius, complexity, centrality, test gap, layer analysis) plus caller / callee lists and covering tests -- all within a ~2K-token budget. Different from |
| Codebase health score (0-100) with issue breakdown, cycles, bottlenecks. |
| Run git pickaxe ( |
| Show runtime hotspots: symbols ranked by static analysis vs real production traces (requires |
| One-line architectural summary for a symbol — kind, location, blast-radius bucket, top caller, top callee. |
| Classify symbols by retry safety: |
| Blast radius for 'is it safe to change?' — symbols + files affected, in 5 lines. Compact decision-support output. Round 4 / S: the right default tool for safety-checks; preflight is heavier. |
| Ingest runtime traces (OTel/Jaeger/Zipkin), match spans to symbols. |
| Initialize roam and build the first index. Task-mode for non-blocking setup. |
| Link documentation to code: find which docs mention which symbols, and detect doc-to-code drift (references to non-existent symbols). Different from |
| Discover implicit contracts for a symbol or the public API surface: signature shape, parameter count and ordering, usage spread across files, dependency set. Different from |
| Show topological dependency layers and violations. Returns each layer's symbol count, directory breakdown, and any back-edges that violate the topological order. Different from |
| Run LLM-API integration linter over indexed files: detects unpinned model versions, missing max_tokens, prompt injection via user-input concatenation, unvalidated json.loads on LLM output, and missing temperature. Different from |
| Show project skeleton: directory tree, entry points, top symbols by PageRank, language counts. Different from |
| Show unified per-file or per-symbol metrics: cognitive complexity, fan-in / fan-out, SNA centrality vector (PageRank / betweenness / closeness / eigenvector / clustering coefficient), composite debt score, churn, test coverage, and comprehension difficulty in a single view. |
| Push metrics-only summary to Roam Cloud Lite. Default is dry-run. |
| Generate an ordered migration plan with risk + blast-radius per step from a target-architecture YAML spec or inline |
| Non-idempotent database migrations (unsafe for re-run). |
| Generate a compact ~20-line codebase minimap for CLAUDE.md injection: tech stack, annotated directory tree, key symbols by PageRank, high-fan-in symbols to avoid, hotspots, detected conventions. Different from |
| Queries on non-indexed columns (slow query risk). |
| Show directory contents: exported symbols, signatures, external imports / importers, internal cohesion percentage, and API surface ratio. Different from |
| Agentic editing: move/rename/add-call/extract symbols with auto-import rewrite. |
| Detect N+1 I/O patterns in ORM code (Laravel/Django/Rails/SQLAlchemy/JPA). |
| Suggest the next |
| Generate a new-developer onboarding guide for the codebase. |
| Run multiple oracle queries in one call. Items: [{name, oracle, max_hops?}, ...] where oracle is one of symbol-exists, route-exists, is-test-only, is-reachable-from-entry, is-clone-of. |
| Answer the boolean oracle question: does this symbol have persisted clone siblings in the |
| Answer the boolean oracle question: is the symbol reachable from any entry point via the call graph (BFS up to |
| Answer the boolean oracle question: are ALL callers of this symbol in test files? Useful for sniffing test fixtures and dead-but-test-only helpers. Different from |
| Answer the boolean oracle question: does a route handler match this URL path? Returns a yes/no verdict envelope with the matched handler's file + kind when found. Different from |
| Answer the boolean oracle question: does a symbol with this name exist in the index? Returns a yes/no verdict envelope with the matched symbol's file + kind when found. Different from |
| Alias of roam_oracle_is_test_only — preserves the shorter name agents sometimes guess. |
| Partition codebase for parallel multi-agent work with exclusive write zones. |
| List imports that don't resolve to any indexed module or installed package -- catches typo'd local imports, missing packages, and dangling relative imports. Covers Python (default), JavaScript / TypeScript, and Go. Different from |
| Backend routes with no frontend consumer (dead endpoints). |
| Models serializing too many fields (data over-exposure risk). |
| Show code ownership computed from git blame: per-author line counts, percentages, last-active dates, and a fragmentation index. Works on a file or a directory prefix. Different from |
| Multi-agent work partitioning: split codebase into independent work zones. |
| Critical call paths with zero test protection, ranked by risk. |
| Detect positive architectural patterns: Singleton, Factory, Observer, Repository, Middleware, Strategy, and Decorator. Different from |
| Generate a structured execution plan for modifying code: read-order (call-graph BFS), invariants (mined contracts), blast-radius preview, and per-task heuristics. Five task types: |
| Build an ordered refactor plan for one symbol using risk/test/simulation context. |
| Replay current detectors against past commits: walks a git commit range, runs |
| Agent-aware PR risk verdict — INTENTIONAL / SAFE / REVIEW / BLOCK. |
| Render a markdown PR comment from a pr-analyze JSON envelope. |
| Structural graph delta of code changes: metric deltas, layer violations. |
| One-shot pre-PR fitness check: bundles |
| Risk score (0-100) for pending changes with per-file breakdown. |
| Pre-change safety check: blast radius, tests, complexity, fitness. Call BEFORE modifying code. |
| Bundle everything needed before editing a symbol: blast radius, affected tests, files to read, side effects, fitness gates. Call BEFORE Edit/Write on non-trivial code. Use when user asks 'is it safe to change X?', 'what do I need to know to refactor Y?', 'show me what depends on Z'. Replaces manual preflight + context + effects sequence. |
| Python modernisation signal: walrus, match, PEP 604/585, f-strings vs legacy. |
| Python type-annotation health: % public fns fully typed, Any usage, legacy typing. |
| pytest fixture chain: top fixtures by dependent count, or per-symbol dependency walk. |
| Surface symbols related to a given symbol via three signal sources combined: call-graph neighbours (1-hop in + out), git co-change (other symbols whose files changed in the same commits), and persisted clone siblings (when |
| Audit literal strings across the project and emit a per-string verdict: SAFE-TO-REMOVE / REVIEW / LOAD-BEARING. Groups every reference by surface (code, test, docs, config, generated, vendored) and annotates reachability for code hits. |
| Incremental or force reindex. Task-mode + elicited confirmation for force runs. |
| How symbols connect: shared deps, call chains, conflicts, cohesion score. |
| Compact project skeleton with key symbols per file, by PageRank. |
| Run a compound report preset (built-ins: |
| Delete index DB and rebuild from scratch. Requires force=True. Recovery for corrupted indexes. |
| Graph-aware context for free-form tasks: FTS5 + structural rerank (PageRank + clones) + token budget. |
| Change review bundle: pr-risk + breaking changes + structural diff in one call. |
| Rank symbols by domain-weighted risk: combines static risk (fan-in + fan-out + betweenness) with domain criticality weights so financial / auth / data-integrity symbols rank higher than UI symbols. Different from |
| Evaluate custom governance rules from .roam/rules/ YAML files. |
| Lint a |
| Runtime hotspots where static and runtime rankings disagree (UPGRADE/DOWNGRADE). |
| Fuse dead-code, blast-radius, and test-coverage signals into a single deletion verdict: SAFE / REVIEW / UNSAFE. Reports direct callers (non-test), transitive dependents, affected files, and a public-API bump that flips SAFE -> REVIEW for exported symbols whose name matches a common public-API prefix. Different from |
| Classify the refactor containment zone around a symbol or file: ISOLATED (no external connections), CONTAINED (<=5 boundary symbols), or EXPOSED (>5). Reports strictly-internal vs boundary symbols and external caller / callee counts per boundary. Different from |
| Emit a Software Bill of Materials (CycloneDX 1.7 by default, or SPDX 2.3) enriched with call-graph reachability — distinguishes phantom dependencies from those actually exercised. Pair with --aibom for the AIBOM extension required by EU AI Act Art. 50. |
| Find symbols by natural language query (hybrid BM25 + vector + framework packs). |
| Look up a function / class / method by partial name. Use when user mentions a symbol ('the login handler', 'AuthService.refresh', 'handleSave') and you need the file path, line, kind, and qualified name. Replaces |
| Scan for hardcoded secrets, API keys, tokens, passwords (24 patterns). |
| Structural change summary: what symbols were added/removed/modified. |
| Local-only telemetry: per-tool invocation counts grouped by outcome (success / rate_limited / error). Helps answer "which tools are agents actually using?" and "are 90 of the 227 tools dead weight?". Never phones home — counters live in the MCP server process and reset on restart. |
| Classify symbols by side-effect bucket: |
| Predict metric deltas from move/extract/merge/delete operations. |
| Simulate knowledge loss if a developer leaves the team. |
| Render a compact structural skeleton of a directory: every file's exported symbols with kind, signature, line range, and first-line docstring. Different from |
| Run 24 deterministic code-smell detectors over the indexed codebase: brain methods, god classes, deep nesting, shotgun surgery, feature envy, long parameter lists, large classes, dead params, low cohesion, message chains, data clumps, type switches, cross-layer clones, parallel hierarchies, and more. Different from |
| Spectral bisection: Fiedler vector partition tree and modularity gap. |
| Analyse a file's internal call / reference graph and propose natural decomposition groups via Louvain community detection. Reports per-group isolation %, internal vs cross-group edges, and ranked extraction candidates (groups with >=3 symbols and >=50% isolation). Different from |
| Find dangling file references — markdown links / HTML href-src / backtick paths whose target is missing. v12.48 adds anchor validation, confidence-tagged hints, --diff branch filter, --fix preview/apply, and --sort-by ranking. Set enrich_with_llm=True for LLM-sampled hints on findings the deterministic providers couldn't resolve. |
| Aggregate high-level statistics: language / role / kind counts plus a recent-commit activity counter over a configurable window. Different from |
| Rank proactive refactoring candidates using complexity/coupling/churn/smells. |
| Suggest optimal code reviewers for changed files. |
| Dependency risk dashboard: pin coverage, risk scoring, supply-chain health. |
| Symbol definition, callers, callees, PageRank, fan-in/out metrics. |
| Tree-sitter syntax validation. Finds ERROR/MISSING AST nodes. No index needed. |
| Graph-reach taint analysis. Returns OpenVEX-shaped findings (spec-legal status + justification — never |
| Run |
| Find changed symbols missing test coverage, ranked by severity. |
| Detect non-hermetic test patterns that cause CI flakiness. Six closed-enum kinds: network, time, random, filesystem, env, subprocess. AST-driven (not regex) with module-level suppression for monkeypatch / freezegun / responses / random.seed. |
| Tests transitively reachable from changed symbols — sharper scope than affected_tests. |
| Map a symbol or file to its current test coverage: direct test edges (test file calls the symbol), file-level importers (test file imports the symbol's module), and convention-based matches (Salesforce |
| Count indexed test files by kind (unit / integration / e2e / smoke / unknown) using path and name conventions, and flag inverted pyramids (when |
| Generate a test-file skeleton for a source file or symbol (functions, classes, methods) with the right imports and per-symbol stub blocks. Supports pytest / unittest (Python), jest / mocha / vitest (JS/TS), Go testing, JUnit4 / JUnit5 (Java), and RSpec / Minitest (Ruby). Dry-run by default; pair with |
| Chronological commits that touched the file owning a symbol — author, date, lines added/removed. |
| Codebase onboarding guide: reading order, entry points, architecture roles. |
| Shortest dependency path between two symbols with hop details. |
| Historical metric tracking: record and query health metric trends over time. |
| Classify functions by transactional safety: |
| Brief Claude on an unfamiliar codebase in one call. Use when user asks 'what is this repo?', 'where do I start?', 'give me the lay of the land'. Returns stack, architecture layers, entry points, hotspots, conventions (~2-4K tokens). Do NOT explore with Glob/Grep first — start here. |
| List every caller, importer, and subclass of a symbol — structured by edge type. Use when user asks 'where is X used?', 'who calls Y?', 'what breaks if I rename Z?'. Graph-precise: no comment / string-literal false positives that multi-shape Grep produces. Do NOT use Bash:grep for references — this is the right tool. For 3+ symbols call roam_batch_get (one round-trip) instead. |
| Pre-apply validator for a multi-step change plan. Returns blockers, warnings, advice per operation. |
| Check changed files for naming, import, error-handling, and duplicate issues. |
| Hallucination firewall: validate import statements resolve to indexed symbols. |
| AI rot score (0-100): 8-pattern taxonomy of AI code anti-patterns. |
| Generate Mermaid/DOT architecture diagram with smart filtering. |
| Ingest vulnerability scanner reports (npm/pip/trivy/osv), match to symbols. |
| Vulnerability reachability through call graph: paths, hops, blast radius. |
| Churn x complexity hotspot ranking: highest-leverage refactoring targets. |
| Explain why a symbol matters: role classification (Hub/Bridge/Leaf), transitive reach, critical-path membership, cluster cohesion, and a one-line verdict. Accepts multiple symbol names for batch triage. Different from |
| Triage a failing test/symbol: recently-changed symbols transitively reachable from it. |
| Rank runtime hotspots by cost = log10(call_count + 1) * p99_latency_ms. Reads |
| Inspect a workflow recipe DAG, list available recipes, or suggest what to run next given a prior command. Useful as an agent navigation aid: 'I just ran roam impact -- what should I run next?' Different from the heavyweight analytical recipes -- this is the metadata-only recipe browser. |
| Cross-repo augmented context for a symbol spanning multiple repos. |
| Multi-repo workspace overview: per-repo stats, cross-repo connections. |
| Show cross-language symbol bridges: Protobuf .proto -> generated Go/Java/Python stubs, Salesforce Apex -> Aura/LWC/Visualforce, REST API frontend -> backend route, template variable -> source, and env-var read -> .env definition. Call this tool to list every registered bridge type. |
Core preset tools: roam_affected_tests, roam_alerts, roam_ask, roam_audit_trail_conformance_check, roam_audit_trail_export, roam_audit_trail_verify, roam_batch_get, roam_batch_search, roam_catalog, roam_complete, roam_complexity_report, roam_context, roam_critique, roam_dead_code, roam_deps, roam_diagnose, roam_diagnose_issue, roam_diff, roam_disambiguate, roam_dogfood, roam_explore, roam_fetch_handle, roam_file_info, roam_fleet_plan, roam_for_bug_fix, roam_for_new_feature, roam_for_refactor, roam_for_security_review, roam_health, roam_impact, roam_metrics_push, roam_oracle_is_clone_of, roam_oracle_is_reachable_from_entry, roam_oracle_is_test_only, roam_oracle_route_exists, roam_oracle_symbol_exists, roam_pr_analyze, roam_pr_comment_render, roam_pr_risk, roam_preflight, roam_prepare_change, roam_py_modern, roam_py_types, roam_retrieve, roam_review_change, roam_rules_validate, roam_search_symbol, roam_session_metrics, roam_syntax_check, roam_taint_classify, roam_test_impact, roam_timeline, roam_trace, roam_understand, roam_uses, roam_validate_plan, roam_why_fail.
Claude Code: claude mcp add roam-code -- roam mcp, or add to .mcp.json:
{ "mcpServers": { "roam-code": { "command": "roam", "args": ["mcp"] } } }Claude Desktop — add to claude_desktop_config.json (include "cwd": "/path/to/your/project").
Cursor — add the same mcpServers block to .cursor/mcp.json.
VS Code + Copilot — add to .vscode/mcp.json under a servers key with "type": "stdio".
Go deeper
Pick the path that matches your role:
5-min demo (CTO/CISO/dev-tools-lead): The Canonical Demo — install → health → preflight → critique → signed
ChangeEvidencepacket, five commands, no laptop egress.Developer tutorial (15 min): Getting Started — install, index, query, ship.
Agent integration:
roam mcp-setup claude-code(orcursor,continue) — then Using Roam via MCP for the cold-start envelope and canonical agent loop.Full surface: Command Reference — every command, flag, and JSON envelope.
Architecture: How it fits together — graph, findings registry, run ledger, evidence compiler.
CI/CD integration
All you need is Python 3.10+ and pip install roam-code.
# .github/workflows/roam.yml
name: Roam Analysis
on: [pull_request]
jobs:
roam:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: Cranot/roam-code@main
with:
commands: health
gate: "score>=70"
sarif: true
comment: trueroam init auto-generates this workflow. The Action accepts commands, gate (quality-gate expression, exit 5 on failure), sarif (upload to GitHub Code Scanning), comment (sticky PR comment), cache, and changed-only (incremental mode).
SARIF output. 37 commands honour the global --sarif flag (health, complexity, dead, smells, clones, vulns, taint, secrets, n1, …). Minimal upload:
- run: roam --sarif health > roam-health.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: roam-health.sarifFor GitLab / Jenkins / Azure / Bitbucket templates, severity gates, and upload guardrails, see docs/ci-integration.md.
Paid layers (free CLI stays Apache 2.0)
The CLI is Apache 2.0, fully local, zero-API-key, and never expires. Three optional paid layers build on the same engine:
Roam Review — hosted PR bot for AI-generated changes, built on
roam pr-analyze. CodeRabbit/Greptile review PR semantics; Roam Review reads the graph (who calls the changed symbol, which layer it sits in) and emits a portableChangeEvidencepacket. The CLI engine is a working CI gate today:git diff main..HEAD | roam pr-analyze --gate(exit 5 onBLOCK).Roam Cloud — opt-in metrics history with no source upload.
roam metrics-pushsends a summary-only payload (numerical metrics, paths or SHA-256 hashes, identifier names) — never source-code bodies. Inspect the exact payload with--dry-run.PR Replay — one-shot paid audit of your last 30/90 merged PRs: a written structural-review report plus a founder walk-through. Free DIY sample via
roam pr-replay --tier sample.
Early access — email hello@roam-code.com. Full pricing at https://roam-code.com/pricing.
Language Support
Tier 1 — Full extraction (dedicated parsers)
Language | Extensions | Symbols | References | Inheritance |
Python |
| classes, functions, methods, decorators, variables | imports, calls, inheritance | extends, |
JavaScript |
| classes, functions, arrow functions, CJS exports | imports, require(), calls | extends |
TypeScript |
| interfaces, type aliases, enums + all JS | imports, calls, type refs | extends, implements |
Java |
| classes, interfaces, enums, constructors, fields | imports, calls | extends, implements |
Go |
| structs, interfaces, functions, methods, fields | imports, calls | embedded structs |
Rust |
| structs, traits, impls, enums, functions | use, calls | impl Trait for Struct |
C / C++ |
| structs, classes, functions, namespaces, templates | includes, calls | extends |
C# |
| classes, interfaces, structs, enums, records, methods, properties, delegates, events | using directives, calls, | extends, implements |
PHP |
| classes, interfaces, traits, enums, methods, properties | namespace use, calls, static calls, | extends, implements, use (traits) |
Ruby |
| classes, modules, methods, singleton methods, constants | require, require_relative, include/extend, calls | class inheritance |
Kotlin |
| classes, interfaces, enums, objects, functions, methods, properties | imports, calls, type refs | extends, implements |
Scala |
| classes, traits, objects, case classes, functions, val/var, type aliases | imports, calls, | extends, with (trait mixins) |
Swift |
| classes, structs, enums, protocols, functions, methods, properties | imports, calls, type refs | extends, conforms |
Dart |
| classes, mixins, extensions, enums, type aliases, functions, methods, constructors | imports, calls, type refs | extends, implements, with |
Visual FoxPro |
| functions, procedures, classes, methods, properties, constants | DO, SET PROCEDURE/CLASSLIB, CREATEOBJECT, | DEFINE CLASS ... AS |
SQL (DDL) |
| tables, columns, views, functions, triggers, schemas, types, sequences | foreign keys, view table deps, trigger refs | — |
YAML (CI/CD) |
| GitLab CI jobs/anchors, GitHub Actions workflows/jobs, generic top-level keys |
| — |
HCL / Terraform |
|
|
| — |
Vue / Svelte |
| via | imports, calls, type refs | extends, implements |
Language | Extensions | Symbols | References |
Apex |
| classes, triggers, SOQL, annotations | imports, calls, System.Label, generic type refs |
Aura |
| components, attributes, methods, events | controller refs, component refs |
LWC (JavaScript) |
| anonymous class from filename |
|
Visualforce |
| pages, components | controller/extensions, merge fields, includes |
SF Metadata XML |
| objects, fields, rules, layouts | Apex class refs, formula field refs, Flow actionCalls |
Cross-language edges mean roam impact AccountService shows blast radius across Apex, LWC, Aura, Visualforce, and Flows.
Tier 2 languages (and .jsonc / .mdx) get basic symbol extraction via a generic tree-sitter walker.
Performance
Metric | Value |
Index 200 files | ~3-5s |
Index 3,000 files | ~2 min |
Incremental (no changes) | <1s |
Any query command | <0.5s |
After the first full index, roam index only re-processes changed files (mtime + SHA-256 hash). Detailed indexing benchmarks across Express / Axios / Vue / Laravel / Svelte live in benchmarks/.
How It Works
Codebase
|
[1] Discovery ──── git ls-files (respects .gitignore + .roamignore)
[2] Parse ──────── tree-sitter AST per file (28 languages)
[3] Extract ────── symbols + references (calls, imports, inheritance)
[4] Resolve ────── match references to definitions → edges
[5] Metrics ────── adaptive PageRank, betweenness, cognitive complexity, Halstead
[6] Algorithms ── 34-task anti-pattern catalog (O(n^2) loops, N+1, recursion, async)
[7] Git ────────── churn, co-change matrix, authorship, Renyi entropy
[8] Clusters ───── Louvain community detection
[9] Health ─────── per-file scores (7-factor) + composite score (0-100)
[10] Store ─────── .roam/index.db (SQLite, WAL mode)Exclude paths with a .roamignore file (full gitignore syntax) or roam config --exclude "*.proto". For the graph algorithms (Personalized PageRank for blast radius, Tarjan SCC, Louvain, Fiedler bisection, Mann-Kendall trend detection, …) and the weighted-geometric-mean health score, see the Architecture guide.
How Roam Compares
roam-code is the only tool that combines graph algorithms (PageRank, Tarjan SCC, Louvain clustering), git archaeology, architecture simulation, and multi-agent partitioning in a single local CLI with zero API keys.
Capability | roam-code | AI IDEs (Cursor, Windsurf) | AI Agents (Claude Code, Codex) | SAST (SonarQube, CodeQL) |
Persistent local index | SQLite | Cloud embeddings | None | Per-scan |
Call graph analysis | Yes | No | No | Yes (CodeQL) |
PageRank / centrality | Yes | No | No | No |
Cycle detection (Tarjan) | Yes | No | No | Deprecated (SonarQube) |
Community detection (Louvain) | Yes | No | No | No |
Git churn / co-change | Yes | No | No | No |
Architecture simulation | Yes | No | No | No |
Multi-agent partitioning | Yes | No | No | No |
MCP tools for agents | 227 (57 in default core preset) | Client only | Client only | 34 (SonarQube) |
Languages | 28 | 70+ | 50+ | 12-42 |
100% local, zero API keys | Yes | No | No | Partial |
Open source | Apache 2.0 | No | Partial | Partial |
Interprocedural taint depth | shallow (OpenVEX-shaped) | n/a | n/a | deep (CodeQL) |
Built-in rule packs | 10 taint packs, 10 governance rules | n/a | n/a | 2,000+ (Semgrep community) |
Cross-repo at GitHub scale | workspace overlay (sibling repos) | n/a | n/a | native (Sourcegraph) |
Key Differentiators
vs AI IDEs (Cursor, Windsurf, Augment): roam-code provides deterministic structural analysis. AI IDEs use probabilistic embeddings that can't guarantee reproducible results.
vs AI Agents (Claude Code, Codex CLI, Gemini CLI): these agents read files one at a time. roam-code pre-computes relationships so agents get instant answers about architecture, blast radius, and dependencies.
vs SAST Tools (SonarQube, CodeQL, Semgrep): SAST tools find bugs and vulnerabilities. roam-code understands architecture — how code is structured, where it's coupled, and what breaks when you change it. Complementary, not competitive.
vs Code Search (Sourcegraph/Amp, Greptile): text search finds where code is. roam-code understands why code matters — which functions are central, which modules are tangled, which files are high-risk.
Tool | Annual cost (20-dev team) | Infrastructure | Setup time |
SonarQube Server (paid tier) | $15,000-$45,000 | Self-hosted server | Days |
CodeScene | $20,000-$60,000 | SaaS or on-prem | Hours |
Code Climate | $12,000-$36,000 | SaaS | Hours |
Roam (free CLI) | $0 (Apache 2.0) | None (local) | 5 minutes |
The comparison is against the paid tiers a 20-dev team usually buys, not free Community editions. Roam complements either tier — pipe its SARIF output into the same Code Scanning surface. Rollout: pilot on one repo, add roam health --gate to CI as non-blocking, then tighten thresholds and track trajectory with roam trends.
FAQ
Does Roam send any data externally?
No by default — zero telemetry, zero analytics, zero update checks. The single outbound surface is roam metrics-push: opt-in, summary metrics only, prints its exact payload locally under --dry-run. Source-code bodies never leave the machine.
Can Roam run in air-gapped environments? Yes. Once installed, no internet access is required.
Does Roam modify my source code?
Read-only by default. Creates .roam/ with an index database. roam mutate (move/rename/extract) defaults to --dry-run; pass --apply explicitly to write changes.
How does Roam handle monorepos and multi-repo projects?
Monorepos: indexes from the root; batched SQL handles 100k+ symbols. Multi-repo: roam ws init <repo1> <repo2> builds a workspace overlay DB for cross-repo API edges, then roam ws resolve / ws context / ws trace work across repos.
Is Roam compatible with SonarQube / CodeScene? Yes — they coexist in the same CI pipeline. SARIF output uploads to GitHub Code Scanning.
Does Roam satisfy SOC 2 / ISO 42001 / EU AI Act on its own?
No. Roam maps to controls and produces supporting evidence — the signed ChangeEvidence packet, HMAC-chained run ledger, and audit-trail records answer the eight evidence questions a reviewer asks after an AI-assisted change. Roam does not certify; your auditor still owns that step.
What's the difference between the free CLI and Roam Review / Cloud / PR Replay? The CLI is Apache 2.0, fully local, and never expires. Roam Review is a hosted PR bot, Roam Cloud is opt-in metrics history with no source upload, PR Replay is a one-shot paid audit. All three are layers on top of the same engine.
Limitations
Static analysis primarily — can't trace dynamic dispatch, reflection, or eval'd code. Runtime trace ingestion (
roam ingest-trace) adds production data but requires external trace export.Import resolution is heuristic — complex re-exports or conditional imports may not resolve.
Limited cross-language edges — Salesforce, Protobuf, REST API, and multi-repo edges are supported, but not arbitrary FFI.
Tier 2 languages get basic symbol extraction only via the generic tree-sitter walker.
Large monorepos (100k+ files) may have slow initial indexing.
Troubleshooting
Problem | Solution |
| Ensure install location is on PATH. For |
| Delete |
|
|
Unicode errors on Windows |
|
Symbol resolves to wrong file | Use |
Health score seems wrong |
|
Index stale after |
|
Update / Uninstall
# Update
pipx upgrade roam-code # or: uv tool upgrade roam-code / pip install --upgrade roam-code
# Uninstall
pipx uninstall roam-code # or: uv tool uninstall roam-code / pip uninstall roam-codeDelete .roam/ from your project root to clean up local data.
Contributing
git clone https://github.com/Cranot/roam-code.git
cd roam-code
pip install -e ".[dev]" # includes pytest, ruff
pytest tests/ # all test cases must passGood first contributions: add a Tier 1 language (see go_lang.py or php_lang.py as templates), improve reference resolution, add benchmark repos, extend SARIF converters, add MCP tools. Please open an issue first to discuss larger changes.
License
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cranot/roam-code'
If you have feedback or need assistance with the MCP directory API, please join our Discord server