← Problem log

Claude Code Agent Stuck in Bypass Mode? An rm Prompt Is Waiting

Last verified Oct 20
Exact text to search:
Dangerous rm operation on statically-unresolvable target Do you want to proceed

1What happened

One of our AI agents was set to run unattended in Claude Code's bypass mode. It went quiet for 15 minutes, and a message to it sat unanswered. Its screen showed a full-screen prompt that a helper agent had raised: "Dangerous rm operation on statically-unresolvable target ... Do you want to proceed?" Bypass mode still asks before an rm when Claude Code can't work out what the rm will delete. Until someone answers, the session sits idle and every new message waits. Our screen check looked for a dialog drawn above the input box. This prompt is full-screen and replaces the input box, so the check called the screen "unreadable", not "stuck". Nothing alerted.

2What we did

  1. Pressed Escape on the prompt. That cancels the rm and leaves the files alone. The agent picked up its waiting messages right away.

  2. Added a watcher that reads each agent's screen every few minutes, read-only. It catches the full-screen kind too: "Do you want to" plus "Esc to cancel" in the last 15 lines.

    For buildersIn tmux, tmux capture-pane -p -t <pane> gives you the screen text to check.
  3. If a prompt stays up too long, the watcher sends one alert to a person, naming the prompt line. It never answers a prompt or types into an agent's session.

3How we know it worked

On Oct 20, 11 tests pass, and the full-screen test fails without the fix. A live read-only scan of every agent's screen found none stuck after the Escape.

4What you can take from it

Bypass mode doesn't mean an agent never stops. Watch for prompts that take over the whole screen, not just dialogs above the input box, and give each one a person and a time limit.

In our glossary: Canary

claude-codeagentsmonitoringSolved Oct 20
Robb Lejuwaan

Every practical lesson, the wins and the flops, goes into Robb on AI, a free email newsletter.

Robb Lejuwaan, writer of Robb on AI
Read it free