Skip to content
Agentmart
Submit a tool

capsule-compact

Compact a long capsule chain.

Skill by wrg32786

IndexedMIT★ 23
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/wrg32786-capsule-compact

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Compact a long capsule chain. Walks parent_capsule_id backward from a head capsule; if chain >= 5, summarizes oldest 3 into a chain-summary capsule. Manual invocation.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/capsule-compact

Tools it pre-approves 2

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash,
  • Read

What's inside

Skill name
capsule-compact
Description
Compact a long capsule chain. Walks parent_capsule_id backward from a head capsule; if chain >= 5, summarizes oldest 3 into a chain-summary capsule. Manual invocation.
License
MIT
Allowed tools
Bash,, Read
Instructions
36 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# /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) emits `[CADDY:context] CHAIN — capsule chain length N` when threshold 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

From wrg32786/aigent-os, MIT.

More from wrg32786/aigent-os

Signals

Stars
23
Forks
7
Open issues
14
Last commit (this folder)
Jul 7, 2026 (3 months ago)
Last release
Jul 25, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from wrg32786

Cite this page

capsule-compact skill. Agent Mart. https://agentmart.dev/skills/wrg32786-capsule-compact (last updated 2026-10-24)