Reference
Command Reference
Pick a command for the question your agent is working on: find relevant code, investigate a pattern, explore an alternative, or check a change. Start with the examples below; the complete reference lists the full CLI. Ordinary analysis is local and credential-free; explicitly enabled network features are inventoried on the security page.
roam --json <command> for structured analysis results. Read the verdict together with its scope and any incomplete checks. Run roam <command> --help for the installed version's arguments and options.
How to read this reference
Start with your task, not the size of the command list. The groups below offer entry points for code investigation, implementation choices and change checks. See the homepage examples for the questions behind these tools.
| Tier | What it covers | When to reach for it |
|---|---|---|
| Tier 1 — Investigation and change checks | understand · retrieve · context · preflight · critique | Orient in a repository, gather relevant source, and check a proposed change. |
| Tier 2 — Focused analysis | impact · affected-tests · test-gaps · safe-delete · clones · pr-risk · verify-imports · algo (legacy alias: math) | Investigate a specific relationship, risk or implementation choice. |
| Tier 3 — Agent / MCP | mcp · mcp-setup · agent-export · skill-generate · minimap · agent-context | Wiring Roam into Claude Code, Cursor, Codex, your own agent. |
| Tier 4 — CI / enterprise | pr-analyze · pr-comment-render · attest · audit-trail-export · audit-trail-verify · --sarif | Production CI gates, audit evidence, signed attestations. |
| Tier 5 — Specialized workflows | Additional commands in the complete reference below. | Check the command's help and prerequisites for your particular task. |
Five commands to start with
Useful starting points, not a complete workflow or the MCP core preset. Connect Roam and build the index first; refresh it as the code changes.
| Verb | What it does | Example |
|---|---|---|
understand |
Repository overview: layers, sizes, hotspots and entry points. | roam understand |
retrieve |
Ranked source passages for a task, using text search and indexed code relationships. | roam retrieve "where is auth?" |
context |
Files + line ranges to read before changing a symbol, prioritised by callers and tests. | roam context AuthService |
preflight |
Blast radius, affected tests, complexity, fitness rules — all in one verdict. | roam preflight AuthService |
critique |
Inspect a patch for related code and risks beyond the edited lines. Export the intended Git diff to change.patch and check that Git succeeded. Use a non-empty patch and replace the example intent with your change’s purpose. Saved clone evidence must be current and complete for that check to count as complete; read summary.review_source and partial_success. |
roam --json critique --input change.patch --intent "Round checkout totals" |
Exploration
| Command | What it does |
|---|---|
roam search <pattern> | Symbol search by name substring; BM25/FTS5 reranking when --explain is set |
roam symbol <name> | Show symbol definition, callers, and callees |
roam file <path> | Detailed file info: complexity, ownership, recent changes |
roam impact <name> | Indexed dependents and files a change could affect, within the reported traversal limits |
roam trace <a> <b> | k-shortest paths between two symbols in the call graph |
roam tour | Onboarding tour: top symbols, reading order, entry points, language breakdown, stats |
roam diagnose <name> | Root-cause ranking for a failing symbol |
roam ask "<question>" | Natural-language intent dispatch over the recipe registry |
Health & Quality
| Command | What it does |
|---|---|
roam health | Composite health score (0-100) with risk breakdown |
roam health --gate | Same, but exits non-zero on threshold breach |
roam complexity | Rank functions by cognitive complexity to choose code worth investigating. This measures branching and nesting, not runtime speed or correctness. |
roam debt | Tech-debt aggregate; --roi ranks refactor candidates |
roam check-rules | Run all built-in + community rule packs |
roam test-gaps --changed | Find changed symbols without indexed test connections or imported coverage evidence. Also accepts explicit file paths; it does not run tests. |
roam why-slow | Runtime hotspots from ingested traces |
Refactoring
| Command | What it does |
|---|---|
roam suggest-refactoring | Top-N refactor candidates by ROI |
roam plan-refactor <name> | Propose refactoring steps using indexed relationships; review and test the resulting changes |
roam mutate move <sym> <file> | Preview a move and supported import updates; --apply writes changes |
roam simulate move <sym> <file> | What-if architecture — clone the graph and apply a move |
roam clones --persist | Detect AST-level clones; persist to clone_pairs for critique |
roam migration-plan | Current architecture → target architecture roadmap |
roam stale-refs [--gate] [--fix preview|apply] [--attest path] | Find dangling file references — markdown links / HTML href-src / backtick paths / anchors whose target is missing. Index-free. Supports SARIF, in-toto attestations, LSP code actions, repo-config (--init), and --root for monorepos. |
Security & Governance
| Command | What it does |
|---|---|
roam taint | Inspect source-to-sink findings under the selected rules. Distinguish dataflow evidence from co-occurrence; neither proves exploitability. |
roam vuln-reach | Query reachability of ingested vulnerabilities; --cve scopes to one CVE, --from to one entry point |
roam adversarial | Adversarial architecture review — challenges your changes by composing diff + cycles + clusters + layers + detectors |
roam cga emit | Sign an in-toto v1 Code Graph Attestation |
roam cga verify | Verify a CGA attestation (cosign-aware) |
roam attest | Proof-carrying PR attestation — bundles diff, risk, breaking changes, and fitness for a commit range |
Multi-Agent & MCP
| Command | What it does |
|---|---|
roam mcp | Start the MCP server (stdio transport) |
roam mcp --list-tools | Print every MCP tool exposed by the active preset (default: 17 tools including the roam_expand_toolset meta-tool; 246 in full) |
roam mcp-setup <client> | Generate config for Claude Code, Cursor, Windsurf, VS Code, Gemini CLI, Codex CLI |
roam fleet plan | Partition work across N agents (Louvain + co-change + PageRank) |
roam orchestrate | Multi-agent coordination plan with conflict-aware partitions |
roam skill-generate | Emit a SKILL.md file from the Capability Registry |
Output Modes
Place global output flags before the command. Format support varies; for example, --sarif applies only to the supported analysis commands below.
| Flag | Effect |
|---|---|
--json | Stable JSON envelope with schema versioning. For agent + script consumption. |
--sarif | SARIF 2.1.0 — for GitHub Code Scanning. Supported on SARIF-capable analysis commands including health, complexity, dead, smells, clones, vulns, taint, secrets, n1, dark-matter, supply-chain, critique, stale-refs. Run roam --help for the live list. |
--agent | Compact JSON + 500-token default budget. Optimised for sub-agent CLI calls. |
--budget <n> | Cap output to N tokens (0 = unlimited). |
--select <expr> | Project JSON with .field, [N], or [START:END]; repeatable and implies JSON. |
Interpret evidence before acting
Read the verdict together with scope, resolution, metric definitions,
partial_success, truncation, and skipped-check reasons.
Exit zero does not mean every check ran or every finding is resolved.
safe-deleteemitsSAFE / REVIEW / UNSAFE. Missing indexed references do not prove absence of dynamic, member, or external use; imported-but-unresolved cases require review.algoreports candidate patterns. Inspect the exact source, loop inputs, receiver identity, and ordering requirements; test and measure before applying an optimization.observability-optreports raw-print review candidates, not proven debug leftovers. Python checks actual call syntax and skips docstring/comment examples. Keep intentional CLI output; unreadable or unparseable sources make the result incomplete. Other languages still use text-pattern heuristics.doctorchecks SQLite integrity independently of index completion or matching search-row counts. Specific failures appear inintegrity_errors; a repair does not establish why the corruption happened.test-map,ai-readiness, andpath-coverageuse static relationships, not runtime coverage. Depth-pruned paths and empty input cannot establish a clean result.ai-ratiois an uncalibrated pattern score, not an AI-written percentage. Legacy JSON score keys do not establish authorship.taintdistinguishes dataflow evidence from co-occurrence. Inspect the sink argument, sanitizers, and execution context; even a high-confidence graph finding is not exploitability proof.partitionchooses two through eight agents by default; the MCProam_partitiondefault is explicitly four. Review shared files and merge order; the manifest does not enforce ownership.
Global flags go before the command: roam --detail algo or
roam --json ai-readiness. Compare Git structure with
roam semantic-diff --base HEAD~1. Use
roam plan-refactor SymbolName for a symbol and
roam split path/to/file.ts for a file.
magic-numbers defaults to the current directory, respects
discovery exclusions, and includes monorepo workspaces. Relative
JavaScript imports can resolve to TypeScript source through extension
substitution; this is not a complete compiler or bundler resolver.
Investigate algorithm choices
roam algo looks for source patterns that may have a better
approach and pairs findings with catalogued alternatives. Your agent
gets a place to inspect and an option to evaluate, not just a warning
that a function is complex.
roam index
roam --json algo
For each candidate, inspect the matched source and the stated assumptions. Check inputs, ordering and side effects, then test correctness and measure performance before adopting a replacement. Refresh the index after code changes. An empty or partial scan is not proof that every algorithm is appropriate.
Run an example: repeated membership checks or needed positions?
With Roam installed, start in an empty folder and save this as
lookup.js. The first function repeatedly searches an array;
the second builds a membership lookup once. The third needs positions.
function countAllowed(values, allowed) {
let count = 0;
for (const value of values) {
if (allowed.indexOf(value) !== -1) count++;
}
return count;
}
function countAllowedWithSet(values, allowed) {
const lookup = new Set(allowed);
let count = 0;
for (const value of values) {
if (lookup.has(value)) count++;
}
return count;
}
function findPositions(values, allowed) {
const positions = [];
for (const value of values) {
positions.push(allowed.indexOf(value));
}
return positions;
}
Index the file and ask for the repeated-lookup candidates:
git init --quiet
git add -- lookup.js
roam --json index
roam --json algo --task loop-lookup --path lookup.js
This synthetic fixture was run with Roam 14.1.0 on 13 September 2026
(UTC). These are selected fields from findings[0], not
the full JSON response:
{
"location": "lookup.js:1",
"symbol_name": "countAllowed",
"task_id": "loop-lookup",
"suggested_way": "set-prebuilt",
"confidence": "medium"
}
The scan reported countAllowed; it did not flag the
existing set lookup or the position-returning function for this task.
Inspect summary.partial_success, summary.truncated,
summary.detectors_failed and summary.scoped_paths in the full
response. This example checks one file and one task. If a scan is
partial, investigate reported candidates, inspect the failures, and
rerun failed checks before drawing conclusions from missing findings.
For ordinary, unchanged arrays of strings, the set version preserves
the count, including repeated input values. It allocates a separate
lookup, so weigh construction cost and memory against the workload.
Keep the position lookup when callers need offsets:
findPositions(["admin", "guest"], ["guest", "admin", "admin"])
returns [1, 0]; Set.has cannot supply those
first-match positions or the missing-value sentinel -1.
Value semantics also matter: with [NaN] as both inputs,
countAllowed returns 0 and the set version
returns 1. Test the real input contract, mutation and
callers before replacing a lookup. No speedup was measured.
The CLI command is algo; math remains a legacy
alias. For MCP, select the review preset and restart the server;
roam_algo is not in the default core preset.
Check the connected tool list.
Preview a specific code edit
roam mutate supports move, rename, add-call and extract
operations. The agent supplies the operation and its arguments. Roam
previews the planned edits by default; --apply writes them
to source files.
Example: preview moving an indexed handle_login function.
Replace the name and destination with ones from your repository.
roam --json mutate move handle_login src/auth/login.py
Inspect the proposed edits and warnings before applying. Move uses indexed references for supported import updates; that is not complete language or dependency resolution. Review the diff, refresh the index and run the project's tests and build after an applied change.
Try a change on the graph first
roam simulate applies one requested move, extract, merge or
delete operation to a copy of the indexed graph and compares structural
metrics. It does not edit source files or choose an architecture for you.
Example: compare the graph before and after a proposed move. Replace this example symbol and path with your own.
roam --json simulate move handle_login src/auth/login.py
Use the result to investigate a proposal, not to approve an edit. A move changes file placement in the model while keeping its edges, so topology-based metrics can stay unchanged. These metrics do not establish runtime performance or behavior after an actual refactor.
Where to find more
- Every command: run
roam --help-allin a terminal. The surface is large; pick by question, not by reading top-to-bottom — see How Roam thinks for the nine-moment decision tree. - Per-command flags:
roam <cmd> --help. - Recipes:
roam ask --listshows every dispatchable recipe;roam ask "<intent>"runs the closest match. - Source: each command lives in
src/roam/commands/cmd_*.py. Apache 2.0. - Something broken? See Troubleshooting for index errors, missing flags, MCP setup issues, and rebuild guidance.
See a complete workflow: the worked verification example shows how to bind a run, collect checks, review a change and verify its evidence bundle.
Complete Reference
Auto-generated from the CLI command registry and complete first docstring paragraphs. Every canonical command + alias has a direct link; inspect the same surface with roam --help-all.
Getting Started
| Command | Description |
|---|---|
roam ask | Run the recipe that matches a free-form query. |
roam workflow | Inspect a workflow recipe DAG, review lenses, and next commands. |
roam index | Build or rebuild the codebase index. |
roam index-export | Export the roam index as a portable, integrity-checked tarball. |
roam index-import | Import a portable roam index bundle into the current repo. |
roam watch | Watch for file changes and auto-re-index incrementally. |
roam init | Initialize Roam for this project: index + config. |
roam hooks | Manage git hook integration for automatic re-indexing. |
roam reset | Delete the index DB and rebuild from scratch. |
roam clean | Remove orphaned entries from the index (files no longer on disk). |
roam config | Manage per-project roam configuration (.roam/config.json). |
roam doctor | Diagnose environment setup: Python, dependencies, and index state. |
roam understand | Single-call codebase comprehension — everything in one shot. |
roam dashboard | Unified codebase status: health, hotspots, debt, bus factor, AI rot. |
roam tour | Generate a codebase onboarding tour. |
roam describe | Auto-generate a project description for AI coding agents. |
roam minimap | Generate a compact codebase minimap for CLAUDE.md injection. |
roam agent-export | Generate an AI agent context file from the roam index. |
roam ws | Manage multi-repo workspaces with cross-repo dependency tracking. |
roam schema | Show the roam JSON envelope schema and validate output files. |
roam mcp | Start the roam MCP server. |
roam mcp-setup | Generate MCP server config for AI coding platforms. |
roam mcp-status | Report MCP server status: preset, tools, backpressure, cache, watcher. |
roam ci-setup | Generate CI/CD pipeline config for roam-code integration. |
roam adrs | Discover Architecture Decision Records and link them to code modules. |
roam audit | One-shot codebase architecture audit. |
roam changelog | List commits since the last tag, optionally as a markdown draft. |
roam exit-codes | List every roam exit code with its meaning. |
roam help-search | Fuzzy search across every command's help text. |
roam plugins | Inspect roam plugins discovered via entry points / ROAM_PLUGIN_MODULES. |
roam pre-commit | Install or preview a roam-critique pre-commit git hook. |
roam recipes | List every ``roam ask`` recipe with intent + example queries. |
roam version | Print the installed roam-code version (and check PyPI with --check). |
roam index-stats | Report .roam index size, row counts, and fragmentation. |
roam stats | Aggregate metrics: language, role, kind counts + recent activity. |
roam telemetry | Show local telemetry: slowest commands + recent runs. |
roam surface | Print the canonical capability surface (commands, aliases, MCP tools, maturity). |
roam surface-gaps | Find gaps between CLI registration, MCP exposure, and documentation. |
roam commands | List the repo's runnable commands, classified + evidence-backed. |
roam explain-command | Show what a command does, what it depends on, and how stale-index sensitive it is. |
roam db-check | Integrity sweep over the local index. Reports orphans, broken edges, missing FTS, etc. |
Daily Workflow
| Command | Description |
|---|---|
roam preflight | Run a pre-change safety checklist for a symbol, file, or staged changes. |
roam permit | Structural-permission verdict facade for AI agents + W198 issuance. |
roam postmortem | Replay current detectors against past commits. |
roam pr-replay | Generate a PR Replay report. |
roam service-report | Generate a one-command service-engagement report. |
roam reachability-triage | Emit zero-egress vulnerability reachability facts. |
roam guard | Check breaking-change risk for SYMBOL before editing. |
roam guard-pr | Run the full Roam Guard pipeline in one call. |
roam guard-doctor | Preflight + health check before running roam guard-pr. |
roam guard-init | Bootstrap `.roam/` + optional rule-pack stub for Roam Guard. |
roam guard-clean | Prune `.roam/verdict-log.jsonl` to its last N entries. |
roam guard-diff | Show the verdict delta between two bundle snapshots. |
roam guard-history | Show recent pr-bundles + their last-known verdict. |
roam guard-rules | Inspect / validate / test Roam Guard verification rule packs. |
roam proof-bundle | Compose and emit the AgentChangeProofBundle v1 from a pr-bundle. |
roam verdict | Compute the closed-enum verdict for a proof bundle. |
roam verification-contract | Emit the G3 verification contract for changed files + mode + policy. |
roam bench-compile | Run a controlled A/B between vanilla / static / compile prompt modes. |
roam agent-plan | Decompose partitions into dependency-ordered multi-agent tasks. |
roam agent-context | Generate per-worker context: write scope, read-only deps, and contracts. |
roam pr-risk | Compute risk score for pending changes. |
roam pr-prep | One-shot pre-PR fitness check: diff + critique + pr-risk. |
roam pr-analyze | Analyse a PR diff for structural risk and AI-likelihood. |
roam pr-bundle | Proof-carrying PR bundle (R26 -- Roam Review MVP differentiator). |
roam pr-comment-render | Render a markdown PR comment from a pr-analyze envelope. |
roam rules-validate | Lint a `.roam/rules.yml` file before shipping it to your team. |
roam metrics-push | Push metrics-only summary to Roam Cloud Lite. |
roam audit-trail-verify | Verify SHA-256 chain integrity of a roam audit trail. |
roam audit-trail-export | Export the audit trail for procurement / compliance review. |
roam audit-trail-conformance-check | Score the audit trail against an EU AI Act Article 12 checklist. |
roam article-12-check | EU AI Act Article 12 readiness assessment for the indexed repo. |
roam capabilities | Emit the capability registry — every command's machine-readable shape. |
roam skill-generate | Generate an agent-runtime skill manifest from the capability registry. |
roam compare | Structural diff between two roam indices. |
roam migration-plan | Generate an ordered migration plan with risk + blast-radius per step. |
roam dogfood | Run audit, PR analysis and optional audit-trail checks together. |
roam dogfood-aggregate | Aggregate the dogfood eval corpus into a backlog/triage view. |
roam suppress | Suppress a math / over-fetch / missing-index / auth-gaps finding. |
roam pr-diff | Show structural impact of pending changes. |
roam evidence-diff | Diff two ``ChangeEvidence`` packets. |
roam evidence-doctor | Diagnose a ``ChangeEvidence`` packet's health. |
roam evidence-oscal | Emit an OSCAL v1.2 document (Control Mapping or Assessment Results). |
roam api-changes | Detect breaking and non-breaking API changes vs a git ref. |
roam semantic-diff | Show structural change summary vs a git ref. |
roam test-gaps | Find changed symbols without test-connection or coverage evidence. |
roam affected | Identify affected files/modules from a git diff via dependency graph. |
roam attest | Generate a proof-carrying PR attestation. |
roam review-request | Emit the brief to hand a different-family reviewer. |
roam review-accept | Record a review outcome as a receipt the verdict gate can read. |
roam review-verify | Re-derive the review verdict from the artifact's CURRENT bytes. |
roam adversarial | Adversarial architecture review -- challenge your changes. |
roam verify | Verify changed files follow codebase conventions. |
roam verify-imports | Validate import/require statements against the indexed symbol table. |
roam diff | Show blast radius: what code is affected by your changes. |
roam context | Get the minimal context needed to safely modify a symbol. |
roam hover | Show a one-line architectural summary for SYMBOL. |
roam retrieve | Return ranked code spans for a free-form task. |
roam critique | Verify a patch against the indexed graph. |
roam fleet | Graph-aware planner for multi-agent code work. |
roam affected-tests | Trace from a changed symbol or file to test files that exercise it. |
roam test-impact | List tests transitively reachable from symbols changed in <range>. |
roam diagnose | Root cause analysis for a failing SYMBOL. |
roam why-fail | Find recently-changed symbols transitively reached by a failing test. |
roam recommend | Recommend related symbols using call-graph, co-change, and clone signals. |
roam api | List the public API surface (exported public symbols). |
roam disambiguate | List every symbol matching SYMBOL with disambiguators. |
roam annotate | Annotate a symbol or file with a persistent note. |
roam annotations | List annotations for a symbol, file, or the whole project. |
roam plan | Generate a structured execution plan for modifying code. |
roam compile | Compile TASK (freeform string) into an agent-consumable envelope. |
roam compile-stats | Show distribution stats over the compile telemetry log. |
roam savings | Materialize the local episode ledger and report admissible savings evidence. |
roam savings-backfill | Write a value-redacted historical episode snapshot for repeated-pattern discovery. |
roam compile-cache | Manage the persistent envelope cache. |
roam compile-daemon | S2-lite warm compile server (per-repo, manual lifecycle, fail-open). |
roam envelope-diff | Compare two compile envelopes A and B. Reports probe-family and classifier deltas. With --baseline, A is a prompt; the matching baseline replaces B. |
roam dispatch-trace | Emit the classifier + dispatch decision tree for PROMPT. |
roam syntax-check | Check files for syntax errors using tree-sitter AST parsing. |
roam triage | Manage security finding suppressions. |
roam oracle | Container for the five v12.1 boolean oracles. |
roam memory | Repo-local agent memory. |
roam runs | Per-agent-run event ledger. |
roam laws | Self-installing constitution. |
roam constitution | Repo-local agent constitution -- capstone for agent-OS substrates. |
roam agents-md | Generate an ``AGENTS.md`` describing this codebase to AI agents. |
roam next | Suggest the next roam command based on current repo state. |
roam brief | One-page agent briefing covering mode / next / highlights / pr-bundle / runs. |
roam replay | Re-narrate a past run and (optionally) rerun its commands. |
roam agent-score | Aggregate runs and score each agent on a 0..100 composite. |
roam mode | Show, switch, or query the active agent mode. |
roam intent-check | Verify INTENDED_COMMAND would be allowed by the active mode. |
roam lease | Multi-agent lease system. |
Codebase Health
| Command | Description |
|---|---|
roam health | Show code health: cycles, god components, bottlenecks. |
roam smells | Detect code smells: brain methods, god classes, deep nesting, and more. |
roam magic-numbers | Scan source for hardcoded numeric constants that should be named constants. Python via ``ast``; JS/TS/Go/Rust/Java/Ruby/C/C# via tree-sitter (with a regex fallback when the grammar isn't available). Defaults to the current directory, including monorepo workspaces; respects discovery exclusions and skips test files. |
roam calc-inventory | Enumerate computed-numeric fields + their formulas from the AST. |
roam calc-probe | Empirically compare rounding implementations on tie-boundary inputs. |
roam calc-golden | Golden-master calculation oracle: extract / audit / check. |
roam compiler-health | One envelope per compiler health snapshot. |
roam compiler-corpus | Compile every prompt in a corpus file and aggregate the pipeline metrics. |
roam vibe-check | Detect AI code anti-patterns and compute AI rot score. |
roam llm-smells | Detect LLM-API integration anti-patterns. |
roam collapse | Detect unavailable sources collapsed into benign defaults. |
roam ai-readiness | Estimate how effectively AI agents can work on this codebase (0-100). |
roam check-rules | Run structural governance rules against the indexed codebase. |
roam dict-consistency | Audit string-keyed dicts in a Python file for cross-dict consistency. Would have caught W181 (refactor_move missing from 4 parallel registries) in one call. |
roam ai-ratio | Inspect AI-associated patterns; this is not an authorship detector. |
roam trends | Health trend timeline, anomaly detection, per-metric tracking, and CI gates. |
roam weather | Rank files by churn x complexity score (highest-leverage refactoring targets). |
roam timeline | Show commits that touched the file owning <symbol>. |
roam debt | Hotspot-weighted technical debt prioritization. |
roam complexity | Show cognitive complexity metrics for functions and methods. |
roam py-types | Show Python type-annotation health for the indexed project. |
roam py-modern | Modern-Python adoption: walrus, match, PEP 604/585/695, f-strings. |
roam pytest-fixtures | Show the pytest fixture chain for SYMBOL, or a project summary. |
roam test-hermeticity | Scan Python test files for non-hermetic patterns (AI-test flakiness risk). |
roam algo | Detect suboptimal algorithms and suggest better approaches. |
roam agent-opt | Optimize roam's agent-contract surface: find weak envelope/description shape. |
roam observability-opt | Review raw print candidates and their diagnostic context. |
roam n1 | Detect implicit N+1 I/O patterns in ORM models. |
roam over-fetch | Detect models that serialize more fields than necessary in API responses. |
roam missing-index | Detect queries that filter or sort on columns without indexes. |
roam alerts | Detect health degradation trends and generate actionable alerts. |
roam fitness | Run architectural fitness functions from .roam/fitness.yaml. |
roam forecast | Predict when metrics will exceed thresholds using trend analysis. |
roam bisect | Find which snapshots caused architectural degradation. |
roam ingest-trace | Ingest runtime trace data and match spans to symbols. |
roam profile-import | Rank source spans from a sampled py-spy/speedscope JSON profile. |
roam hotspots | Show runtime hotspots comparing static analysis vs runtime data. |
roam why-slow | Find runtime hotspots — symbols slow under real production traffic. |
roam eval-retrieve | Run the retrieval eval harness over a labeled task set. |
roam boundary | Surface public-by-accident exports + changed-range layer violations. |
roam vue-emits | Find Vue child emits without matching handlers in resolved parent usages. |
roam rules-suggest | Suggest ``.roam/rules.yml`` rules and CI gates from recurring findings. |
Architecture
| Command | Description |
|---|---|
roam map | Show project skeleton with entry points and key symbols. |
roam graph-export | Export the indexed graph for external tooling. |
roam graph-stats | Report density, connected components, and degree statistics. |
roam graph-diff | Structural diff between two graph snapshots. |
roam architecture-drift | Architectural-trend report over a sliding window of snapshots. |
roam layers | Show dependency layers and violations. |
roam clusters | Show code clusters and directory mismatches. |
roam cycles | List strongly-connected components (import/call cycles) of the symbol graph. |
roam cycle-break | Recommend minimal symbol extractions that break file dependency cycles. |
roam spectral | Spectral bisection: Fiedler vector partition tree. |
roam coupling | Show temporal coupling: file pairs that change together. |
roam dark-matter | Detect dark matter: file pairs that co-change but have no structural link. |
roam effects | Show what functions DO — side-effect classification. |
roam side-effects | Classify symbols by their side effects (none / io_read / io_write / mutation / process / unknown). |
roam idempotency | Classify symbols by idempotency (idempotent / non_idempotent / unknown). |
roam causal-graph | Build per-symbol causal graphs (input → sink data dependencies). |
roam tx-boundaries | Classify functions by transactional safety. |
roam cut | Minimum cut analysis — find fragile domain boundaries. |
roam simulate | Counterfactual architecture simulator. |
roam orchestrate | Partition the codebase for parallel multi-agent work. |
roam partition | Generate a multi-agent partition manifest with conflict analysis. |
roam entry-points | Entry point catalog with protocol classification. |
roam patterns | Detect common architectural patterns in the codebase. |
roam safe-zones | Identify safe refactoring boundaries for a symbol or file. |
roam visualize | Generate a Mermaid or DOT architecture diagram. |
roam x-lang | Show cross-language symbol bridges detected in the project. |
roam fingerprint | Topology fingerprint for cross-repo comparison. |
roam clones | Detect near-duplicate code via AST structural hashing. |
Exploration
| Command | Description |
|---|---|
roam search | Find symbols matching a name substring (case-insensitive). |
roam at | Show the code at FILE:LINE plus the enclosing symbol (and callers). |
roam search-semantic | Find symbols by natural language query (hybrid BM25 + vector + packs). |
roam batch-search | Search up to 10 symbol-name patterns in a single command. |
roam complete | Return left-anchored prefix completions for the given partial. |
roam grep | Context-enriched grep with reachability, clone, and bridge annotations. |
roam refs-text | Audit literal strings across the project: per-surface refs + verdict. |
roam history-grep | Through-history search using git pickaxe (-S / -G). |
roam file | Show file skeleton: all definitions with signatures. |
roam symbol | Show definition, callers, and callees for SYMBOL. |
roam module | Show directory contents: exports, signatures, deps. |
roam trace | Show shortest path between two symbols. |
roam deps | Show file import/imported-by relationships. |
roam uses | Show all consumers of SYMBOL: callers, importers, inheritors. |
roam fan | Show fan-in/fan-out: most connected symbols or files. |
roam impact | Show indexed dependents a change to SYMBOL could affect. |
roam relate | Show how a set of symbols relate to each other. |
roam endpoints | List all detected REST/GraphQL/gRPC endpoints with handlers. |
roam metrics | Show unified metrics for a file or symbol. |
roam findings | Query the central findings registry (cross-detector view). |
Reports & CI
| Command | Description |
|---|---|
roam report | Run a compound report preset — multiple commands in one shot. |
roam budget | Check pending changes against architectural budgets. |
roam breaking | Detect potential breaking changes vs a git ref. |
roam coverage-gaps | Find entry points with no path to a required gate symbol. |
roam auth-gaps | Find endpoints missing authentication or authorization checks. |
roam orphan-routes | Find backend API routes that have no frontend consumers (dead endpoints). |
roam bus-factor | Detect knowledge loss risk per module (bus factor analysis). |
roam simulate-departure | Simulate what happens when a developer leaves the team. |
roam suggest-reviewers | Suggest optimal code reviewers for changed files. |
roam blame-reviewers | Suggest reviewers for a diff by git-blame line ownership. |
roam dev-profile | Analyze developer commit patterns and behavioral metrics. |
roam owner | Show code ownership: who owns a file or directory. |
roam codeowners | Analyze CODEOWNERS coverage and ownership distribution. |
roam drift | Detect ownership drift: where declared owners differ from actual contributors. |
roam secrets | Scan for hardcoded secrets, API keys, tokens, and passwords. |
roam ignore-drift | Report files git tracks despite a `.gitignore` rule that claims to exclude them. |
roam supply-chain | Dependency risk dashboard: pin coverage, risk scoring, supply-chain health. |
roam risk | Show domain-weighted risk ranking of symbols. |
roam migration-safety | Check migration files for non-idempotent (unsafe if run twice) operations. |
roam api-drift | Detect mismatches between backend API responses and frontend type definitions. |
roam path-coverage | Find critical untested paths from entry points to sensitive sinks. |
roam capsule | Export the structural graph as a portable JSON capsule. |
roam rules | Evaluate custom governance rules defined in .roam/rules/. |
roam vuln-map | Ingest vulnerability scanner reports and match to codebase symbols. |
roam vuln-reach | Query reachability of ingested vulnerabilities through the call graph. |
roam vulns | Scan and manage vulnerability inventory. |
roam sbom | Generate a Software Bill of Materials (SBOM) enriched with call-graph reachability. |
roam taint | Reach-analysis from rule sources to sinks over the indexed edges. |
roam cga | Code Graph Attestation: sign-ready in-toto evidence over the index. |
roam congestion | Detect developer congestion: files with too many concurrent authors. |
roam compatibility | Detect outbound surface regressions vs a baseline snapshot. |
Refactoring
| Command | Description |
|---|---|
roam dead | Show unreferenced exported symbols (dead code). |
roam orphan-imports | List imports that don't resolve to any indexed module / installed package. |
roam flag-dead | Detect potentially stale feature flag code (conditionally-dead code). |
roam duplicates | Detect semantically duplicate functions via structural similarity. |
roam safe-delete | Check if SYMBOL can be safely deleted. |
roam delete-check | Gate the working diff on surviving references to deleted symbols / files. |
roam split | Analyze a file's internal structure and suggest how to split it. |
roam fn-coupling | Show function-level temporal coupling (hidden dependencies). |
roam doc-drift | Verify concrete prose claims in Markdown docs against repository state. |
roam doc-staleness | Detect concrete docstring claims that no longer match the code. |
roam docs-coverage | Analyze exported-symbol doc coverage and stale docs in one report. |
roam docs-index | Find orphaned planning memos and broken local Markdown links. |
roam stale-refs | Find dangling file references — markdown links, HTML href/src, backtick paths. |
roam lsp | Run the roam-stale-refs language server on stdin/stdout (LSP). |
roam suggest-refactoring | Rank symbols that are likely to yield high-value refactoring wins. |
roam plan-refactor | Build an ordered refactoring plan for a symbol (use split for a file). |
roam conventions | Auto-detect codebase naming, file, import, and export conventions. |
roam sketch | Show compact structural skeleton of a directory. |
roam test-map | Map a symbol identifier or file path to its test coverage. |
roam test-pyramid | Count tests by kind (unit/integration/e2e/smoke), flag inverted pyramids. |
roam why | Explain why a symbol matters — role, reach, criticality, verdict. |
roam invariants | Discover implicit contracts for symbols. |
roam intent | Link documentation to code -- find what docs describe what code. |
roam closure | Compute the minimal set of changes needed when modifying SYMBOL. |
roam mutate | Syntax-less agentic editing. |
roam test-scaffold | Generate test file skeletons from indexed symbols. |
Other
| Command | Description |
|---|---|
roam churn | Rank files by churn x complexity score (highest-leverage refactoring targets). Legacy alias of roam weather. |
roam digest | Health trend timeline, anomaly detection, per-metric tracking, and CI gates. Legacy alias of roam trends. |
roam math | Detect suboptimal algorithms and suggest better approaches. Legacy alias of roam algo. |
roam onboard | Single-call codebase comprehension — everything in one shot. Legacy alias of roam understand. |
roam refs | Show all consumers of SYMBOL: callers, importers, inheritors. Legacy alias of roam uses. |
roam snapshot | Health trend timeline, anomaly detection, per-metric tracking, and CI gates. Legacy alias of roam trends. |
roam trend | Health trend timeline, anomaly detection, per-metric tracking, and CI gates. Legacy alias of roam trends. |