Feature: Expose fast mode state in hooks + programmatic toggle API
Feature Request
Problem
There's no way to programmatically detect or toggle fast mode (/fast) from Claude Code hooks. This prevents building intelligent auto-boost systems that toggle fast mode based on workload conditions.
Current Limitations
- No
fast_modefield in hook data — PostToolUse, UserPromptSubmit, and other hooks receive no indication of whether fast mode is active - No programmatic toggle —
/fastcan only be issued via user input. Hooks cannot inject commands or toggle settings - No env var or settings file — Fast mode state isn't written to
~/.claude/settings.json,settings.local.json, or any readable file - API response has no indicator — The transcript shows
model: claude-opus-4-6in both modes, with no field distinguishing fast vs standard
What We Tried (Workarounds)
- UserPromptSubmit hook to catch
/fastand write a state file — works for tracking but can't auto-toggle - Inferred throughput from transcript timing (tok/s per response) — fragile heuristic
- Windows Terminal sendInput keybinding (
Alt+F→/fast\r) — human-in-the-loop, not automatic
Proposed Solution
Option A (Minimum): Add fast_mode: true/false to all hook event data (PostToolUse, UserPromptSubmit, PreToolUse, etc.)
Option B (Better): Also expose a settings file (e.g., ~/.claude/session_state.json) that hooks can read:
{"fast_mode": true, "model": "claude-opus-4-6", "session_id": "..."}
Option C (Best): Allow hooks to return a fast_mode toggle in their JSON output, similar to how PermissionRequest hooks can return decision:
{"fast_mode": true}
This would enable auto-boost systems that:
- Detect heavy token output (sustained high tok/s) → engage fast mode
- Detect idle/light workload → disengage fast mode (save cost)
- Track fast vs normal throughput for cost optimization analytics
Use Case
Building a JARVIS-style AI operations platform with a statusline HUD. We want the system to intelligently engage boost mode during heavy interactive work and disengage during background/autonomous tasks — optimizing the speed vs 3x cost tradeoff without manual /fast toggling.
Environment
- Claude Code CLI on WSL2
- Opus 4.6
- Extensive hook ecosystem (15+ hooks: cost tracking, security, context management)
- Custom statusline with real-time tok/s speedometer
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗