agentleFS
wrg32786wrg32786/aigent-os/skills/capsule-compact/SKILL.md

capsule-compact

Skill25 starsChanged 7 days agoMITView on GitHub

Compact capsule chains by summarizing older capsules. Use when manually compacting capsules or a context chain grows too long.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

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

    Run python3 daemons/capsule-compact.py <head_capsule_id> from the vault root.

    line 18
  2. Very specific:

    If chain length >= 5, summarizes the oldest 3 capsules into a single chain-summary-<head>-<date>.md capsule

    line 22
  3. Distinctive:

    After narrative-reconstruction archeology when the chain has grown unwieldy

    line 30
  4. Distinctive:

    Does not auto-compact at /close.

    line 41
  5. Very specific:

    Does not delete compacted capsules.

    line 42
  6. Distinctive:

    Does not LLM-summarize. Concatenates structured fields (objective, open_threads still live, held decisions).

    line 43
  7. Distinctive:

    Does not walk forks. parent_capsule_id is strictly linear.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

/capsule-compact

Run python3 daemons/capsule-compact.py <head_capsule_id> from the vault root.

The script:

  1. Walks parent_capsule_id chain backward from the head
  2. If chain length >= 5, summarizes the oldest 3 capsules into a single chain-summary-<head>-<date>.md capsule
  3. Updates pointers: boundary capsule's parent → summary; summary's parent → original chain root's parent
  4. Marks each compacted capsule with compacted_into: <summary_id> (they stay on disk for archeology)

When to run

  • /close Step 0.5 PART E (v0.4.5) reports the capsule chain length when the threshold is hit
  • Manually before a session-heavy week to keep /open Step 2.5 fast
  • After narrative-reconstruction archeology when the chain has grown unwieldy

Defaults

  • Threshold: 5 capsules
  • Summarize-count: 3 oldest

Override via --threshold N and --summarize-count N flags.

What it does NOT do

  • Does not auto-compact at /close. Hints, you decide.
  • Does not delete compacted capsules. Each gets compacted_into: marker.
  • Does not LLM-summarize. Concatenates structured fields (objective, open_threads still live, held decisions).
  • Does not walk forks. parent_capsule_id is strictly linear.

Cross-links

  • [[concepts/Somatic v0.4.5 Chain Compaction]] — spec
  • [[concepts/context-capsule]] — base capsule schema

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.