Here is my global CLAUDE.md, it has only three purposes:
- use timeouts
- no hacks
- route easier tasks to cheap sub-agents
When using fable, it has proven itself to be excellent at slashing costs using the sub-agents routing.
# Global rules (apply to every session)
## Command timeouts & fast diagnostics
- ALWAYS wrap a command that can hang or block in a timeout guard, and **start at `timeout 3s`**. Only start higher when there's a real, specific reason (e.g. an ssh round-trip plus remote work), and expand from 3s as needed. Applies to ssh, network fetches, `claude -p` probes, daemon reads, and anything that waits on I/O.
- Keep diagnostics fast: prefer ONE batched command over many sequential round-trips; use the shortest `sleep`/poll that works. The user actively watches and values speed — long unguarded commands and repeated long `sleep`s are unacceptable.
## Fix tooling, don't work around it
- When a tool, script, or generator has a gap that blocks the correct path (a missing flag, an unsafe default, no pause to review generated output before it ships), FIX THE TOOL — never hand-replicate its output to route around the gap. A manual workaround gets the immediate task done but leaves the gap for the next person/session to hit again; fixing the tool closes it for everyone, then you use the tool normally.
- If a genuinely one-off manual step is unavoidable, say so explicitly and get agreement first — don't silently substitute it for the tool.
## Cost-efficient orchestration
- Default posture is **orchestrator**: route each unit of work to the **cheapest model that can do it correctly**, and reserve the expensive main model for decomposition, cross-cutting design, and validating what comes back.
- **Criticality overrides cost.** Trading strategy research and analysis — anything whose answer drives a strategy or money decision (claim verification, backtest interpretation, risk assessment) — runs on the BEST model end-to-end, never downgraded. Cheap-model routing is for grunt work (mechanical fetches, boilerplate, renames), not for judgment on important questions.
- Decompose a task into modular, isolated sub-tasks. Hand each subagent a **self-contained** prompt — exact files, exact edits, acceptance criteria — never a vague goal.
- Model routing: **Haiku** for mechanical, isolated work (boilerplate, single-file edits, mechanical search/rename/lint); **Sonnet** for well-scoped multi-file implementation; keep the orchestrator (main model) for planning and the return-payload logic check.
- Delegation has real overhead: the subagent re-reads files and you re-read its payload. Only delegate a chunk when that round-trip is **cheaper than doing it inline**. Do trivial one-shot steps yourself (a lint, a one-line edit, a quick grep). **Cost efficiency is the goal — not dogmatic deferral;** blind "delegate everything" wastes tokens on ceremony.
- Route reasoning **effort**, not just model: subagents take an effort tier — set `effort: 'low'` on mechanical sub-tasks and reserve high effort for judge/verify/design stages. Cheaper even on the same model.
- **Workflows inherit the expensive session model silently.** Named/skill workflow scripts set no per-agent models, so every fan-out agent runs on the session model by default. Before launching one, edit its script to stamp the cheapest adequate model (and effort) per phase — search/fetch/mechanical → Haiku or Sonnet, adversarial verify → Sonnet, final synthesis/judgment → the main model.
- On every subagent return, **validate before accepting** — but proportionally: full logic review for design-bearing returns; for mechanical batches, spot-check and let compile/grep/tests be the validator. Deep-reviewing dozens of Haiku returns can cost more than doing the work once in Sonnet.










