agentleFS
JuliusBrusseeJuliusBrussee/caveman/shrink/AGENTS.md

caveman / shrink

AGENTS.md110k starsChanged 8 months agoApache-2.0View on GitHub

Compress MCP/OpenAI tool definitions before they fill the context window. A thin Go wrapper over the engine's toolschema compressor: it drops annotation metadata (examples, titles, $comment, $schema) and reduces long descriptions to their lead plus every constraint-bearing sentence. It keeps every selection token (tool/parameter names, types, enums, required) and argument-construction value (default, const, $ref targets) byte-for-byte. Everything is inferred. Selection alone does not guarantee valid arguments. Short descriptions stay whole; long ones keep the lead plus every recognised constraint sentence…

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about JuliusBrussee/caveman

The biggest 5 of 103 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 103

Talked about on GitHub, Bluesky and Hacker News (103 times).

On GitHub · 50

45 more on GitHub

On Bluesky · 50

45 more on Bluesky

The file

Files
AGENTS.md

shrink — caveman-shrink, the tool-catalog compressor (Go core + launcher, Apache-2.0)

Compress MCP/OpenAI tool definitions before they fill the context window. A thin Go wrapper over the engine's toolschema compressor: it drops annotation metadata (examples, titles, $comment, $schema) and reduces long descriptions to their lead plus every constraint-bearing sentence. It keeps every selection token (tool/parameter names, types, enums, required) and argument-construction value (default, const, $ref targets) byte-for-byte. Everything is inferred.

Layout

  • shrink.go — the library: Shrink (catalog → compressed, fail-open S4 transform, durable-CCR-backed), Recover (handle → original bytes), Lint (per-tool inferred token reductions), SelectionProfile (the structural surface — what must survive). WithStore/WithStorePath select recovery storage; default is CAVEMAN_CCR_DB / ~/.caveman/ccr.db.
  • cmd/caveman-shrink/ — the CLI: caveman-shrink / shrink (stdin→stdout), lint <file>, and recover <handle>.
  • bin/caveman-shrink.mjs + package.json — the npx caveman-shrink launcher around the prebuilt binary.

Two correctness boundaries

SelectionProfile(input) == SelectionProfile(Shrink(input).Output) always. This proves the structural selection surface (names/params/enums/required) survives byte-for-byte. It does not prove the model selects the same tool: descriptions are model-visible and long descriptions are lossy. Behavioral selection equivalence requires model-eval fixtures; keep results inferred.

Selection alone does not guarantee valid arguments. Short descriptions stay whole; long ones keep the lead plus every recognised constraint sentence (must/cannot/required/bounds/format/ ISO/RFC/absolute/etc.). default, const, and internal $ref targets survive. Golden and adversarial conformance tests lock these construction surfaces; over-keep is safer than a retry.

Conventions

  • Build/test: make product-build PRODUCT=shrink / make product-test PRODUCT=shrink.
  • The structural compressor lives in the engine (compressors/toolschema.go); shrink reuses it, never forks it.
  • This is the dedicated product surface for the toolschema compressor. Engine API/CLI callers can also force it locally. Managed-gateway adapters keep tool arrays in the frozen prompt-cache prefix and never hand them to it; gateway's separate S2 tool-search/deferral path is not compression. Local reductions stay inferred. A future billed route for this transform needs cache-versus-schema cost proof, stable byte-identical prefix output, and an eval gate.

Gotchas (honesty invariants)

  • S4 lossy, fail-open — successful compression changes model-visible bytes; malformed/incompressible catalogs pass through unchanged (ratio:0, no handle).
  • inferred-only — token counts are estimates via the engine's offline counter; never verified, never re-projected.
  • reversible for real — a compressing shrink commits the exact original to the durable shared CCR store before returning a handle. A separate process resolves it through Recover / caveman-shrink recover; failure to open storage makes library Shrink return an error, while the CLI catches that error and forwards the original bytes with no handle.

See ../../CLAUDE.md (root) · ../engine/CLAUDE.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.