9.6 Dual-Layer Native Memory & Tombstone CLI
chinwag memory recall | retain | tombstone | statsComplete command-line reference for chinwag memory recall, retain, tombstone (--emit-test), and stats backed by .chinwag/state.crdb, the 97%-smaller LEANN CSR vector graph, and the Chinwag Encrypted Artifact Store regression cassettes.
9.6 Dual-Layer Native Memory & Tombstone CLI
chinwag memory recall | retain | tombstone | stats
AI coding agents without persistent repository memory repeat the same architectural mistakes across sessions. Conversely, naive vector databases bloat disk usage and surface stale, unverified notes.
chinwag memory provides a 100% local, zero-cost (0 Cr) dual-layer memory engine backed by .chinwag/state.crdb (transactional relational store) and .chinwag/memory.crdb.leann (a 97%-smaller LEANN Compressed Sparse Row graph index scoped to exact --file-scope globs), plus automatic offline CI regression cassette generation via --emit-test.
Mandatory Agent Protocol: recall at Task Start, retain / tombstone at Task End
Every agent session follows a strict two-step memory discipline:
- At Task Start (
recall): Query both positive architectural decisions and Negative Memory Tombstones (WP-14) scoped to the task's--file-scope. - At Task End (
retain&tombstone): Record verified architectural learnings (retain) and explicitly tombstone any rejected or failed approaches (tombstone --emit-test) so no future human or agent repeats them.
1. chinwag memory recall
chinwag memory recall \
--bank acme-eng \
--query "webhook ed25519 signature verification" \
--file-scope "crates/webhook-ingest/**" \
--limit 10
| Flag | Required | Description |
|---|---|---|
--bank <BANK_NAME> | Yes | Organization or repository memory bank identifier. |
--query "<KEYWORDS>" | Yes | Hybrid lexical + LEANN CSR semantic graph query. |
--file-scope "<GLOB>" | No | Filters memories and tombstones whose scope intersects the target file glob (* for all). |
--limit <N> | No | Maximum records returned (default: 10; tombstones are always prioritized first). |
2. chinwag memory retain
Stores a verified architectural decision, handover summary, or root-cause fix:
chinwag memory retain \
--bank acme-eng \
--context "agent:RUST|ticket:TASK-204|decision" \
--content "Webhook ingress verifies Ed25519 signatures via verify_strict on raw body bytes before JSON deserialization (0.09ms)." \
--file-scope "crates/webhook-ingest/**"
3. chinwag memory tombstone & --emit-test (Negative Memory + <50 ms Offline CI Cassette · WP-14)
Records a killed, unsafe, or broken approach (TombstoneRecordV1). Passing --emit-test additionally freezes the failing run's trajectory steps 0..k (ctx.llm, ctx.tool, ctx.clock, ctx.uuid), project_worktree_oid, and config_commit_sha into a deterministic .chinwag/regressions/<tombstone-id>.json cassette and anchors it in the Chinwag Encrypted Artifact Store (<org>/chinwag-bus.git → refs/chinwag/regressions/<tombstone-id>) so chinwag-ci test-regressions runs it in <50 ms at $0 LLM spend on every PR:
chinwag memory tombstone \
--id "tombstone-webhook-serde-before-verify-v1" \
--file-scope "crates/webhook-ingest/**" \
--reason "Deserializing untrusted JSON before Ed25519 verification allows allocation DoS and malleable key attacks." \
--alternative "Always call verify_before_decrypt / verify_strict on the raw byte slice before serde_json::from_slice." \
--from-run run_01J9X8A2 \
--at-step 5 \
--emit-test
| Flag | Required | Description |
|---|---|---|
--id <SLUG> | Yes | Unique tombstone identifier (e.g. tombstone-webhook-serde-before-verify-v1). |
--file-scope "<GLOB>" | Yes | File glob where the tombstone is injected into pre-flight agent prompts. |
--reason "<WHY_KILLED>" | Yes | Root cause of why the approach failed or was rejected. |
--alternative "<WHAT_INSTEAD>" | Yes | Verified pattern to use instead. |
--from-run <RUN_ID> | Optional | Source trajectory run ID in <org>/chinwag-bus.git for --emit-test. |
--at-step <K> | Optional | Step index where the failure occurred. |
--emit-test | Optional | Emits .chinwag/regressions/<id>.json (TombstoneCassetteV1) and syncs refs/chinwag/regressions/<id> for <50 ms offline replay via chinwag-ci test-regressions. |
4. chinwag memory stats
Inspects local CRDB + LEANN CSR index size, active memory count, and tombstone cassette coverage:
chinwag memory stats --bank acme-eng
Connect Your AI Agent to These Docs via Onboard MCP
Any MCP-compatible coding agent (Claude Code, Cursor, Codex, Windsurf, Antigravity) can query all 9 sections of this documentation directly over Streamable HTTP:
claude mcp add --transport http chinwag-docs https://docs.chinwag.sh/mcp
- Back to Home: Chinwag Documentation Overview & Quick Links
- Ready to deploy Chinwag across your engineering org? Reserve Your Organization Credit Pack →
chinwag-ci, fork-run & ui-gate
Complete CLI syntax and exit codes for the static chinwag-ci runner (wrap, test-regressions, diff-run, fork-run, attest-green), post-deploy synthetic canaries, and visual/copy gates (chinwag ui-gate).
10.0 Ratified Architecture PRDs
Publicly ratified engineering Product Requirements Documents (PRDs) and Request for Discussion (RFD) specifications backing Chinwag's live GitHub Projects v2 and Linear boards.