Docs
Reference pages for Sprag, the command-line harness for Claude Code and Codex.
Codex: hooks, ratchet rules, model delegation, and a companion panelInstall Sprag for Codex, connect native hooks and AGENTS.md, inspect local token usage, discover recurring work, and track attributed routing estimates with provider prices.
Claude Code statusline: cache hit rate, cache TTL countdown, 5-hour and 7-day rate limitsReference for the Sprag statusline for Claude Code: prompt cache hit rate, cache expiry countdown, context usage, 5-hour and 7-day rate-limit windows, monthly spend, and the warning chips that lead the line when something is wrong.
Why realtime model routing can cost more in Claude CodePrompt caches are kept per model, so switching Claude Code to a cheaper model mid-session starts from a cold cache and re-reads the whole conversation at full price. Sprag delegates to subagents instead and leaves the main session's cache intact.
Delegate repeat Claude Code work to Haiku and Sonnet subagents with route-scansprag route-scan reads your Claude Code session logs after the fact, finds request types an expensive model handled repeatedly, and writes delegation rules that send that work to cheaper subagents. Savings are recorded per run as a ledger, not an estimate.
Claude Code harness: ratchet rules, evidence-gated completion, Plan-Execute-VerifyThe Sprag harness for Claude Code turns repeated failures into rules that load every session, blocks "all done" reports with no evidence attached, and enforces a Plan, Execute, Verify cycle on multi-step work.
Convert pptx, xlsx, pdf, docx and fig to Markdown before Claude Code reads themsprag doc2md converts PowerPoint, Excel, PDF, Word and Figma files to Markdown so Claude Code reads a compact text version instead of a raw attachment. One 510k-token deck became a few thousand tokens.
Claude Code statusline behind LiteLLM and other gatewaysHow the Sprag statusline reads spend, budgets and cache TTL when Claude Code runs through LiteLLM or another API gateway, and why the cache countdown can look frozen.
Install Sprag for Claude Code and CodexChoose the Claude Code or Codex integration, register the appropriate harness and hooks, and verify the setup.
Sprag command referenceEvery sprag command in one page: route-scan, harness, doc2md, handoff, mode, stats and the statusline switches.
What Sprag sends: open source, Pro and EnterprisePlan by plan, what Sprag uploads to its server: nothing on the free CLI, daily numeric totals on Pro, and opt-in masked prompt capture on Enterprise.
Korean writing style gate for Claude Code outputSprag lints Korean text at write time: double passives, translationese, cohesion between sentences.
How to reduce Claude Code token usageCompact and clear at the right time, push exploration into a subagent, convert large documents to Markdown first, and stay inside the prompt cache TTL. Then see how Sprag automates each step.
Claude Code 5-hour and weekly usage limits, explainedClaude Code enforces two independent rolling windows, roughly 5 hours and 7 days, each with its own reset. How to watch both before you hit them and reduce per-turn cost so a window lasts longer.
How to reduce Codex CLI token usageScope sessions, delegate bounded work to a cheaper model through native spawn_agent calls, and convert large documents before they enter context. What Sprag adds for Codex on top of that.
Sprag vs ccusage, claude-usage, and statusline toolsccusage, claude-usage and CCometixLine report what Claude Code already spent. Sprag reports it too, and also writes delegation rules that route repeat work to a cheaper subagent. Where each tool fits, and where they can run together.