agentleFS
qyndexqyndex/claude-init/.claude/skills/dream/SKILL.md

dream

Skill2 starsChanged 5 months agoMITView on GitHub

Memory consolidation. Dedupe and compress .claude/memory/ topic files, absolutize relative dates, archive stale instincts and processed checkpoints, and hard-enforce the 200-line MEMORY.md cap. Produces a reviewable proposal, never a silent overwrite.

43 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use ingest, resume and 7 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JaimeGBASkill

    ingest

    Digest an external source (article, paper, transcript, URL, book chapter) and integrate its content into the knowledge base

    Also in 4 projects that use this

  • genomewalkerSkill

    resume

    Resume a thread by loading its ~800-token context capsule

    Also in 3 projects that use this

  • MicrosoftSkill

    init

    Also in 4 projects that use this

  • Hugging FaceSkill

    simplify

    Refactor code after tests pass. The "Refactor" phase of Red-Green-Refactor.

    Also in 3 projects that use this

  • SentrySkill

    deslop

    Strip AI-generated noise from the diff before pushing — extra comments a human wouldn't write, defensive try/catch in trusted code paths, casts to any, inline imports in Python, and other style inconsistencies with the surrounding file. Use this immediately before commit so the diff stays clean.

    Also in 3 projects that use this

  • AnthropicSkill

    start

    Set up your bio-research environment and explore available tools. Use when first getting oriented with the plugin, checking which literature, drug-discovery, or visualization MCP servers are connected, or surveying available analysis skills before starting a new project.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write the consolidated result as a proposal under .claude/memory.proposed/, not directly over .claude/memory/.

    line 75

“Common” is measured: kept by at least 6 in 10 of the 42 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Dream — memory consolidation

Long autonomous runs accrete memory: duplicate observations, relative dates that rot ("yesterday"), instinct files that no longer fire, checkpoints already folded in. Left alone, MEMORY.md bloats past the context budget and the signal drowns. Dreaming is the periodic GC that keeps memory dense and current.

Trigger contract (with auto-dream-check.sh)

The Stop hook .claude/hooks/auto-dream-check.sh decides when; this skill is what runs. The hook fires a dream only when both:

  • more than 24h have passed since the last dream, AND
  • at least 5 sessions have accumulated since then.

State lives in .claude/memory/.cache/.dream-state.json; a lock at .claude/memory/.cache/.dream.lock prevents concurrent dreams. If an un-reviewed proposal already exists in .claude/memory.proposed/, do nothing — the operator must clear it via /dream-review first, or a second dream would silently overwrite the first's proposal and drop the human-review gate.

What a dream does

  1. Gather — read .claude/memory/ topic files, every checkpoint under .claude/memory/.cache/checkpoints/ written since the last dream, subagent handoff archives under .claude/memory/handoffs/ (decisions_made, rejected_hypotheses, incidents — gap-audit G33), and the digest log .claude/hooks/.log/subagent.jsonl for agents that skipped the handoff.
  2. Dedupe + compress — merge repeated observations into a single entry; drop anything already captured in a topic file. Prefer the denser phrasing.
  3. Absolutize dates — rewrite relative dates ("yesterday", "last week") to absolute ISO dates, so the memory stays interpretable after time passes.
  4. Archive stale instincts — move instinct files that haven't fired recently from the active set into .claude/memory/.cache/archive/YYYY-MM/. 4a. Extract fresh instincts — run bash .claude/scripts/instinct-extract.sh --force (gap-audit G25: this is the pipeline's middle stage; without it observations accumulate unconsumed). 4b. Promote — run bash .claude/scripts/instinct-promote.sh auto (project → global at the 2-project threshold, gap-audit G26).
  5. Detect contradictions — group ADR files under .claude/memory/decisions/ by their subsystem: frontmatter field. For each subsystem group with ≥2 ADRs, compare their decision: fields; flag any pair whose decisions conflict (e.g., "use postgres" vs "use sqlite"). Write flagged pairs to .claude/memory.proposed/conflicts.md (one table row per conflict: subsystem, ADR-A path, ADR-B path, conflict summary). If no conflicts found, omit the file. Do not auto-resolve — surface for human review.
  6. Enforce the cap — run bash .claude/scripts/memory-gc.sh enforce to hold MEMORY.md at ≤200 lines. This is the hard backstop: the cap is enforced by the script, not by this prompt, so a crashed/hallucinating dream cannot leave MEMORY.md bloated (Round 4 caught exactly that silent failure).
  7. Archive checkpoints — move processed checkpoints to .claude/memory/.cache/archive/YYYY-MM/.
  8. Promote + decay (mechanical) — run bash .claude/scripts/memory-promote.sh and bash .claude/scripts/learn-from-success.sh (gap-audit G29: these previously ran only via the optionally-installed desktop cron, so a fresh harness copy silently never promoted/decayed memory or learned routing).
  9. Roll up horizons — run bash .claude/scripts/memory-rollup.sh auto. This consolidates the week's events into .claude/memory/rollups/YYYY-Www.md and, at period boundaries, weeklies → monthly → quarterly (each ≤100 lines). Multi-year recall depends on this: day-scale memory (in-flight briefs, observations) ages out within days, but the rollup chain preserves it at log-scale cost. The factual skeleton is deterministic (git + task ledger); you may enrich the narrative sections of the current week's file, but never alter past-period rollups.

Output

Write the consolidated result as a proposal under .claude/memory.proposed/, not directly over .claude/memory/. The operator reviews and applies it via /dream-review. Never overwrite live memory in place — the review gate is the whole point.

Done means

  • A proposal exists under .claude/memory.proposed/ (or the dream no-op'd because one was already pending).
  • memory-gc.sh enforce has run and MEMORY.md is ≤200 lines.
  • Relative dates in the proposal are absolutized; processed checkpoints archived.
  • .claude/memory.proposed/conflicts.md written if any contradicting ADRs found (subsystem-grouped comparison); absent means no conflicts detected.
  • memory-rollup.sh auto has run — the current week's rollup exists under .claude/memory/rollups/.

References

  • Trigger: .claude/hooks/auto-dream-check.sh
  • Cap enforcement: .claude/scripts/memory-gc.sh
  • Backstop schedule: .claude/routines/dream-cron.yml
  • Review gate: /dream-review

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.