Skip to main content
Glama
M4NT

context-the-ripper

by M4NT

The problem

Long sessions fill up with noise: replaced code, resolved questions, failed hypotheses. Every tool either prunes automatically (opaque, can't audit) or leaves it to you (friction, breaks flow).

context-the-ripper does both: automatic by default, auditable on demand.


Related MCP server: context-repo-mcp

Requirements

  • Node.js >= 22.5.0 (uses built-in node:sqlite)


Install

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "context-the-ripper": {
      "command": "npx",
      "args": ["-y", "context-the-ripper"]
    }
  }
}

Restart Claude Desktop. The MCP is active.

Add to your project's CLAUDE.md:

@CONTEXT.md

Then add the MCP to your Claude Code config:

{
  "mcpServers": {
    "context-the-ripper": {
      "command": "npx",
      "args": ["-y", "context-the-ripper"]
    }
  }
}

After the first context_prune or context_checkpoint, CONTEXT.md is written to your project root. Every new session reads it automatically — no onboarding command needed.

If you install as a local dependency (npm install context-the-ripper), a postinstall script adds CONTEXT.md to your .gitignore automatically.

For npx users, add it manually:

echo "CONTEXT.md" >> .gitignore

How it works

  1. The agent scores each message as you work (explicit markers, DDL patterns, failed hypotheses)

  2. Resolved questions and dead branches are marked candidate automatically

  3. When context exceeds 40% noise, context_prune fires silently

  4. Every cut is logged to ~/.context-the-ripper/context.db

  5. CONTEXT.md is written to the project root after every prune or checkpoint

  6. The next session starts from CONTEXT.md — no context lost

You never type a pruning command. You just work.


Tools

Tool

What it does

context_session_id

Generate <project>-<date>-<fingerprint> unique per machine

context_add

Register a message, auto-score it

context_mark

Override status: dead / keep / candidate / live

context_prune

Remove dead/candidate messages, write CONTEXT.md

context_checkpoint

Compress a milestone into a named summary, write CONTEXT.md

context_restore

Undo a cut by ID

context_status

Token usage, noise %, checkpoint count

context_get

Return all live messages for the session


Scoring rules

Automatically marked candidate (pruned on next prune):

  • [resolved], [done], [fixed] markers

  • [dead] marker

  • "didn't work", "won't work" patterns

Never pruned:

  • [!] irreversible action markers

  • [keep] markers

  • [checkpoint] markers

  • DDL statements (CREATE TABLE, ALTER TABLE, DROP TABLE)

  • TypeScript interface and type definitions


Markers

Works with token-the-ripper markers:

[dead]        — mark this message for pruning
[keep]        — protect from pruning
[!]           — irreversible action — always kept
[checkpoint]  — compress into named summary
[resolved]    — auto-scored as candidate
[?]           — source unverified — answer anyway, flag it

Audit log

All cuts stored in ~/.context-the-ripper/context.db (SQLite, local, no telemetry).

cuts { id, message_id, reason, rule, ts }

Every removal is reversible via context_restore(cut_id). Messages pruned more than 30 days ago are vacuumed automatically on startup.


Staleness detection

CONTEXT.md embeds a written_at timestamp. If the file is more than 24 hours old when read, the agent sees a [!] warning inline and triggers a refresh.


Philosophy

"Information is a difference that makes a difference." — Gregory Bateson, Steps to an Ecology of Mind, 1972

Dead context isn't information. It's entropy. The best tool removes it without asking — and logs every cut so you can undo it.

Invisible by default. Auditable on demand. Every cut earns its place in the log.


Foundations

Claude ShannonA Mathematical Theory of Communication, 1948 Every channel has a capacity. Tokens that carry no new information are noise — they consume capacity without increasing the model's ability to respond.

Herbert Simon"Designing Organizations for an Information-Rich World", 1971 "A wealth of information creates a poverty of attention." Context pruning is an attention-allocation mechanism: finite attention lands on signal, not dead turns.

George A. Miller"The Magical Number Seven, Plus or Minus Two", 1956 Exceeding working memory limits degrades reasoning. Stuffing a context window past the model's effective span is the LLM equivalent of exceeding Miller's limit.

Friedrich Nietzsche"On the Uses and Disadvantages of History for Life", 1874 A healthy mind requires active forgetting — the capacity to dissolve the past so present action remains possible. A context that cannot forget becomes paralyzed by its own record.

Jorge Luis Borges"Funes the Memorious", 1942 Ireneo Funes, after gaining perfect memory, could no longer think in abstractions. Total recall destroys the ability to reason.

William JamesThe Principles of Psychology, 1890 "My experience is what I agree to attend to." Consciousness is selective. The session's experience is what survives the cut.

Alan Baddeley & Graham Hitch"Working Memory", 1974 Working memory is an active, capacity-limited workspace. The context window is an engineering analogue — the pruning policy is its central executive.

Viktor Mayer-SchönbergerDelete: The Virtue of Forgetting in the Digital Age, 2009 Forgetting is the natural default; retention requires effort. context-the-ripper applies the same asymmetry: forgetting is the default, retention must be earned.


Development

npm test        # run 41 tests (unit + integration)
npm run dev     # start MCP server with --watch

Tests use node:test — no external test framework needed.


License

MIT. Part of the ripper ecosystem.


Banner art

The banner is an AI-edited version of a Victorian-era engraving depicting suspects being observed near a "MURDER" sign on the streets of Whitechapel, London — associated with the Jack the Ripper investigations of 1888. The figure's head was replaced with a cardboard box representing the LLM context window: anonymous, operating in the fog, stripping what doesn't matter.

© Stefano Bianchetti / Corbis Historical / Getty Images (ID 526614274). Editorial use only. Original illustration c. 1891. Digitally edited by AI for this project.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/M4NT/context-the-ripper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server