context-compaction

context-compaction is a skill for Claude Code, Codex from LuuOW/meridian-mcp. It costs 33 tokens per session (546 once invoked), scanned A, original, MIT.

A guide for shortening an AI assistant’s working context while keeping the decisions, files, constraints, errors, and verification results that still matter.

In plain words
What is it for?
It is for compacting context during research, implementation, and verification, especially when repeated tool output or rejected approaches are making a task harder to follow.
Why use it?
Long conversations can consume tokens and bury the active problem under old or repeated information. This approach removes stale exploration at phase changes while preserving details needed to continue safely.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for compacting context during research, implementation, and verification, especially when repeated tool output or rejected approaches are making a task harder to follow.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luuow/meridian-mcp/context-compaction
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.

Any agent
npx skills add LuuOW/meridian-mcp --skill context-compaction
Clone the repo
git clone --depth 1 https://github.com/LuuOW/meridian-mcp

Made for: Claude Code, Codex.

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 context-compaction

README.md
[![agentmods](https://agentmods.dev/badge/skills/luuow/meridian-mcp/context-compaction/github.svg)](https://agentmods.dev/skills/luuow/meridian-mcp/context-compaction)
Your own site
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/context-compaction"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/context-compaction/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-compaction

Your own site · 80×15
<a href="https://agentmods.dev/skills/luuow/meridian-mcp/context-compaction"><img src="https://agentmods.dev/badge/skills/luuow/meridian-mcp/context-compaction.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 546 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00033 $0.00546
Opus 5.5 $0.00013 $0.00218
Sonnet 5.5 $0.00007 $0.00109
Haiku 4.5 $0.00003 $0.00055

Measured 3mo ago against content hash 933337b8c86c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-compaction 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 3mo 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.

skills/context-compaction/SKILL.md · 89 lines

How it starts

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

context-compaction

Compaction is not summarization for its own sake. It is energy recovery.

The goal is to preserve decision-useful signal while discarding stale context mass.

1) Use When

  • a task has shifted phases
  • earlier exploration is no longer needed in full
  • repeated tool results are crowding out active work
  • a worker or route is carrying too much irrelevant history
  • token burn is rising faster than useful progress

2) Keep vs Drop

Keep:

  • chosen approach
  • file paths that still matter
  • constraints and assumptions
  • exact failures still being debugged
  • verification commands and outcomes

Drop:

  • dead-end explorations
  • duplicate file summaries
  • verbose tool output once the conclusion is known
  • alternative approaches already rejected
  • long prose that can be collapsed into one line

3) Compaction Pattern

Before:
- 8 files explored
- 4 rejected theories
- 3 repeated test outputs
- 1 active fix path

After:
- active fix path
- 2 relevant files
- exact failing test
- 1 sentence on rejected theory only if it prevents rework

4) Phase Boundary Rule

Compact aggressively at:

  • research -> implementation
  • implementation -> verification
  • pre-release handoff
  • after a large failed attempt

Do not carry research noise into implementation unless it is still causally relevant.

5) High-Value Compaction Formats

  • decision log
  • current target files
  • active hypothesis
  • exact next command
  • known no-go paths

6) Anti-Patterns

  • compressing away the one error string that matters
  • keeping giant excerpts "just in case"
  • summarizing every explored file equally
  • treating compaction as archival completeness instead of operational focus

7) Checklist

  • Removed stale exploration from the active context
  • Preserved the chosen path and why
  • Kept exact errors and commands still needed for verification
  • Dropped duplicate summaries and obsolete alternatives
  • Reduced token load without reducing decision quality

Read the full file on GitHub · 89 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. 3mo ago First seen · 89 lines · 33 tokens per session scan A 933337b8c86c

Subscribe to this mod's changes

context-compaction is a skill published in the GitHub repository LuuOW/meridian-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 546 once invoked, about $0.0001 per session on Opus 5.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.

Related

context-compaction compared with skills from other repositories

context-compaction next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-compactionLuuOW/meridian-mcpSkill01mo agoMITA33Claude Code, Codex
context-budgetmattmre/EVOKORE-MCP-PUBLICSkill46mo agoMITA24Claude Code, Codex
memory-orchestratorApexIQ/skillsmithSkill58mo agoMITA53Claude Code, Codex
context-budgetericrisco/rsc-harnessSkill6824d agoMITA82Claude Code, Codex
project-wikiGeminiLight/MindOSSkill70921d agoMITA63Claude Code, Codex
mindos-zhGeminiLight/MindOSSkill70921d agoMITA490Claude Code
mindosGeminiLight/MindOSSkill70921d agoMITA136Claude Code