[BUG] Global --dangerously-skip-permissions before a subcommand is parsed as a prompt, breaking daemon (re)spawn for 'claude agents' after auto-update

Open 💬 2 comments Opened Jul 1, 2026 by muzerk

Summary

When --dangerously-skip-permissions is passed before a subcommand, the
subcommand is not routed — it is swallowed and treated as a prompt, starting
a normal interactive session instead. This also breaks the background daemon's
(re)spawn path: a bypass-permissions claude agents client cannot cold-spawn the
supervisor, so after an auto-update (which shuts the daemon down to reload the new
binary) the agent view is stuck at opening… with:

Couldn't reach the background service (not running) — run 'claude daemon status'

Environment

  • Claude Code: 2.1.197 (regressed since ~2.1.196; 2.1.195 worked)
  • OS: macOS 15 (Darwin 25.5.0), Apple Silicon (arm64)
  • Install: npm global, binary at

/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/bin/claude.exe

Reproduction (parser bug — minimal)

Call the native binary directly (no shell alias involved):

# flag-free → routes correctly, prints daemon status
$ .../bin/claude.exe daemon status
not running
...

# same command with the flag in FRONT → "daemon status" is treated as a PROMPT,
# opening a normal interactive session instead of running the daemon subcommand
$ .../bin/claude.exe --dangerously-skip-permissions daemon status
<starts an interactive Claude session>

Inconsistency: with the flag in front, agents is still recognized, but daemon
is not — only daemon gets swallowed.

Impact on claude agents (the real-world failure)

  1. Auto-updater replaces the binary → the running supervisor logs

binary ... changed — self-restarting for upgrade and shuts down.

  1. Respawn is client-triggered. The user launches claude agents with

--dangerously-skip-permissions (a supported combo).

  1. The agent view propagates the bypass flag into its internal daemon run

spawn in the leading position → the parser bug fires → no daemon, no
control.sock, nothing in daemon.log → sessions hang at opening….

Flag position does not matter: claude agents --dangerously-skip-permissions
(flag after the subcommand) connects fine to an already-running daemon, but still
fails to cold-spawn one. Only a fully flag-free client (claude daemon run /
claude agents with no flag) cold-spawns the supervisor.

Expected

  • A global flag before a subcommand should not turn the subcommand into a prompt.
  • A bypass-permissions client should be able to cold-spawn the background daemon.

Workaround

Ensure a flag-free daemon exists first, then attach the flagged agent view:
claude daemon status || (claude daemon run &) ; claude agents --dangerously-skip-permissions

View original on GitHub ↗

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