dreaming

dreaming is a command for coding agents from cbuntingde/kimi-memory. It costs 110 tokens per session (1,703 once invoked), scanned A, original, MIT.

A command for configuring and running scheduled memory maintenance. The maintenance combines related memories, forms conclusions, and removes outdated entries when Kimi starts a session.

In plain words
What is it for?
Use it to turn automatic maintenance on or off, set its minimum interval, run it once, or check when it last ran.
Why use it?
It keeps the memory store organized over time without requiring a continuously running background process.

Command

Install

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.

agentmods
npx agentmods add commands/cbuntingde/kimi-memory/dreaming
Clone the repo
git clone --depth 1 https://github.com/cbuntingde/kimi-memory

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dreaming

README.md
[![agentmods](https://agentmods.dev/badge/commands/cbuntingde/kimi-memory/dreaming.svg)](https://agentmods.dev/commands/cbuntingde/kimi-memory/dreaming)
Your own site
<a href="https://agentmods.dev/commands/cbuntingde/kimi-memory/dreaming"><img src="https://agentmods.dev/badge/commands/cbuntingde/kimi-memory/dreaming.svg" alt="Measured on agentmods" height="20"></a>
Per session 110 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,703 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5 $0.00110 $0.01703
Opus 5 $0.00055 $0.00851
Sonnet 5 $0.00022 $0.00341
Haiku 4.5 $0.00011 $0.00170

Measured 4d ago against content hash 8c9b07bece59, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dreaming 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 4d ago.

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.

commands/dreaming.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/kimi-memory:dreaming

Configure the dreaming subsystem — the background pass that consolidates memories into conclusions, combines duplicates, and prunes stale rows on a schedule. The user-facing verb covers the three existing internal passes (consolidate + dream + auto-GC) so they share one schedule and one status surface.

Modes

  • off — never auto-run. Only fires on explicit /dreaming run.
  • auto — the historical behaviour: activity-threshold + 30-minute debounce (env-tunable via KIMI_MEMORY_DREAM_DEBOUNCE_MS). Switching to auto is a no-op upgrade for existing users.
  • on — wall-clock floor regardless of session activity. Default interval 24h, overridable via --interval. A SessionStart that opens after the floor has elapsed runs the pass immediately. There is no background daemon — the plugin never wakes itself up. If the user never opens Kimi, dreaming never runs. That trade-off is intentional.

Usage

/kimi-memory:dreaming on                       # turn on, default 24h interval
/kimi-memory:dreaming on --interval 3h         # 3-hour floor
/kimi-memory:dreaming off                      # never auto-run
/kimi-memory:dreaming auto                     # default behaviour (alias for the historical debounce path)

/kimi-memory:dreaming run                      # one-shot, force a pass now
/kimi-memory:dreaming run --include consolidate,dream
/kimi-memory:dreaming run --exclude gc         # skip the prune/archive/tier pass

/kimi-memory:dreaming status                   # mode + interval + last run + next due
/kimi-memory:dreaming last                     # last run's saved/merged/pruned counts

Add --scope project|global to on|off|auto|status to write the mode to the per-project file or to the system-wide default. Per-project wins over global when both exist.

What this does

One call runs three passes in order, controlled by --include:

  1. consolidate (runConsolidate) — clusters memories by embedding cosine + tag overlap, writes conclusion rows, records synthesizes edges, and merges tight duplicates. Writes one consolidation_runs row at the end.
  2. dream (enqueueDreamJobgenerateProposalsForJobapplyDreamJob) — durable staged job lifecycle in dream_jobs + dream_proposals. One enqueue per call; one apply if a job is ready. Honours the partial unique index idx_dream_jobs_active so two concurrent enqueues are safe.
  3. gc (runAutoGc) — prune dead rows (deleted >30d, superseded >90d, embed-failed >30d, cold low-confidence >365d), archive old audit rows, run L0→L1→L2→L3 tier promotion. Bounded by KIMI_MEMORY_AUTO_GC=off.

Read the full file on GitHub · 165 lines

Changes

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.

  1. 4d ago First seen · 165 lines · 110 tokens per session scan A 8c9b07bece59

Subscribe to this mod's changes

dreaming is a command published in the GitHub repository cbuntingde/kimi-memory (0 stars, last pushed today), licensed MIT. It adds 110 tokens to every session and 1,703 once invoked, about $0.0006 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.