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 skills/jonathanung/finesse/compaction-handlingnpx skills add jonathanung/finesse --skill compaction-handlinggit clone --depth 1 https://github.com/jonathanung/finesseWrote 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.
[](https://agentmods.dev/skills/jonathanung/finesse/compaction-handling)<a href="https://agentmods.dev/skills/jonathanung/finesse/compaction-handling"><img src="https://agentmods.dev/badge/skills/jonathanung/finesse/compaction-handling.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00021 | $0.01642 |
| Opus 5 | $0.00010 | $0.00821 |
| Sonnet 5 | $0.00004 | $0.00328 |
| Haiku 4.5 | $0.00002 | $0.00164 |
Grade A, and why
compaction-handling 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Compaction Handling
When a planning session is long, Claude Code may compact context. To ensure critical information survives compaction:
Working File Persistence
- Early persistence: As soon as codebase exploration results are gathered, write key findings to
finesse-plans/<name>-working.md. Update this file at each major phase boundary. The YAML frontmatter (see item 2) must be included from the first write and updated at each phase boundary. - Working file structure: ALL working files MUST include a YAML frontmatter block at the top of the file, before any markdown body content. The mandatory schema:
Below the YAML frontmatter, the working file body MUST start with a Session Constraints block, followed by free-form markdown:--- mode: planning-only # CRITICAL: Never edit source code. Never implement. allowed_agents: [code-explorer, code-architect, task-decomposer, clarity-checker, completion-validator, scope-safety-reviewer, phase-structure-analyzer, failure-mode-auditor, goal-achievement-auditor, exploration-orchestrator, scope-analyzer, architecture-designer, plan-constructor, plan-validator] task_type: <feature|bugfix|refactor|testing|performance|research> workflow: <feature-development|bug-fix|refactor-chore|testing|performance-optimization|research> current_phase: <phase code, e.g., F5, B3, RE4> completed_phases: [<list of completed phase codes, e.g., F1, F2, F3, F4>] uat_fast_forward: <true|false> session_name: <kebab-case session descriptor> decomposed: <true|false> refinement_budget: <number> # --max-refinements value, populated during Validation refinement_cycles_used: <number> # cycles consumed so far, updated during Validation context_pressure: <low|moderate|high|critical> # populated during Plan Construction context_budget: # populated during Plan Construction peak_iteration_tokens: <number> context_window: <number> pressure_pct: <number> estimated_cost_range: <string> file_count: <number> file_categories: small: <number> medium: <number> large: <number> sub_workflows: # only present if decomposed: true - name: <sub-workflow kebab-case name> type: <task type> wave: <wave number> current_phase: <phase code> completed_phases: [<completed phase codes>] context_pressure: <low|moderate|high|critical> # per-sub-workflow, populated during Plan Construction context_budget: # per-sub-workflow, populated during Plan Construction peak_iteration_tokens: <number> pressure_pct: <number> estimated_cost_range: <string> ---
After the Session Constraints block, include: codebase findings, UAT checkpoint decisions and their outcomes, prompt draft (if one exists), promise draft (if one exists), open questions or blockers.## Session Constraints (DO NOT DELETE) - PLANNING-ONLY session. Output is a ralph-loop command. NEVER edit source code. - Task agents ONLY for: code-explorer, code-architect, task-decomposer, 6 validation agents, and 5 orchestrator agents (exploration-orchestrator, scope-analyzer, architecture-designer, plan-constructor, plan-validator) - Write ONLY to finesse-plans/ and .finesse/ - NEXT ACTION: [describe the current/next phase step] - DO NOT: edit source files, launch general-purpose agents, implement the plan - Recovery: If you detect that context has been compacted (e.g., you cannot recall earlier phase outputs), read
finesse-plans/<name>-working.mdto recover state. The YAML frontmatter is parsed first to determine the exact resume point, followed by reading the markdown body for phase-specific content. - Working file naming: Use
finesse-plans/<name>-working.mdwhere<name>matches the eventual plan name. If the plan name is not yet determined, derive a session descriptor from the first 3-4 words of the task description in kebab-case (e.g.,finesse-plans/_working-fix-token-refresh.md). - Cleanup: After plan acceptance and final file output, keep the working file for reference.
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.
- 5d ago First seen · 85 lines · 21 tokens per session scan A cfbc19d71c70
compaction-handling is a skill published in the GitHub repository jonathanung/finesse (4 stars, last pushed 6mo ago), licensed MIT. It adds 21 tokens to every session and 1,642 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 skills, from other repositories
media-ingest
Ingest video, audio, PDF, book, screenshot, and GitHub repo content into the brain. Multi-format handling with entity extraction and backlink propagation. Covers video-ingest, youtube-ingest, and book-ingest subtypes.
mem0-oss-to-platform
Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…
Cortex
Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…
agent-memory
../../../engineering/agent-memory/skills/agent-memory/SKILL.md.
memory
Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.
ha-data-stores
Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…