[FEATURE] PostThinking Hook
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Claude Code's hook system has a visibility gap. Currently available hooks:
- UserPromptSubmit: Sees user's raw input before Claude processes it
- PreToolUse: Fires after Claude has already committed to an action
Missing: A hook that fires after Claude has interpreted the request and formed a plan, but before execution begins.
Having insight into Claude intent might be a really beneficial piece of information for the hooks.
Proposed Solution
Add a PostThinking hook that fires once per turn, after Claude's thinking phase completes but before the first tool call.
Hook input:
{
"session_id": "abc-123",
"user_prompt": "help me clean up this authentication code",
"thinking": "The user wants to simplify their auth code. I'll use the simplify skill...",
"planned_tools": ["Read", "Skill"],
"first_tool": {"name": "Read", "input": {"file_path": "/src/auth.ts"}}
}
Hook output capabilities:
- Inject context:
{"additionalContext": "..."} - Block execution:
{"block": true, "message": "..."} - Modify first tool (optional):
{"modifyFirstTool": {...}}
Alternative Solutions
Current workaround: Two-phase flag mechanism
- UserPromptSubmit creates a flag file: .skill-check-pending
- PreToolUse checks flag, parses transcript JSONL to extract thinking, then deletes flag
Priority
Critical - Blocking my work
Feature Category
CLI commands and flags
Use Case Example
- Intelligent skill activation - Match skills based on Claude's plan ("I'll use simplify...") instead of guessing from ambiguous user input. Current approach requires API calls with ~60% confidence; PostThinking enables ~95% confidence from direct intent.
- Dangerous operation prevention - Detect rm -rf, git push --force, or DROP TABLE in thinking and block before execution starts. Currently can only warn after Claude has committed to the action.
- Cost control - Limit expensive operations. If thinking mentions "multiple web searches" or "analyze all files," inject limits before they happen.
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗