[BUG]

Resolved 💬 4 comments Opened May 8, 2025 by amaruy Closed Jan 3, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 0.2.104 (Claude Code) (Recurring across versions - worse now)
  • Operating System: Ubuntu 22.04
  • Terminal: Iterm2 / VScode

Bug Description

I use a script to run Claude Code on tasks autonomously. these scripts requires him to dangerously skip permissions.
During setup, I make sure to interactively accept to dangerously skip permissions in the same directory.
I give Claude code multiple tasks and run him with:
claude -p --verbose --output-format stream-json --dangerously-skip-permissions @prompt.txt >> transcript.log

After a inconsistent number of task or duration CC disconnects from my account and I get the error:

--- STDERR OUTPUT ---
--dangerously-skip-permissions must be accepted in an interactive session first.

Requiring me to manually reconnect my account and re configure CC.

Steps to Reproduce

  1. Log in to Anthropic API account (on a AWS instance)
  2. Interactively accept --dangerously-skip-permissions within a directory
  3. Run a script that asks thats uses CC to perform tasks (i.e. subprocess.Popen(...))
  4. At some point Claude Code "resets" and you start getting the errors:
--- STDERR OUTPUT ---
--dangerously-skip-permissions must be accepted in an interactive session first.
  1. Manually run claude - Need to log back in

Expected Behavior

Shouldn't disconnect so frequently

Actual Behavior

Disconnects sometimes a few times per hour.

Additional Context

This is happening extremely frequently on 0.2.104

View original on GitHub ↗

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