{
  "markdown": "# ledger-memory\n\n`ledger-memory` is a Claude Code plugin that gives an agent persistent,\nappend-only memory backed by [`ledger`](https://github.com/prime-radiant-inc/ledger),\nreplacing the old per-project markdown-file memory system. Facts are ledger\nkeys with a status field (`current`, `retracted`, `archived`), so retracting\na wrong fact leaves a permanent vaccine instead of silently deleting it, and\na generated `MEMORY.md` projection — never the store itself — is what\nactually loads into an agent's context. See the [design\nspec](https://github.com/prime-radiant-inc/ledger/blob/main/docs/superpowers/specs/2026-08-15-ledger-memory-design.md)\nfor the full rationale and the [spike\neval](https://github.com/prime-radiant-inc/ledger/blob/main/research/ledger-memory-spike-eval.md)\n(8/8 agents, zero tool errors) that shaped the final write path.\n\n## Requirements\n\n`ledger` v0.1.0+ on PATH:\n\n```\ncurl -fsSL https://github.com/prime-radiant-inc/ledger/releases/latest/download/install.sh | bash\n```\n\nor\n\n```\nbrew install prime-radiant-inc/tap/ledger\n```\n\n## Install\n\nThis repo is its own plugin marketplace (`ledger-memory-market`). In Claude\nCode: `/plugin marketplace add prime-radiant-inc/ledger-memory`, then\n`/plugin install ledger-memory@ledger-memory-market`. Other harnesses:\n\n<!-- everyharness:install:start -->\n\n| Harness | Install |\n|---|---|\n| Claude Code | see docs/install/claude-code.md |\n| Cursor | see docs/install/cursor.md |\n| Codex | see docs/install/codex.md |\n| Devin CLI | see docs/install/devin.md |\n| Kimi Code | see docs/install/kimi.md |\n| Gemini CLI | see docs/install/gemini.md |\n| OpenCode | see docs/install/opencode.md |\n| Pi | see docs/install/pi.md |\n| Hermes Agent | see docs/install/hermes.md |\n| Agent Plugins 1.0 clients | see docs/install/agent-plugins-1.0.md |\n| Factory Droid / Grok / Copilot (marketplace descriptor) | see docs/install/agents-marketplace.md |\n\n<!-- everyharness:install:end -->\n\n## How it works\n\nEach project gets one bare ledger store under its Claude Code project\ndirectory:\n\n```\n~/.claude/projects/<project-slug>/memory/\n  .ledger.git      # bare store — never hand-edited\n  MEMORY.md        # generated projection — never hand-edited\n```\n\nAll event timestamps are UTC.\n\n`MEMORY.md` is composed fresh from the store on every session start and\nafter every write; it's what the harness actually loads into an agent's\ncontext, not the store itself.\n\nEvery memory is a key with one field, `status`. A `save` sets `current` and\nrenders as a fact line. A `retract` sets `retracted` and renders as a\nvaccine — \"retracted: \\<hook\\> — wrong because \\<why\\>\" — kept visible until\nit's archived, so a future session can't quietly re-derive the same wrong\nconclusion. If a key ever carried a retraction and gets saved again, the new\nfact renders with a scar (\"previously retracted: \\<why\\>\") so a\nstale-informed re-assert can't erase the warning. `archive` sets `archived`\nand drops a fact (or a spent vaccine) out of the projection without deleting\nit from the chain — this, not rollup, is memory's curation primitive;\n`ledger-memory drill <name>` reads the full history back.\n\nWrites only ever happen through the `ledger-memory` wrapper — never a raw\n`ledger set`/`note` against the store (a `PreToolUse` hook enforces this,\nsee below). The full write surface is `save`, `retract`, `archive`,\n`render`, `drill`:\n\n```\nledger-memory save zsh-trap -m '[feedback] zsh word-splits unquoted $L — use a function'\nledger-memory save repo-remote -m '[project] remote is github.com/x/y' --evidence commit:abc1234\nledger-memory retract zsh-trap -m 'wrong because the function form breaks under set -e'\n```\n\nSee the `ledger-memory` skill for the full write shapes and doctrine —\nretraction discipline, curation, evidence, secrets.\n\n## Hooks\n\n- **SessionStart** (`startup`, `resume`, `clear`, `compact`, `fork`): renders\n  the projection, bootstrapping the store on first run. Silent on a normal,\n  healthy render. After a `compact` source, it adds one line of context\n  reminding the agent to save anything the compaction summary might have\n  lost. If the store looks damaged (present but unreadable, or empty while\n  `MEMORY.md` still claims a head), it surfaces a warning instead of failing\n  silently.\n- **PreToolUse** (Bash): denies raw `ledger` write verbs (`set`, `note`,\n  `vocab`, `close`, `rollup`, `import`, `create`) aimed at the memory store,\n  redirecting to the wrapper. Reads (`show`, `notes`, `tail`, `status`) pass\n  through untouched. Documented limitation: the check is a substring match\n  against the memory directory's absolute path in the command text, so a\n  write that reaches the same store via a relative path or a prior `cd`\n  isn't caught. This is a best-effort nudge, not a sandbox — the primary\n  defense is the `MEMORY.md` header itself, which tells the agent to use the\n  wrapper.\n\n## Uninstall\n\nRemoving the plugin removes the wrapper and hooks; it does not touch the\nmemory store. `~/.claude/projects/<project-slug>/memory/` is a plain git\nrepository — it survives plugin removal, and nothing about it depends on the\nplugin being installed to stay readable.\n",
  "bytes": 5135,
  "sha": "953f921ae3a2a1aaac2db584b951219cd901afd4672990da5cc3976a954c5d35",
  "repo_slug": "prime-radiant-inc/ledger-memory",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_prime_radiant_inc_ledger_memory_d6e2aac4/readme"
}