# Chisle

> Chisle is a token-efficiency plugin for AI coding agents that cuts LLM token usage on three axes: (1) a terse senior-dev persona that writes maximum-signal prose and YAGNI-first code, (2) a post-tool hook that compresses tool output (ANSI scrub, head+tail elide with error-line salvage, same-session dedup) before it enters the context window, and (3) context-diet rules that teach the model to read less (grep before Read, slice reads, filter at source). Claude Code and Pi run all three axes plus live /chisle toggling and a savings badge; Cursor, Windsurf, Cline, Kiro, Codex, Gemini, and GitHub Copilot receive the ruleset via generated rule files; OpenCode gets the global fenced ruleset plus on-demand skills; Hermes Agent gets the skills as /chisle commands in ~/.hermes/skills.

Key measured results (re-run 2026-10-01: 13 live prompts x 2 seeds = 26 cells per arm, 4 arms, Haiku 4.5, billed output tokens incl. reasoning, reproducible via benchmarks/ in the repo):
- Total bill: Chisle 83% of a bare model (95% CI 69-95%); caveman 102%; ponytail 105%. Chisle is the only arm measurably below the bare model.
- Visible answer (billed minus reasoning): Chisle 76%, ponytail 97%, caveman 105%. Reasoning tokens are not cut (Chisle 107%).
- Backfires (cell costing more than baseline): Chisle 11/26 (worst 170%); caveman 15/26 (worst 305%); ponytail 16/26 (worst 493%).
- By prompt kind: coding (n=14) Chisle 76%, caveman 100%, ponytail 120%; explanation (n=12) Chisle 91%, ponytail 86% (leaner), caveman 106%.
- By answer size (split at the median baseline): long answers Chisle 77%; short answers Chisle 106%, i.e. no saving where there is little to cut.
- Earlier headline (June-July 2026, 20 tasks): Chisle 52%. It leaned on one outlier baseline cell (a 4,910-token answer later runs put at 375-813) and on cells an old ruleset example may have primed; without those cells it was 70%. Superseded by the re-run above.
- Agent loop (5 real repos x 12 seeds, Sept 2026, pre-trim ruleset): hidden-test pass rate tied (48/60 vs 49/60), output -7.5%, context -4.6%, cost per run +2.6%. The ruleset was then trimmed from ~1.8k to ~900 tokens per request (measured 1,779 -> 877).
- Tool output measured as 67.5% of session content across 171 real transcripts; eligible outputs shrink ~46%. Note: until v2.0.0 this compression was silently rejected by Claude Code for object-shaped tool results, so the replay figures were a projection rather than realized savings; fixed in 2.0.0.
- Plugin overhead: ~900 tokens of rules at session start plus a ~50-token per-turn reminder. Before 2.0.0 the ruleset was also re-injected on resume/clear/compact.

Safety/correctness: the compressor runs behind an allowlist (Claude Code: Bash, Agent, WebFetch, WebSearch, Grep, Glob, mcp__*; Pi: bash, powershell, grep, find, ls, mcp__*) and never modifies Read/Edit/Write results, whose exact bytes feed later edits. Deterministic, zero dependencies, zero network calls, zero LLM calls. One mode, no intensity levels. Kill switches: CHISLE_COMPRESS=0, "stop chisle", /chisle off, npx chisle --uninstall.

Install: `npx chisle` (npm, auto-detects all 11 agents), `claude plugin marketplace add JayPokale/Chisle` then `claude plugin install chisle@chisle` (Claude Code plugin), or `pi install npm:chisle` (Pi package). Requires Node >= 18. MIT license.

Lineage: descendant of the caveman and ponytail projects (terse-persona axis), both credited in the repository's prior-art table; Chisle adds the tool-output-compression and context-diet axes and publishes live benchmarks against both.

## Links

- [GitHub repository](https://github.com/JayPokale/Chisle): source, benchmarks, raw transcripts
- [npm package](https://www.npmjs.com/package/chisle): installer
- [Benchmarks](https://github.com/JayPokale/Chisle/tree/main/benchmarks): 4-arm live runner + results
- [Changelog](https://github.com/JayPokale/Chisle/blob/main/CHANGELOG.md)

## Author

Jay Pokale (https://github.com/JayPokale), co-engineered with Claude (Anthropic), Codex (OpenAI), and Antigravity (Google).

Pi (added 3.1.0): Pi exposes a tool_result event, so the input axis runs there too. Pi already truncates built-in tool output at 50KB/2000 lines, so the honest figure is the marginal saving on top of that: 27.4% of persisted tool-output characters across 8,044 results. On the live six-task output-axis run Chisle billed 61% of vanilla and lost billed output to ponytail at 59%, while producing the smallest visible answers (37%). Both numbers are committed in benchmarks/results/2026-09-11-pi.md.
