Chisle token-diet ruleset for Claude Code and 12 other coding agents
Discovered from README cross-links · today
Cut Claude Code answer length and tool-output tokens without losing task
What they did
They installed Chisle into a Claude Code repo with a single `npx chisle` command, which drops in a ruleset that suppresses filler, hedging and speculative abstractions, plus a PostToolUse hook that trims oversized tool output before it re-enters the context window. They then ran the same agent-loop tasks with and without the ruleset — including an order state machine prompt covering created, paid, shipped, delivered, cancelled and refunded states — and compared the committed raw transcripts. The bare model produced 125 lines and 1,342 answer tokens with enums, custom exception classes, type hints, docstrings, a file write and a test harness; with Chisle the same task came back as 54 lines and 450 answer tokens: one transition dict and one enforcing method. They also checked the same ruleset against the sibling tools caveman and ponytail on the Pi benchmark, where Chisle measured 37% of baseline answer length versus 56% and 49%.
How it went
Answer length dropped to roughly 37% of the unmodified model on the Pi benchmark, and the agent-loop tests passed the same tasks with and without the ruleset. The order state machine example went from 1,342 to 450 answer tokens with the legal transitions still enforced. Install is one command with zero dependencies, and the same ruleset ships to 13 agents including Cursor, Codex, Gemini, Copilot and OpenCode. The project publishes the runs where it lost, so the benchmark numbers are auditable rather than cherry-picked.
Worth knowing
The headline savings are measured on a small benchmark (6 tasks on Pi) and on committed transcripts, not on your codebase, so your mileage will vary by task type and language. The ~46% tool-output trim comes from a hook that rewrites tool results — if you rely on exact raw output for debugging or diffing, verify the trimmed form still carries what you need. Terse output can also drop explanatory comments and docstrings you might have wanted in generated code, so review before committing. Setup assumes Node/npx availability and a Claude Code version that supports PostToolUse hooks.
Wiring
Run `npx chisle` at the repo root; it writes the ruleset into the agent's instruction file (CLAUDE.md-style for Claude Code, and the equivalent for Pi, Cursor, Codex, Gemini, Copilot, OpenCode, Antigravity and the rest) and registers a PostToolUse hook in the Claude Code settings. The hook intercepts tool results after execution, trims oversized output by roughly 46%, and returns the shortened form to the context window so later requests are not re-billed for the full payload. Order matters: install the ruleset first, then verify the hook is registered and firing before benchmarking, since the token savings come from both the shorter answers and the trimmed reads. No dependencies are added, so there is nothing to keep in sync beyond the config files.
Try it yourself
Install Chisle in this repo with `npx chisle`, then confirm the ruleset and PostToolUse hook landed in the right config files for my agent. Next, run a controlled comparison: pick three representative tasks from this codebase (one small bug fix, one new module, one refactor), run each with the ruleset enabled and disabled, and record answer token counts, wall-clock time, and whether tests still pass. Finally, show me the diff between the two outputs for the new-module task so I can judge whether the terser version lost anything I care about, and tell me if the tool-output trimming ever mangled a result I needed.