[FEATURE] permissionRequestTimeout — auto-deny stuck permission prompts after configurable timeout
Problem
When running Claude Code sessions autonomously (e.g., via --resume in background terminals), a permission prompt can block the session indefinitely if the operator doesn't notice it. I've had sessions stuck waiting for hours on a mundane permission approval because I didn't realize the terminal was blocked.
Current Workarounds
- PermissionRequest hook — fires a notification (Pushover/Todoist), but this is informational-only. The hook cannot deny permissions (#19298 confirmed this). The prompt still blocks forever.
- Pre-approving tools — works for most tools, but some prompts (CLAUDE.md edits, certain MCP tools) have hardcoded guards that bypass the allow list.
--dangerously-skip-permissions— too broad. Grants everything rather than timing out gracefully.
Proposed Solution
Add a permissionRequestTimeout setting (in seconds) to settings.json:
{
"permissionRequestTimeout": 300,
"permissionRequestTimeoutAction": "deny"
}
When a permission prompt has been waiting for permissionRequestTimeout seconds without user input, automatically take permissionRequestTimeoutAction (default: "deny"). Other possible actions: "allow", "abort" (kill the current tool call but continue the session).
Use Case
I run 8+ concurrent Claude Code sessions in background terminals. Each session has a PermissionRequest hook that sends me a push notification when approval is needed. But if I'm away from my desk, asleep, or on my phone, I can't type at the terminal. A 5-minute timeout with auto-deny would let the session recover and try an alternative approach instead of hanging indefinitely.
Related Issues
- #19298 — PermissionRequest hook cannot deny permissions (informational-only)
- #27172 — Unattended/fail-fast mode for autonomous sessions
- #29212 — PermissionRequest hook fires for every tool, not just when blocked
- #692 — Auto-accept system actions (user found session stuck for minutes)
- #34654 — Audio alert when waiting for permission
Session: Trinity (eb50) | Task: 6gF8v3VQVhrfhCgp
This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗