These apply to every command:
| Flag | Description |
|---|---|
--path <dir> |
Repository path to operate on (default: .) |
--json |
Emit machine-readable JSON on stdout instead of human-readable text |
--quiet |
Suppress non-essential output (warnings and errors still print to stderr) |
--verbose |
Print stack traces on failure |
--no-color |
Disable colored output |
recall --help, recall --version, and recall <command> --help are always available.
- stdout carries successful command output only (human text, or a single JSON document in
--jsonmode). - stderr carries diagnostics, warnings, and errors.
- No stack trace is printed unless
--verboseis set. - No progress/status line is printed in non-interactive (non-TTY) environments, in
--jsonmode, or with--quiet. Ctrl+C(SIGINT) printsCancelled.and exits with code130.
| Exit code | Meaning |
|---|---|
0 |
Success |
1 |
Unexpected failure |
2 |
Invalid usage (bad arguments, missing path) |
3 |
Invalid Recall state (not initialized, corrupted manifest/snapshot) |
4 |
Stale memory (recall update --check, or a stale recall status) |
5 |
Analysis incomplete (a scan hit --max-files and was truncated) |
Creates or refreshes .recall/ for the current repository: detects Git, package manager, monorepo structure, frameworks, entry points, and workspaces; writes manifest.json, snapshots/latest.json, and the seven Markdown memory files; adds .recall/cache/ to .gitignore.
recall init [--force] [--dry-run] [--path <dir>] [--max-files <n>]
--force— resetsgeneratedAtand forces a full manifest refresh, even if already initialized. Human-authored content in Markdown files is always preserved regardless of--force.--dry-run— reports what would be written without writing anything.
Running recall init again on an already-initialized repository is idempotent and safe: generated sections are refreshed, human-authored content is preserved, and unchanged files are left untouched.
Exit codes: 5 if the file scan was truncated by --max-files, otherwise 0.
Runs deterministic repository analysis and prints a summary (or the full snapshot JSON with --json), optionally saving it to an explicit path.
recall scan [--json] [--output <path>] [--max-files <n>]
--output <path>— writes the snapshot JSON to this path (in addition to the summary/JSON printed to stdout).--max-files <n>— caps the number of files scanned (default 20,000).
Exit codes: 5 if truncated, otherwise 0.
Compares the current repository against the last snapshot and refreshes memory, preserving human-authored Markdown content.
recall update [--since <ref>] [--dry-run] [--check] [--json]
-
--since <ref>— additionally reports the Git diff between<ref>andHEAD(e.g.HEAD~5) as part of the change report. -
--dry-run— reports the change report and staleness without writing anything. -
--check— reports the change report without writing anything, and exits4if memory is stale. Designed for CI:- run: recall update --check
Exit codes: 4 if --check is set and memory is stale, otherwise 0.
Shows whether Recall is initialized, the last snapshot's commit, the current commit, changed files since the snapshot, staleness, missing/malformed memory files, and the detected project type.
recall status [--json]
Exit codes: 3 if not initialized or memory is corrupted, 4 if stale, otherwise 0.
Explains the role of a file or directory using deterministic evidence: likely responsibility, owning workspace, incoming/outgoing internal dependencies, related tests, relevant configuration and scripts, a confidence level, and supporting evidence. Requires a prior recall init/recall scan.
recall explain <path> [--json]
Example:
recall explain src/auth/auth.service.ts
recall explain apps/api
recall explain packages/database --json
Exit codes: 3 if no snapshot exists, 2 if the path does not exist, otherwise 0.
Generates compact, agent-ready context from the last snapshot. Writes .recall/context.md by default.
recall context [--task "<description>"] [--max-tokens <n>] [--format markdown] [--stdout] [--json]
--task "<description>"— focuses "Files an agent should read first" (section 10) on the task using deterministic, local, explainable ranking: no embeddings and no AI provider. The description is tokenized (lowercased, punctuation/camelCase/kebab-case/snake_case split, stop words removed, safe additive singular/plural and gerund normalization) and matched against file/path names, exported symbol names, workspace names, and configuration relevance, then expanded through the import graph (direct and reverse neighbors, bounded to depth 2) and test/production counterparts. Every match is further weighted by term specificity (a rare term like "shebang" counts far more than a term like "package" that matches nearly every file) and can additionally earn amulti-term-densitybonus (matches 2+ distinct task-term concepts) or aworkspace-localitybonus (shares a workspace with a strongly-matched file). Every ranked file's Markdown entry shows one concise reason; raw scores are never printed in Markdown. See architecture.md for the full signal/weight breakdown, including the precision signals added in Sprint 2.1.--max-tokens <n>— approximate maximum size of the generated context. Token estimation is a fixed, documented heuristic (~4 characters/token; see architecture.md), not a model-specific tokenizer. When the estimate exceeds the budget, list-based sections are shrunk through a fixed sequence of item caps (20 → 10 → 5 → 3 → 1) until the content fits, or hard-truncated as a last resort.--format markdown— currently the only supported format (the flag exists for forward compatibility).--stdout— prints to stdout instead of writing.recall/context.md.--json— in addition to the existingestimatedTokens/truncated/outputPath/contentfields, includestask(the task string, ornull) andrankedFiles(every file that scored above zero, in ranked order, each withpath,score, and areasonsarray of{ kind, weight, evidence }) — the full ranking explanation, for tooling that wants it. Both fields are additive to the existing JSON contract:taskisnullandrankedFilesis[]for a non-task context, so existing--jsonconsumers reading only the original fields see no change in shape.contentwas kept as the field name (not renamed tomarkdown) specifically to avoid a breaking change to the already-publishedrecall-contextpackage's JSON output.
Exit codes: 3 if no snapshot exists, otherwise 0.
Validates the runtime, Git availability, repository access, manifest/snapshot validity, Markdown marker integrity, memory freshness, broken internal references, and package-manager configuration.
recall doctor [--json]
Exit codes: 3 if any check fails (e.g. not initialized, corrupted manifest), otherwise 0 (warnings do not fail the command, but are reported).