[Feature Request] Add dynamic thinking control via UserPromptSubmit hook output

Resolved 💬 3 comments Opened Dec 11, 2025 by zlaxz Closed Dec 15, 2025

Bug Description
---
Feature Request: Dynamic Thinking Control via UserPromptSubmit Hooks

Problem

alwaysThinkingEnabled is a global boolean setting that wastes tokens on simple queries that don't require reasoning:

  • "What's the capital of France?" - no thinking needed
  • "Read file.py" - no thinking needed
  • "Design a multi-agent memory architecture" - deep thinking needed

Current state: either ALL queries use thinking (wasteful) or NONE do (limiting).

What We Built

I implemented a thinking gate using DeepSeek-chat that classifies queries:

  • 96.2% accuracy across 13 test scenarios
  • ~$0.001 cost per classification
  • 4 levels: none/minimal/moderate/deep
  • Script: ~/.claude/scripts/thinking_gate.py

The classifier works reliably. The problem: no hook mechanism to act on the classification.

What's Missing

UserPromptSubmit hooks can add context but cannot:

  1. Modify the user's prompt (no modifiedPrompt field)
  2. Control thinking mode (no enableThinking field)
  3. Prepend thinking keywords to trigger extended thinking

Proposed Solution

Option A: Add modifiedPrompt field to UserPromptSubmit hook output
{
"modifiedPrompt": "Think deeply: Design a multi-agent memory architecture"
}
Hook prepends thinking keywords when needed.

Option B: Add thinkingLevel field
{
"thinkingLevel": "deep" # or "none", "minimal", "moderate"
}
Hook directly controls thinking depth per-message.

Value Proposition

  • 50-80% token savings on simple queries (no thinking waste)
  • Cost-optimized thinking - use it when needed, skip when not
  • Already built - classification works, just needs platform support
  • Aligns with cost-conscious users who want control over token usage

Technical Details

  • Classification takes ~500ms using DeepSeek-chat
  • Can run async to avoid blocking
  • Fallback: default to thinking ON if classification fails (safe default)
  • Hook timeout: 5s is sufficient for classification + safety margin

Request: Extend UserPromptSubmit hook output schema to support dynamic thinking control.

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.0.65
  • Feedback ID: 0a382206-794d-4f9a-a75c-61b53d8e06fe

Errors

[{"error":"Error: Request was aborted.\n    at MR.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:860:3939)\n    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)","timestamp":"2025-12-11T19:01:33.536Z"}]

View original on GitHub ↗

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