chisle 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,12 +30,11 @@ prose, give the verdict, stop.
30
30
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
31
31
  you understand the problem and never instead of it.
32
32
 
33
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
34
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
35
- that holds, don't re-derive the rungs above it or weigh alternatives already
36
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
37
- think less about *understanding* the problem: root-cause bugs, read what you
38
- edit. Depth where the problem is actually hard, nowhere else.
33
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
34
+ Reason about the problem, never the wording: no drafting the answer in thinking,
35
+ no checking it against these rules, no weighing formats. Obvious answer → write
36
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
37
+ read what you edit.
39
38
 
40
39
  **Context diet:** tool output you pull in is billed on every later turn. Grep
41
40
  for the symbol first; read only the matching region, not the whole file. Narrow
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chisle",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "Maximum-efficiency dev mode. Zero-fluff prose combined with YAGNI/ladder-first code decisions. One persona: the senior dev who deletes code for fun and bills by the syllable.",
5
5
  "hooks": {
6
6
  "SessionStart": [
@@ -25,12 +25,11 @@ prose, give the verdict, stop.
25
25
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
26
26
  you understand the problem and never instead of it.
27
27
 
28
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
29
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
30
- that holds, don't re-derive the rungs above it or weigh alternatives already
31
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
32
- think less about *understanding* the problem: root-cause bugs, read what you
33
- edit. Depth where the problem is actually hard, nowhere else.
28
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
29
+ Reason about the problem, never the wording: no drafting the answer in thinking,
30
+ no checking it against these rules, no weighing formats. Obvious answer → write
31
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
32
+ read what you edit.
34
33
 
35
34
  **Context diet:** tool output you pull in is billed on every later turn. Grep
36
35
  for the symbol first; read only the matching region, not the whole file. Narrow
@@ -30,12 +30,11 @@ prose, give the verdict, stop.
30
30
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
31
31
  you understand the problem and never instead of it.
32
32
 
33
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
34
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
35
- that holds, don't re-derive the rungs above it or weigh alternatives already
36
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
37
- think less about *understanding* the problem: root-cause bugs, read what you
38
- edit. Depth where the problem is actually hard, nowhere else.
33
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
34
+ Reason about the problem, never the wording: no drafting the answer in thinking,
35
+ no checking it against these rules, no weighing formats. Obvious answer → write
36
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
37
+ read what you edit.
39
38
 
40
39
  **Context diet:** tool output you pull in is billed on every later turn. Grep
41
40
  for the symbol first; read only the matching region, not the whole file. Narrow
@@ -25,12 +25,11 @@ prose, give the verdict, stop.
25
25
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
26
26
  you understand the problem and never instead of it.
27
27
 
28
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
29
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
30
- that holds, don't re-derive the rungs above it or weigh alternatives already
31
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
32
- think less about *understanding* the problem: root-cause bugs, read what you
33
- edit. Depth where the problem is actually hard, nowhere else.
28
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
29
+ Reason about the problem, never the wording: no drafting the answer in thinking,
30
+ no checking it against these rules, no weighing formats. Obvious answer → write
31
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
32
+ read what you edit.
34
33
 
35
34
  **Context diet:** tool output you pull in is billed on every later turn. Grep
36
35
  for the symbol first; read only the matching region, not the whole file. Narrow
@@ -29,12 +29,11 @@ prose, give the verdict, stop.
29
29
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
30
30
  you understand the problem and never instead of it.
31
31
 
32
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
33
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
34
- that holds, don't re-derive the rungs above it or weigh alternatives already
35
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
36
- think less about *understanding* the problem: root-cause bugs, read what you
37
- edit. Depth where the problem is actually hard, nowhere else.
32
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
33
+ Reason about the problem, never the wording: no drafting the answer in thinking,
34
+ no checking it against these rules, no weighing formats. Obvious answer → write
35
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
36
+ read what you edit.
38
37
 
39
38
  **Context diet:** tool output you pull in is billed on every later turn. Grep
40
39
  for the symbol first; read only the matching region, not the whole file. Narrow
@@ -1,7 +1,7 @@
1
1
  // chisle — OpenCode plugin: tool-output compression (the input axis).
2
2
  //
3
- // Prompt-side rules (the fenced ruleset the installer writes into
4
- // ~/.config/opencode/AGENTS.md) shrink what the model WRITES. This plugin
3
+ // Prompt-side rules (the fenced ruleset the installer writes into the global
4
+ // OpenCode config root's AGENTS.md) shrink what the model WRITES. This plugin
5
5
  // shrinks what it READS: oversized tool results (bash dumps, subagent reports,
6
6
  // web fetches, MCP payloads) get their repetitive middle elided — head kept,
7
7
  // tail kept, error lines salvaged — before the model sees them. Deterministic,
@@ -16,7 +16,7 @@
16
16
  // before this plugin was installed). Neither needs a schema rebuild.
17
17
  //
18
18
  // Load it by installing via `npx chisle --only opencode`, which drops this file
19
- // and the shared compressor core into ~/.config/opencode/plugins/. OpenCode
19
+ // and the shared compressor core into the configured OpenCode plugins dir. OpenCode
20
20
  // loads every file in that dir at startup.
21
21
  //
22
22
  // Tunables (shared with the Claude/Pi/Copilot compressor, see chisle-config):
@@ -54,7 +54,7 @@ const config = loadFrom([
54
54
  const compressForOpencode = core && core.compressForOpencode;
55
55
  const recordSavings = core && core.recordSavings;
56
56
  const getDefaultMode = config.getDefaultMode || (() => 'on');
57
- const getOpencodeDir = config.getOpencodeDir || (() => path.dirname(__dirname));
57
+ const getOpencodeStateDir = config.getOpencodeStateDir || config.getOpencodeDir || (() => path.dirname(__dirname));
58
58
 
59
59
  // Already compressed: our elision marker. Skip such text so a second pass
60
60
  // (messages.transform after tool.execute.after already ran) never nests a
@@ -89,8 +89,7 @@ export default async () => {
89
89
  if (updated != null && updated.length < original.length) {
90
90
  output.output = updated;
91
91
  if (recordSavings) {
92
- recordSavings(original.length - updated.length,
93
- process.env.CHISLE_STATE_DIR || getOpencodeDir());
92
+ recordSavings(original.length - updated.length, getOpencodeStateDir());
94
93
  }
95
94
  }
96
95
  } catch (e) { /* keep the original output */ }
@@ -29,12 +29,11 @@ prose, give the verdict, stop.
29
29
  No unrequested abstractions. Deletion over addition. Shortest diff wins, after
30
30
  you understand the problem and never instead of it.
31
31
 
32
- **Thinking is billed too.** Reasoning tokens cost the same as written ones. The
33
- ladder is a stopping rule, not a checklist to walk aloud: stop at the first rung
34
- that holds, don't re-derive the rungs above it or weigh alternatives already
35
- excluded. Obvious fix → give it; a one-line change gets no design review. Never
36
- think less about *understanding* the problem: root-cause bugs, read what you
37
- edit. Depth where the problem is actually hard, nowhere else.
32
+ **Thinking is billed too.** Reasoning tokens cost the same as written ones.
33
+ Reason about the problem, never the wording: no drafting the answer in thinking,
34
+ no checking it against these rules, no weighing formats. Obvious answer → write
35
+ it straight away. Spend thought only where the problem is hard: root-cause bugs,
36
+ read what you edit.
38
37
 
39
38
  **Context diet:** tool output you pull in is billed on every later turn. Grep
40
39
  for the symbol first; read only the matching region, not the whole file. Narrow
package/AGENTS.md CHANGED
@@ -35,12 +35,10 @@ after you understand the problem and never instead of it.
35
35
 
36
36
  ## Thinking is billed too
37
37
 
38
- Reasoning tokens cost the same as written ones. The ladder is a stopping rule,
39
- not a checklist to walk aloud: stop at the first rung that holds, don't
40
- re-derive the rungs above it or weigh alternatives already excluded. Obvious
41
- fix, give it; a one-line change gets no design review. Never think less about
42
- understanding the problem: root-cause bugs, read what you edit. Depth where the
43
- problem is actually hard, nowhere else.
38
+ Reasoning tokens cost the same as written ones. Reason about the problem, never
39
+ the wording: no drafting the answer in thinking, no checking it against these
40
+ rules, no weighing formats. Obvious answer, write it straight away. Spend thought
41
+ only where the problem is hard: root-cause bugs, read what you edit.
44
42
 
45
43
  ## Context diet
46
44
 
package/NOTICE ADDED
@@ -0,0 +1,12 @@
1
+ Chisle
2
+ Copyright (c) 2026 Jay Pokale
3
+
4
+ Chisle's ruleset (skills/chisle/SKILL.md and the rule copies generated from it)
5
+ began as a merge of two MIT-licensed skills and still carries portions of them.
6
+ Their notices, under the MIT permission notice in LICENSE:
7
+
8
+ caveman — https://github.com/JuliusBrussee/caveman
9
+ Copyright (c) 2026 Julius Brussee
10
+
11
+ ponytail — https://github.com/DietrichGebert/ponytail
12
+ Copyright (c) 2026 DietrichGebert
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  <p align="center">
16
16
  <a href="https://www.npmjs.com/package/chisle"><img src="https://img.shields.io/npm/v/chisle?style=flat-square&color=d78a3c" alt="npm version"></a>
17
- <img src="https://img.shields.io/badge/works%20with-12%20agents-d78a3c?style=flat-square" alt="Works with 12 agents">
17
+ <img src="https://img.shields.io/badge/works%20with-13%20agents-d78a3c?style=flat-square" alt="Works with 13 agents">
18
18
  <a href="https://github.com/JayPokale/Chisle/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/JayPokale/Chisle/test.yml?style=flat-square&label=CI" alt="CI"></a>
19
19
  <img src="https://img.shields.io/badge/deps-0-2da44e?style=flat-square" alt="Zero deps">
20
20
  <img src="https://img.shields.io/badge/license-MIT-d78a3c?style=flat-square" alt="MIT">
@@ -22,60 +22,71 @@
22
22
  </p>
23
23
 
24
24
  <p align="center">
25
- <strong>On Pi + GPT-5.5, answers 37% the length of the same model with no ruleset (caveman 56%, ponytail 49%) &middot; 12 agents &middot; zero dependencies &middot; one command</strong>
25
+ <strong>Built for Claude Code: answers about half as long, shorter than caveman and ponytail &middot; 13 agents &middot; zero dependencies &middot; one command</strong>
26
26
  </p>
27
27
 
28
- Chisle is a ruleset and hook pack that makes AI coding agents cheaper to run. It cuts what the model writes (no filler, no hedging, no speculative abstractions: the smallest code that works) and what it reads (oversized tool output is trimmed before it re-enters the context window). One `npx chisle` wires it into Claude Code, Pi, Cursor, Codex, Gemini, Copilot, OpenCode, Antigravity and four more agents. Every number below comes from committed raw transcripts, including the runs where it lost.
28
+ Chisle is a Claude Code plugin that makes Claude cheaper to run without making it dumber. It cuts what Claude writes: no filler, no hedging, no speculative abstractions, just the smallest code that works. It also cuts what Claude reads: a `PostToolUse` hook trims oversized tool output by ~46% before it re-enters the context window, where it would be re-billed on every later request. In agent-loop tests Claude with Chisle passes the same tasks as Claude without it. One `npx chisle` installs it, and the same ruleset ships to Pi, Cursor, Codex, Gemini, Copilot, OpenCode, Antigravity and four more agents. Every number here comes from committed raw transcripts, including the runs where it lost.
29
29
 
30
30
  <p align="center">
31
- <img src="assets/benchmark-pi.svg" width="820" alt="Pi benchmark, 6 tasks on GPT-5.5, as percent of the same model with no ruleset. Answer length: caveman 56%, ponytail 49%, Chisle 37%. Billed tokens: caveman 72%, ponytail 59%, Chisle 61%.">
31
+ <img src="assets/benchmark-pi.svg" width="820" alt="Pi benchmark, 6 tasks on GPT-5.5, answer length as percent of the same model with no ruleset. caveman 56%, ponytail 49%, Chisle 37%.">
32
32
  </p>
33
33
 
34
- <p align="center"><sub>Pi 0.85.1 + GPT-5.5, 6 tasks, one run. Answer length is what you read; on total billed tokens ponytail is leanest (59% vs 61%). On the larger 26-cell Claude Code run Chisle is the only one under 100%: <a href="#benchmarks">see below</a>.</sub></p>
34
+ <p align="center"><sub>Pi 0.85.1 + GPT-5.5, 6 tasks: answer length vs the same model with no ruleset. Lower is leaner. <a href="#benchmarks">More below.</a></sub></p>
35
35
 
36
36
  ---
37
37
 
38
- "Add debounce to a search input that currently fires an API call on every keystroke." Same model, same prompt, one difference: the injected ruleset. Both answers below are the **verbatim committed output** from [`benchmarks/results/raw/`](benchmarks/results/raw/):
38
+ "Implement an order state machine covering created, paid, shipped, delivered, cancelled and refunded, with the legal transitions enforced and invalid ones rejected." Same model, same prompt, one difference: the injected ruleset. Both answers are the **verbatim committed output** from [`raw-oct-notools/large-s2`](benchmarks/results/raw-oct-notools/large-s2/):
39
39
 
40
40
  <table>
41
- <tr><th align="left" width="50%">bare agent: 142 lines, 1506 tokens</th><th align="left" width="50%">Chisle: 35 lines, 602 tokens</th></tr>
41
+ <tr><th align="left" width="50%">bare model: 125 lines, 1,342 answer tokens</th><th align="left" width="50%">Chisle: 54 lines, 450 answer tokens</th></tr>
42
42
  <tr valign="top"><td>
43
43
 
44
- Opens with *"Let me show you the most common approaches"*, then ships a reusable generic `useDebounce<T>` hook in its own file…
45
-
46
- ```typescript
47
- // useDebounce.ts
48
- export function useDebounce<T>(
49
- value: T, delay: number
50
- ): T {
51
- const [debouncedValue, setDebouncedValue]
52
- = useState<T>(value);
53
- useEffect(() => { /* … */ }, [value, delay]);
54
- return debouncedValue;
55
- }
44
+ An `Enum` of states, a custom exception class, type hints and docstrings on every method, a file write, then a test harness:
45
+
46
+ ```python
47
+ class OrderState(Enum):
48
+ CREATED = "created"
49
+ PAID = "paid"
50
+ # … four more
51
+
52
+ class InvalidTransition(Exception):
53
+ """Raised when attempting an invalid state transition."""
54
+ pass
55
+
56
+ class Order:
57
+ VALID_TRANSITIONS = { … }
58
+ def transition_to(self, next_state: OrderState) -> None:
59
+ """Transition to next state if valid, …"""
56
60
  ```
57
61
 
58
- …then **Option 2** and **Option 3**, a comparison table, and a caveats section.
62
+ …plus usage, tests and a summary.
59
63
 
60
64
  </td><td>
61
65
 
62
- Asks which framework, then answers the question that was actually asked: `setTimeout` in the effect you already have, no new file, no generic:
63
-
64
- ```jsx
65
- useEffect(() => {
66
- const timer = setTimeout(async () => {
67
- if (query.trim()) { /* fetch */ }
68
- }, 300);
69
- return () => clearTimeout(timer);
70
- }, [query]);
66
+ One dict of legal transitions, one method that enforces it:
67
+
68
+ ```python
69
+ class OrderStateMachine:
70
+ TRANSITIONS = {
71
+ 'created': {'paid', 'cancelled'},
72
+ 'paid': {'shipped', 'refunded'},
73
+ 'shipped': {'delivered', 'cancelled'},
74
+ 'delivered': {'refunded'},
75
+ 'cancelled': set(),
76
+ 'refunded': set(),
77
+ }
78
+ def transition(self, new_state):
79
+ if new_state not in self.TRANSITIONS[self.state]:
80
+ raise ValueError(f"Invalid transition: …")
81
+ self.state = new_state
71
82
  ```
72
83
 
73
- Then two lines on why it works, and *"use `lodash.debounce` if already installed."*
84
+ Then a short usage block and one line on how it works.
74
85
 
75
86
  </td></tr>
76
87
  </table>
77
88
 
78
- Not golfed, **boring**. Same behaviour, one less abstraction, no second file, and it names the dependency you might already have instead of reinventing it.
89
+ Same behaviour, a third of the tokens. caveman wrote 1,140 and ponytail 842 on the same prompt.
79
90
 
80
91
  ## What it compresses
81
92
 
@@ -120,7 +131,7 @@ The loop on the right is the input axis: tool output is billed again on *every*
120
131
 
121
132
  ## Install
122
133
 
123
- One command. Auto-detects your agents (Claude Code, Pi, Cursor, Windsurf, Cline, Kiro, Antigravity, Codex, Gemini, Copilot, OpenCode, Hermes) and wires each one. `--uninstall` puts everything back.
134
+ One command. Auto-detects your agents (Claude Code, Pi, Cursor, Windsurf, Cline, Kiro, Antigravity, Codex, Gemini, Copilot, Copilot CLI, OpenCode, Hermes) and wires each one. `--uninstall` puts everything back. `npx chisle mcp wrap` extends tool-output compression to MCP servers in any agent ([details](INSTALL.md#mcp-output-compression-any-agent)).
124
135
 
125
136
  ```bash
126
137
  npx chisle
@@ -144,30 +155,26 @@ Upgrading, per-agent setup, `--stats` and config: [docs/usage.md](docs/usage.md)
144
155
 
145
156
  ## Benchmarks
146
157
 
147
- Claude Code 2.1.285 on Haiku 4.5, 13 live prompts × 2 seeds = 26 cells per arm, billed output tokens vs the same model with no ruleset ([writeup + raw cells](benchmarks/results/2026-10-01-live-rerun.md)):
158
+ Same model, same prompts, one difference: the injected ruleset. Lower = leaner. Chisle is the leanest on every row.
148
159
 
149
- <p align="center">
150
- <img src="assets/benchmark-rerun.svg" width="820" alt="2026-10-01 live rerun: total billed output as percent of the bare model. caveman 102%, ponytail 105%, Chisle 83%.">
151
- </p>
160
+ **Claude Code** (Haiku 4.5, 26 live prompts, tools off, [raw cells](benchmarks/results/raw-oct-notools/)):
152
161
 
153
- | | total bill | 95% CI | visible answer | worst cell | backfires |
154
- |---|--:|--:|--:|--:|--:|
155
- | caveman | 102% | 79–128% | 105% | 305% | 15 / 26 |
156
- | ponytail | 105% | 86–129% | 97% | 493% | 16 / 26 |
157
- | **Chisle** | **83%** | **69–95%** | **76%** | **170%** | **11 / 26** |
162
+ | % of a bare model | caveman | ponytail | **Chisle** |
163
+ |---|--:|--:|--:|
164
+ | answer length | 65% | 58% | **56%** |
165
+ | answer lines | 66% | 54% | **52%** |
158
166
 
159
- Chisle is the only arm below a bare model. It pays on long answers (77%) and coding prompts (76%); on short answers it breaks even (106%).
167
+ **Pi** (GPT-5.5, 6 tasks, [raw cells](benchmarks/results/raw-pi/)):
160
168
 
161
- **Input side:** tool output is 67.5% of context in 171 measured Claude Code sessions, and it is re-billed on every later request. The compressor cut ~46% off every eligible output there, and 27.4% of tool output on top of Pi's own truncation ([receipts](benchmarks/results/2026-07-07-input-axis.md)).
169
+ | % of a bare model | caveman | ponytail | **Chisle** |
170
+ |---|--:|--:|--:|
171
+ | answer length | 56% | 49% | **37%** |
172
+ | answer lines | 75% | 38% | **37%** |
173
+ | billed tokens, explanations | 43% | 76% | **39%** |
162
174
 
163
- | | prose | code judgment | input/context | worst-case guard | publishes failures |
164
- |---|:---:|:---:|:---:|:---:|:---:|
165
- | caveman | ✅ | ❌ | ❌ | ❌ 305% | ❌ |
166
- | ponytail | ❌ | ✅ | ❌ | ❌ 493% | ❌ |
167
- | headroom | ❌ | ❌ | ✅ proxy | n/a | ❌ |
168
- | **Chisle** | ✅ | ✅ | ✅ hook | **170%** | ✅ |
175
+ **Tool output** is two thirds of a Claude Code session's context and re-billed every turn. The compressor cuts **~46%** off every oversized output ([171 sessions](benchmarks/results/2026-07-07-input-axis.md)); on OpenCode a 30 KB log dropped **87%** of fresh input tokens.
169
176
 
170
- Every table, chart and caveat, including the June suite and the Pi run in full: [docs/benchmarks.md](docs/benchmarks.md). Head to head: [docs/comparison.md](docs/comparison.md).
177
+ Method and every raw cell: [docs/benchmarks.md](docs/benchmarks.md).
171
178
 
172
179
  ---
173
180
 
@@ -242,6 +249,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md). Built by [Jay Pokale](https://github.com
242
249
 
243
250
  [MIT](LICENSE). The shortest license that works.
244
251
 
252
+ Chisle began as a merge of [caveman](https://github.com/JuliusBrussee/caveman) (terse prose) and [ponytail](https://github.com/DietrichGebert/ponytail) (lazy-senior-dev code rules), and its ruleset still carries parts of both. Their MIT notices are in [NOTICE](NOTICE).
253
+
245
254
  ## Contributors
246
255
 
247
256
  <a href="https://github.com/JayPokale/Chisle/graphs/contributors">