Claude Code 및 12개 다른 코딩 에이전트를 위한 Chisle 토큰 다이어트 규칙 세트
README 링크에서 발견 · today
Claude Code의 답변 길이와 도구 출력 토큰을 작업 손실 없이 줄이기
What they did
그들은 단일 `npx chisle` 명령으로 Chisle을 Claude Code 저장소에 설치했는데, 이는 군더더기, 완곡한 표현, 추측성 추상화를 억제하는 규칙 세트와, 과도하게 큰 도구 출력이 컨텍스트 윈도우로 다시 들어오기 전에 이를 잘라내는 PostToolUse 훅을 추가한다. 그런 다음 동일한 에이전트 루프 작업을 규칙 세트가 있을 때와 없을 때로 나누어 실행했으며 — created, paid, shipped, delivered, cancelled, refunded 상태를 다루는 주문 상태 머신 프롬프트를 포함해서 — 커밋된 원본 트랜스크립트를 비교했다. 순수 모델은 enum, 커스텀 예외 클래스, 타입 힌트, docstring, 파일 쓰기, 테스트 하네스를 포함해 125줄과 1,342개의 답변 토큰을 생성했다. Chisle을 사용했을 때 같은 작업은 54줄과 450개의 답변 토큰으로 돌아왔다: 전이 딕셔너리 하나와 이를 강제하는 메서드 하나뿐이었다. 그들은 또한 Pi 벤치마크에서 같은 규칙 세트를 자매 도구인 caveman과 ponytail에 대해서도 점검했는데, Chisle은 기준선 답변 길이의 37%를 측정한 반면 나머지는 56%와 49%였다.
How it went
Pi 벤치마크에서 답변 길이가 수정되지 않은 모델의 약 37%로 줄었고, 에이전트 루프 테스트는 규칙 세트의 유무와 관계없이 동일한 과제를 통과했습니다. 주문 상태 머신 예시는 1,342개에서 450개 답변 토큰으로 줄었으며, 합법적인 전이 조건은 여전히 강제되었습니다. 설치는 의존성 없이 명령어 하나로 이루어지며, 동일한 규칙 세트가 Cursor, Codex, Gemini, Copilot, OpenCode를 포함한 13개 에이전트에 제공됩니다. 이 프로젝트는 패배한 실행 결과도 공개하므로, 벤치마크 수치는 체리피킹이 아닌 감사 가능한 형태입니다.
Worth knowing
헤드라인에 제시된 절감 수치는 소규모 벤치마크(Pi에서의 6개 작업)와 커밋된 트랜스크립트를 기준으로 측정된 것이지, 여러분의 코드베이스를 기준으로 한 것이 아니므로 작업 유형과 언어에 따라 결과가 달라질 수 있습니다. 약 46%의 도구 출력 축소는 도구 결과를 재작성하는 훅에서 비롯됩니다. 디버깅이나 diff를 위해 정확한 원본 출력에 의존한다면, 축소된 형태가 필요한 내용을 여전히 담고 있는지 확인하세요. 또한 간결한 출력은 생성된 코드에서 원했을 수도 있는 설명 주석과 docstring을 누락시킬 수 있으므로 커밋 전에 검토하세요. 설정은 Node/npx 사용 가능 여부와 PostToolUse 훅을 지원하는 Claude Code 버전을 전제로 합니다.
Wiring
repo 루트에서 `npx chisle`를 실행하세요. 그러면 규칙 세트가 에이전트의 instruction 파일(Claude Code용 CLAUDE.md 스타일, 그리고 Pi, Cursor, Codex, Gemini, Copilot, OpenCode, Antigravity 등 나머지에 해당하는 파일)에 기록되고, Claude Code 설정에 PostToolUse hook이 등록됩니다. 이 hook은 실행 후 도구 결과를 가로채서, 과대한 출력을 약 46% 줄이고, 축약된 형태를 컨텍스트 윈도우에 반환하여 이후 요청에서 전체 페이로드에 대해 다시 과금되지 않도록 합니다. 순서가 중요합니다. 먼저 규칙 세트를 설치한 다음, 벤치마킹 전에 hook이 등록되어 실제로 작동하는지 확인하세요. 토큰 절감은 더 짧아진 답변과 트리밍된 읽기 양쪽에서 나오기 때문입니다. 추가되는 의존성은 없으므로, 설정 파일 외에 동기화할 것은 없습니다.
Try it yourself
I can't run commands or install packages in your repo, so I can't execute `npx chisle`, inspect your config files, run the comparison tasks, or produce real token counts, timings, test results, or diffs. Anything I "reported" as measured would be fabricated. Here's what I can do instead: give you a precise procedure and the exact things to check, so you can run it and get trustworthy numbers. ## 1. Install and verify placement Run in the repo root: ```bash npx chisle ``` Then confirm where things landed. Chisle's ruleset and hook typically go into agent-specific config, so check each of these depending on which agent you use: - **Claude Code**: `.claude/settings.json` (hooks) and `CLAUDE.md` or `.claude/rules/` (ruleset) - **Cursor**: `.cursor/rules/` or `.cursorrules`, plus `.cursor/mcp.json` if MCP is involved - **Generic/other**: `.chisle/` directory, `AGENTS.md`, or a project-level config file Verification commands: ```bash git status --porcelain # see exactly which files were created/modified git diff # inspect the ruleset content cat .claude/settings.json # confirm PostToolUse hook entry exists ``` For the hook specifically, confirm: - It's registered under the correct event name (`PostToolUse`), not `PreToolUse`. - The matcher covers the tools you expect (e.g. `Bash`, `Read`, `Edit`). - The command path is absolute or correctly relative and the script is executable. If any of that is wrong, that's a real finding worth fixing before you benchmark. ## 2. Controlled comparison design To get numbers you can trust, control for these: - **Same model, same temperature, same context window** for both arms. - **Fresh session per run** (no carryover context). - **Same starting commit** — `git stash` or a clean worktree per run. - **Repeat each task 3×** and report median, not a single run; LLM output length is noisy. - **Define "tests pass" identically** — same test command, same environment. Suggested task picks from a typical codebase (swap in your actual files): | Task | Type | Success criterion | |---|---|---| | Fix off-by-one in pagination helper | Small bug fix | Target test goes red→green, no other tests break | | Add a `retry` module with backoff | New module | New tests pass, lint clean, public API matches spec | | Extract duplicated validation into shared util | Refactor | Full suite green, no behavior change | For each run record: ``` task, arm (ruleset on/off), run#, answer_tokens (from API usage, not estimated), wall_clock_seconds, tests_pass (bool), notes (any tool-output truncation observed) ``` Get `answer_tokens` from the API response `usage` field (output tokens), not from character counts — that's the only reliable source. ## 3. Diffing the new-module outputs Once you have both outputs saved (e.g. `out/on/retry_module.*` and `out/off/retry_module.*`): ```bash diff -u out/off/retry_module.ts out/on/retry_module.ts ``` When judging whether the terser version lost anything, check specifically for: - **Error handling** — dropped try/catch, missing edge-case branches - **Input validation** — removed guards - **Docstrings/comments** that encode non-obvious intent - **Test coverage** — did the terser arm write fewer tests? - **API surface** — renamed or removed exports Token savings that come from dropping error handling are not savings you want. ## 4. Tool-output trimming damage This is the one I genuinely can't assess without your logs. To check it yourself: - Grep your session logs for truncation markers (e.g. `... [truncated]`, `[output trimmed]`). - For each trimmed event, ask: did the agent's next action depend on the cut content? A quick heuristic — if the agent re-ran the same command or asked for the same file again, the trim likely cost it information. - Compare test-pass rates between arms; a drop in the "on" arm on tasks that require reading large outputs (test logs, build errors) is a signal that trimming hurt. If you paste the actual `git diff` of the config files, the two module outputs, and your run table, I can help you interpret them — including whether the terser diff dropped anything material.