ContextPruner

How does ContextPruner work?

ContextPruner keeps AI coding agents focused on your real code by telling them which files to skip — from paths and byte sizes alone, never your file contents. Here's the philosophy and how the pieces fit.

Short answer

ContextPruner stops AI coding agents from spending their limited context on junk — lockfiles, build output, vendored dependencies — so it goes to your real code instead. It works from a listing of your file paths and byte sizes, never the contents, and produces the config files each agent reads: advisory instruction files like AGENTS.md and CLAUDE.md, enforced ignore files the agent's own harness applies as a best-effort block, and a paid runtime filter that drops junk from broad searches on your own machine. The free tier runs entirely in your browser, so your file list never leaves it.

An AI coding agent works from the files on your disk, and its context window is finite. Every file it reads spends from the same budget as your real code — so when a search pulls in a committed lockfile, a minified bundle, or a folder of vendored dependencies, that budget goes to noise, and the agent has less room for the code and the instructions that actually matter. It's a large part of why an agent keeps losing context. ContextPruner's whole job is to keep that budget on your code.

The idea: your code is signal, the machinery is noise

A repository is two kinds of files. There's the code you wrote — every bit of it worth the agent's attention — and there's the installed machinery your tools generate around it: dependency directories, build output, lockfiles, caches, minified files, coverage reports. On a typical project the machinery outweighs the source by a thousand to one in bytes. None of it teaches the model anything about your project, but any of it can leak into a prompt and crowd out the parts that do.

The fix is old and simple: tell the agent which files to skip. The hard part isn't knowing that — it's doing it well across every tool you use, writing rules a machine can act on, and keeping them accurate as the repo grows and the junk set drifts. That is the gap ContextPruner fills.

What it never sees

The design starts from a hard privacy line: your source code never leaves your machine. To decide what to skip, ContextPruner needs to know only what files exist and how big they are — a listing of paths and byte sizes. It never reads, uploads, or stores the contents of a single file.

How the pieces fit: generate, lint, enforce

ContextPruner reads your file listing, decides for each path whether it's code worth keeping or machinery worth skipping, and turns that into rules the agents can use. Three stages build on each other:

The Enforce stage is layered on purpose, because agents give you different amounts of leverage:

Generating the rules, checking them, and enforcing them is a full loop, and the $9/month tier keeps every file current on each push so the configs never drift stale. What ContextPruner deliberately keeps to itself is the recipe underneath — exactly how it classifies each path and derives each rule. The point of this page is the philosophy, not a blueprint.

Why not just write an ignore file yourself?

You can, and for a small, stable repo you probably should — an ignore list in AGENTS.md is a real, free win. ContextPruner earns its place on three things a hand-written list struggles with. It covers everyagent's file format from one source instead of you maintaining five. It stays current automatically as the repo grows, rather than going stale the week after you write it. And it measures the cost honestly, so the decision is grounded in numbers you can check rather than a guess. For a fuller comparison of the approaches, see AI context tools compared.

What ContextPruner doesn't do

Being clear about the edges is part of the point:

Related guides