Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/cbuntingde/kimi-memory/prunegit clone --depth 1 https://github.com/cbuntingde/kimi-memoryWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00027 | $0.00677 |
| Opus 5 | $0.00014 | $0.00338 |
| Sonnet 5 | $0.00005 | $0.00135 |
| Haiku 4.5 | $0.00003 | $0.00068 |
Grade A, and why
prune scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 70 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/kimi-memory:prune
Remove kimi-memory project databases for projects that no longer exist on disk.
Usage
/kimi-memory:prune # dry run — list orphan databases, do not remove
/kimi-memory:prune --apply # actually remove the orphan database files
What this does
The plugin stores one SQLite database per project under
$KIMI_CODE_HOME/kimi-memory/<project-key>/memory.sqlite, keyed by the
SHA-256 of the canonical project root. When a project is deleted or
moved, the database is left behind and the file becomes unreachable
through normal agent flow. This command finds and removes those orphans.
The dry run is the default — it always shows what would be removed
before touching the filesystem. Review the list, then re-run with
--apply if the deletions are correct.
Procedure
- Call
memory_prune(scope: "all-projects", apply: false). The MCP tool enumerates every project DB in the data root, looks up the recorded canonical root, and reportsexists_on_disk: true|falsefor each. - Print the list of orphans (
exists_on_disk: false) clearly:Found 2 orphan project databases: - 5344107ff52a7a33 → /Users/me/old-projects/foo - aabbccdd00112233 → /Users/me/old-projects/bar - Stop. Tell the user the dry-run result. If they want to proceed, wait for confirmation; this command is destructive.
- After explicit confirmation, call
memory_prune(scope: "all-projects", apply: true)and report the finalremovedcount. The global database is never touched.
When not to use
- Do not invoke with
--applyon someone else's behalf. The MCP tool is idempotent and the dry-run is the safe default; the user must confirm before destructive removal. - Do not use this command to remove a project the user is still working on. The dry run shows the canonical root for each project — if the path exists, the project is alive and the entry should not be removed.
- The global cross-project database (
$KIMI_CODE_HOME/kimi-memory/_global/) is not in scope. Removing it is a separate manual cleanup, notmemory_prune.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 70 lines · 27 tokens per session scan A 96e972e4e1dd
prune is a command published in the GitHub repository cbuntingde/kimi-memory (0 stars, last pushed 2d ago), licensed MIT. It adds 27 tokens to every session and 677 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
tree-ring-update
Check for or install a verified Tree Ring Memory CLI update without changing installation scope.
tree-ring-certify
Generate Tree Ring harness or recall-quality evidence without confusing it with the full framework release suite.
tree-ring-dox-sync
Preview and synchronize DOX-style AGENTS.md guidance as source-linked Tree Ring memory.
tree-ring-recall
Recall durable Tree Ring Memory context before starting or resuming work.
tree-ring-status
Check receipt-backed Tree Ring harness readiness without claiming configuration is activation.
wrap
Close the session cleanly. Update entity state. Capture decisions. Detect momentum shifts.