[FEATURE] Unattended/fail-fast mode for autonomous sessions

Resolved 💬 4 comments Opened Feb 20, 2026 by Kenoubi Closed Feb 24, 2026

Problem

When running Claude Code in an autonomous or semi-attended workflow (background agents, scheduled tasks, long-running operations where the user steps away), the session can hang indefinitely waiting for user input — permission prompts, clarification questions, or other interactive elements.

There's no way to tell Claude Code: "if you need human input, fail immediately instead of blocking."

Proposed Solution

A --fail-fast flag (or equivalent configuration) that changes the behavior when user input would normally be requested:

  • Permission prompts: auto-deny and log, rather than blocking
  • Clarification questions: skip and proceed with best guess, or fail with a clear error
  • Any other interactive prompt: fail with a descriptive error rather than hanging

Optionally, a runtime toggle (/afk or similar) for sessions that start interactive but where the user needs to step away.

Use Cases

  1. Background agents spawned via the Task tool — these already auto-deny permissions but could benefit from a more explicit contract
  2. Scheduled/cron sessions that run without a terminal attached
  3. Long autonomous operations where the user approves the plan upfront and walks away
  4. CI/CD integration where hanging is worse than failing

Related

  • #17108 — Background agents and permission denials (narrower scope, same family)
  • #12447 — OAuth token expiration disrupting autonomous workflows

Current Workaround

The --dangerously-skip-permissions flag addresses the permission subset but is too broad — it grants all permissions rather than failing fast. There's no equivalent for other interactive prompts.

View original on GitHub ↗

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