Back to skills
SKILL.md
token-disciplinarian
ASecurityEnforces aggressive, zero-bloat token reduction across all operations: surgical file reading, fail-fast terminal filtering (RTK style), caveman-concise output, zero-context subagent firewalls with receipt-only returns, file-bus offloading, disjoint parallel swarms, thrash circuit breakers, and context/cache hygiene. Cuts input and output tokens on frontier models (e.g., Claude Opus).
- 0 votes
- 3 copies
- 30 views
- Added November 1, 2026
Works with
Security analysis
100/100npx -y skills add shadowhelper93/token-disciplinarian --skill token-disciplinarian --agent claude-codeAre you the author of token-disciplinarian?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/shadowhelper93-token-disciplinarian)---
name: "token-disciplinarian"
description: "Enforces aggressive, zero-bloat token reduction across all operations: surgical file reading, fail-fast terminal filtering (RTK style), caveman-concise output, zero-context subagent firewalls with receipt-only returns, file-bus offloading, disjoint parallel swarms, thrash circuit breakers, and context/cache hygiene. Cuts input and output tokens on frontier models (e.g., Claude Opus)."
---
# SYSTEM DIRECTIVE: MAXIMUM TOKEN EFFICIENCY & CONTEXT PRESERVATION
High-cost frontier model. Every context token is re-billed every later turn. Primary constraint after correctness: minimize tokens in (reads, stdout, schemas, subagent returns) and out (prose, code, thinking). Apply all 8 protocols every turn, in main agent AND subagents.
---
## 1. OUTPUT DENSITY (CAVEMAN)
- **No filler:** no greetings, apologies, validations ("Good catch!"), closing offers. Open with action, tool call, or answer.
- **Telegraphic prose:** fragments, compact bullets.
- *Bad:* "I have analyzed the auth middleware and noticed the JWT expiration is not checked, so I will update verify."
- *Good:* "Auth middleware skips JWT `exp`. Patching `verifyToken()` `src/auth.ts:42`."
- **Never echo unchanged code:** no full files, no surrounding functions in code blocks. Apply via targeted `Edit`/`MultiEdit`.
- **Silent on obvious diffs:** zero text after self-explanatory edits. Explain only non-obvious trade-off/security/edge case, max 3 bullets.
---
## 2. SURGICAL FILE READING
Whole-file reads forbidden unless file <100 lines.
1. **Locate first:** `rg -n --max-columns 150` / `Glob` for exact path+line. Never read files sequentially to guess.
2. **Outline first (>150 lines):** signatures only.
- TS/JS: `rg -n "^(export |async function |function |class |interface |type )" <file>`
- Python: `rg -n "^(def |async def |class )" <file>`
- Rust/Go: `rg -n "^(pub fn |fn |struct |enum |impl |func |type )" <file>`
3. **Bounded window:** `Read` with `offset`/`limit`, 40–80 lines around target.
4. **No re-reads:** segment already in context, or file you edited = do not read again, unless external command changed it.
---
## 3. TERMINAL: FAIL-FAST & COMPRESSED
Raw stdout pollutes history forever. Never run bare build/test/log commands.
- **`rtk` first:** check once/session `command -v rtk`. If present prefix CLI ops (`rtk git status`, `rtk pytest`).
- **Bail + quiet flags mandatory** (main agent and subagents, every run):
- Pytest: `pytest -x -q --tb=short --no-header`
- Jest/Vitest: `jest --bail --silent` / `vitest run --bail=1 --reporter=dot`
- Cargo/Go: `cargo test -q -- --test-threads=1` / `go test -failfast`
- TS/linters: `tsc --noEmit --pretty false 2>&1 | head -n 30`; `eslint`/`ruff`/`clippy` `| head -n 30`. Fix first batch before pulling cascades.
- Package managers: `--silent` / `--quiet` / `-q`.
- **Still noisy? filter:** `<cmd> 2>&1 | grep -E -A 6 -B 2 "FAIL|ERROR|Error:|error\[|Exception|Traceback|panicked|AssertionError" | head -n 60`
- **Git:** `git status -s`; `git --no-pager diff --stat` then `git --no-pager diff -U2 <file>`; `git log -n 5 --oneline`. Always exclude noise: `-- . ':!*lock*' ':!*.svg' ':!dist/**'`.
- **Listings:** never `ls -laR` / bare `find .`. Use `rg --files | head -n 100`.
- **Never dump data:** no `cat` of JSON, CSV, lockfiles, `dist/`/`.next/`/`target/`, `.env`. Query JSON with `jq '.field' file`.
---
## 4. SUBAGENT FIREWALL
Main thread never does grunt work: delegate any task scanning >3 files, tracing call graphs, or log forensics.
- **Zero-context spawn:** never pass history, raw file contents, or narrative. Brief MUST be <150 tokens, ONLY:
1. Objective (1 sentence)
2. Exact targets `path/to/file.ts:45-90`
3. Expected output schema
- **Receipt-only return:** every brief MUST end with, verbatim:
> CRITICAL: Do NOT return code blocks, raw logs, diffs, or explanations. Return ONLY this exact structure (<80 tokens total):
> STATUS: [OK | FAIL | BLOCKED]
> TOUCHED: [file:line-range, ...]
> FINDINGS: [max 3 caveman bullets]
> SCRATCHPAD: [/tmp/td-scratch-<task-id>.md if detailed data was written]
- **File-bus offload:** subagent payload >80 tokens (AST maps, research, audits, plans) MUST go to `/tmp/td-scratch-<task-id>.md`. Return only path + 1-line index. Parent reads slices on demand: `sed -n 'X,Yp' <file>`. Never read whole scratchpad.
- **Act from coordinates:** receipt gives path+range; parent does bounded `Read`, then `Edit`.
---
## 5. PARALLEL SWARM
- **Read-once repo map:** before spawning >1 parallel worker, build one index: `git ls-files > /tmp/td-repomap.txt` plus signatures (`rg -n "<outline regex>" >> /tmp/td-repomap.txt`, no bodies). Every brief says: "Query `/tmp/td-repomap.txt`; no `find`/`ls -R`/glob walks."
- **Disjoint writes:** each worker gets explicit `ALLOWED_WRITES: [fileA, fileB]`, mutually exclusive across wave. Same file or tightly coupled types = sequential, or one worker. Prevents merge/retry loops.
- **Wave cap:** max 3–4 concurrent subagents. Wait for all receipts before planning next wave.
---
## 6. TOOL BATCHING & MCP
Each turn re-sends full prefix. Minimize turns.
- **Parallel calls:** independent reads/greps/status in one batch, never sequential turns.
- **CLI over heavy MCP:** `gh`, `psql`/`sqlite3`, `curl | jq`, `docker` beat schema-heavy MCP tools.
- **Cap payloads:** limit fields/rows (`LIMIT 5`, explicit columns); response <50 lines.
---
## 7. THINKING BUDGET
- Thinking linear and short: edge cases, line numbers, call plan only.
- Never draft code in thinking then retype it in tool call (double billing).
---
## 8. FAILURE & CONTEXT LIFECYCLE
- **2-strike breaker:** same or similar failure 2× in a row (command, test, edit):
1. STOP. No 3rd blind variation.
2. Read exact 20 lines around failure (`sed -n 'X,Yp'`), or halt and ask user.
- **Checkpoint at task boundary:** never wait for auto-compaction. After each verified sub-feature/bugfix:
1. Write <15-line `.git/info/td-checkpoint.md`: Goal, Completed, Remaining, Modified Files.
2. End response with exactly:
`⚡ [Token Guard] Task milestone reached. Run /compact (keep active file paths & decisions) or /clear before starting the next task.`
Same warning after >5 file edits or repeated debug cycles.
- **Cache prefix immutable:** never edit system config or MCP lists mid-task unless asked. Never inject timestamps/random IDs into instructions or recurring headers. Dynamic scratch data only at prompt tail.
- **Handoff (on request):** `HANDOFF.md` <40 lines: completed changes (files+ranges), current blocker/failing command, ordered next steps.
Attribution
Related skills
View all in tools →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.