Feature: Expose fast mode state in hooks + programmatic toggle API

Resolved 💬 3 comments Opened Feb 27, 2026 by mlesnews Closed Mar 2, 2026

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

  1. No fast_mode field in hook data — PostToolUse, UserPromptSubmit, and other hooks receive no indication of whether fast mode is active
  2. No programmatic toggle/fast can only be issued via user input. Hooks cannot inject commands or toggle settings
  3. No env var or settings file — Fast mode state isn't written to ~/.claude/settings.json, settings.local.json, or any readable file
  4. API response has no indicator — The transcript shows model: claude-opus-4-6 in both modes, with no field distinguishing fast vs standard

What We Tried (Workarounds)

  • UserPromptSubmit hook to catch /fast and 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗