
Context compaction keep or drop
Trims a long agent session by keeping, dropping or pointing to each context chunk
Context compaction keep or drop is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 440
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Context compaction keep or drop
This skill gives an agent a way to shrink a crowded session without summarising it. Each context chunk, such as a tool result, message or file read, is labelled as keep, drop or replace-with-a-pointer, and the kept chunks are passed through unchanged. Every chunk gets a ledger row with a short checksum and a refetch command, so a dropped or pointered item can be retrieved later.
The workflow runs in two stages. Chunks that contain bearer text, keys, tokens, passwords, armoured blocks or NAME=value lines are labelled by a local rule and never leave the machine. Other chunks are redacted for secret-like fields, long strings and email addresses, then sent to a hosted classifier with the current task, and the returned scores decide the label. The skill sets a higher bar for dropping than for pointing, because dropping cannot be undone inside the session.
The included Python sketch needs Python with network access to the classifier endpoint, and it expects the agent to supply chunks with an id, text, head, live flag and refetch command. The skill's own notes state that the hosted service forwards input text to a model provider, so teams with confidential transcripts should run the same three labels on the agent's own model instead.
When your agent uses it
Label each context chunk keep, drop or replace-with-a-pointer and pass the survivors through byte for byte instead of summarising, with key-shaped chunks decided locally and never sent, and a checksum row per chunk. Use when a session runs out of room, or on "compact" or "trim the history".
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (6 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
Copy the skill folder to ~/.claude/skills/context-compaction-keep-or-drop to use it in all your projects:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/context-compaction-keep-or-drop &&
cp -R "$tmp/skills/_rejected/context-compaction-keep-or-drop" ~/.claude/skills/context-compaction-keep-or-drop &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/context-compaction-keep-or-drop inside it instead.
Copy the skill folder to ~/.agents/skills/context-compaction-keep-or-drop to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/context-compaction-keep-or-drop &&
cp -R "$tmp/skills/_rejected/context-compaction-keep-or-drop" ~/.agents/skills/context-compaction-keep-or-drop &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/context-compaction-keep-or-drop inside it instead.
Copy the skill folder to ~/.cursor/skills/context-compaction-keep-or-drop to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/context-compaction-keep-or-drop &&
cp -R "$tmp/skills/_rejected/context-compaction-keep-or-drop" ~/.cursor/skills/context-compaction-keep-or-drop &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/context-compaction-keep-or-drop inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/mrmps/classifier-dev.git --path skills/_rejected/context-compaction-keep-or-dropOr copy the folder to ~/.gemini/skills/context-compaction-keep-or-drop yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/context-compaction-keep-or-drop:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/context-compaction-keep-or-drop &&
cp -R "$tmp/skills/_rejected/context-compaction-keep-or-drop" ~/.copilot/skills/context-compaction-keep-or-drop &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/context-compaction-keep-or-drop inside it instead.
Get the folder:
git clone --depth 1 https://github.com/mrmps/classifier-dev.gitThen copy classifier-dev/skills/_rejected/context-compaction-keep-or-drop into your agent's skills folder as context-compaction-keep-or-drop. Agents that support SKILL.md read one folder per skill.
What it does
- Three-way chunk labels
- Each context chunk is marked keep, drop or replace with a pointer based on whether its exact text is needed for the current task.
- Verbatim survivors
- Kept chunks are passed through byte for byte rather than rewritten into a summary.
- Local sensitive-data rule
- Chunks holding keys, tokens, passwords or armoured blocks are labelled on the machine and are not sent out.
- Redaction before sending
- Bearer headers, key-named fields, long strings and email addresses are replaced with placeholders before any classification request.
- Checksum ledger
- Each chunk gets a ledger row with a truncated SHA-256 digest, its score and a refetch command, and the run asserts that no row is lost.
- Asymmetric thresholds
- Dropping requires a high score, pointers need a moderate score, and anything uncertain stays in context.
Good for
- Free up room in a long coding session without losing the exact error output needed for the fix
- Trim a session history while keeping a checksum and refetch command for dropped tool results
- Decide which earlier file reads and command outputs still matter for the current debugging task
- Compact an agent transcript that contains credentials without sending those lines to a remote service
Context compaction keep or drop FAQ
When does Context compaction keep or drop trigger?
It is meant for sessions that run out of room, or when the user says compact or trim the history.
Does Context compaction keep or drop summarise the conversation?
No. It labels each chunk and passes kept chunks through unchanged, and the skill states that summarising is what it avoids.
Are secrets sent to the classifier?
Chunks with bearer text, keys, tokens, secrets, passwords, armoured blocks or NAME=value lines are labelled locally and never sent. Other chunks are redacted before sending.
What does Context compaction keep or drop need to run?
The example is Python using only the standard library, plus network access to the classifier endpoint at classifier.dev. The skill notes that the service forwards input text to a model provider.
How do I install Context compaction keep or drop in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/context-compaction-keep-or-drop to use it in all your projects, or to .claude/skills/context-compaction-keep-or-drop in one project.
Does Context compaction keep or drop run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Context compaction keep or drop?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Context compaction keep or drop?
The closest alternatives to Context compaction keep or drop are Context engineering, Principle guard the context window, Note, Context manager and Entroly context control.
Where this comes from
- Description: from the skill's own SKILL.md.
More from mrmps/classifier-dev

Sorts many texts into your own labels in one call, with a confidence per answer
- Open source
- 440 GitHub stars
- Developer tools

Lets a browser or desktop agent pick its next action from on-screen elements
- Open source
- 440 GitHub stars
- Browser automation

Gates user posts against a written content policy using per-category scores
- Open source
- 440 GitHub stars
- Security

Sorts each page of a multi-document intake packet by type before extraction
- Open source
- 440 GitHub stars
- Files and documents

Sorts a downloads folder into invoice, receipt and contract folders with an undo log
- Open source
- 440 GitHub stars
- Files and documents

Pre-filters long headline and feed lists against a written brief before reading
- Open source
- 440 GitHub stars
- Files and documents





