Feature request for product/service
Cursor IDE
Describe the request
Current behavior
Cursor already fires postToolUseFailure when a tool fails, times out, or is denied. Official docs (https://cursor.com/docs/hooks.md) document the event input (error_message, failure_type, duration, is_interrupt) but state that no output fields are currently supported. A hook can observe the failure but cannot inject context back into the agent.
Claude Code’s equivalent event (PostToolUseFailure) accepts hookSpecificOutput.additionalContext, so a hook can tell the agent how to recover — for example, credentials expired → log in, then retry the same tool. Cursor’s third-party hooks mapping (https://cursor.com/docs/reference/third-party-hooks.md) maps PreToolUse / PostToolUse / Stop / etc., but does not map Claude’s PostToolUseFailure.
People sometimes look for this as afterPreToolUseFailure; the Cursor-native name is postToolUseFailure.
Proposed behavior
- Accept hook output on
postToolUseFailure, at leastadditionalContext(and/orhookSpecificOutput.additionalContextfor Claude parity), so the next agent turn sees recovery instructions. - Map Claude
PostToolUseFailure→ CursorpostToolUseFailurein third-party hooks, including that output. - Same schema on Cursor IDE and Cursor CLI (
hooks.json).
Why it matters
Without output, failure hooks are observational only. Common recovery flows (expired cloud SSO / CLI auth, a permission the user just granted, a transient timeout) cannot tell the agent “retry now.” Teams that share hook scripts across Claude Code and Cursor have to leave the failure-recovery hook unwired on Cursor.
Environment
- Cursor IDE 3.16.17 (commit 6b2afae0257df2bb5e1835f15165dc2f0de056b0) darwin arm64
- Cursor CLI
agent2026.07.16-899851b - macOS 26.5.2
Related (distinct — not duplicates)
- Cursor CLI hooks — CLI vs IDE hook surface, not this output gap
- Bug: `beforeSubmitPrompt` hook `updated_input` is silently stripped — modified prompt never reaches the model — different hook (
beforeSubmitPrompt) whose output is stripped
Search
Forum search for #feature-requests postToolUseFailure, afterPreToolUseFailure, and additionalContext hooks returned no matching request.
Operating System (if it applies)
MacOS