{"slug": "claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it", "title": "Claude Code stops on a permission prompt when you are away. How to fix it.", "summary": "Claude Code agents that stall on permission prompts while unattended can be fixed by switching the session to auto mode, where a background classifier reviews shell commands and network requests instead of the user, according to Anthropic's permission-modes documentation. Anthropic's docs state that with Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions, whereas earlier versions defaulted to it only on Pro, Max, and Team plans. The documentation notes two limits: auto mode requires a supported model and can be disabled by an organization via permissions.disableAutoMode, and on Enterprise plans or accounts using the Claude API, Bedrock, Google Cloud's Agent Platform, or Microsoft Foundry, classifier calls count toward token usage.", "body_md": "# Claude Code stops on a permission prompt when you are away. How to fix it.\n\nA Claude Code agent that stalls on a permission prompt while you are away is fixed by changing its permission mode, pre-approving the commands it needs, and routing the few prompts that no mode can auto-approve. The fastest single change is to put the session in auto mode, where a classifier reviews actions instead of you.\n\nUpdated October 20, 2026.\n\nThe rest of this page covers what causes the stall, the four fixes in the order worth trying, the floor that no configuration removes, and what to do when the agent that stalled is one of four agents in four different projects.\n\n## Why a Claude Code agent stalls when nobody is watching\n\nA Claude Code agent stalls because a tool call reached a decision that only a person can make, and Claude Code waits rather than guess. Four different things produce that same frozen screen, and they have different fixes.\n\n| Cause | What the agent is actually doing | Fixed by | \n|---|---|---|\n| A tool call needs approval and no rule covers it | Waiting on a permission prompt | A permission mode, or an allow rule | \n| An action no mode auto-approves | Waiting on a prompt that cannot be pre-approved | Routing the prompt to you | \n| `AskUserQuestion` | Asking you a question, not asking permission | Routing the question to you | \n| The turn ended | Nothing. The agent finished and is idle | Noticing sooner | \n\nThe last row matters more than it looks. An agent that finished twenty minutes ago and an agent blocked on an approval produce the same still terminal, so “my agent is stuck” and “my agent is done and I did not notice” are the same observation until you read the screen.\n\nIn Manual mode, which Claude Code’s config files call `default`, only reads run without asking. File edits, shell commands outside a built-in read-only set, web fetches, and web searches all prompt. A session left in Manual mode on an open-ended task will stop within a few minutes, every time, and that is the mode behaving as designed.\n\n## Fix 1: change the permission mode\n\nChanging the permission mode fixes more stalls than anything else on this page, and on current versions it may already be done for you. Claude Code’s permission modes are:\n\n| Mode | What runs without asking | \n|---|---|\n| `default` (shown as Manual) | Reads only | \n| `acceptEdits` | Reads, file edits, and common filesystem commands such as `mkdir` ,`touch` ,`mv` ,`cp` | \n| `plan` | Reads, plus classifier-approved commands where auto mode is available | \n| `auto` | Everything, with a background classifier checking actions first | \n| `dontAsk` | Pre-approved tools and reads in the working directories. Anything that would prompt is denied | \n| `bypassPermissions` | Everything | \n\n[Anthropic’s permission-modes documentation](https://code.claude.com/docs/en/permission-modes) states that with Claude Code v2.1.283 or later, auto mode is the built-in starting permission mode for interactive terminal and VS Code sessions; on earlier versions it was the starting mode only on Pro, Max, and Team plans. In auto mode a second model, the classifier, reviews shell commands and network requests before they run, instead of you. Reads and working-directory edits skip the classifier entirely.\n\nSwitch the mode of a running session with `Shift+Tab` in the terminal. Set it for a new one with a flag:\n\n```\nclaude --permission-mode auto\n```\n\nMake it the default for every session with `defaultMode` in a [settings file](https://code.claude.com/docs/en/settings):\n\n```\n{\n  \"permissions\": {\n    \"defaultMode\": \"auto\"\n  }\n}\n```\n\nTwo honest limits on auto mode. It needs a supported model, and an organization can turn it off with `permissions.disableAutoMode`. On Enterprise plans and on accounts using the Claude API, Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry, classifier calls count toward token usage, because each check sends part of the transcript plus the pending action.\n\n`bypassPermissions` is the mode people pick after the third stall, and it is the one to be careful with. It skips prompts including writes to protected paths such as `.git` and `.claude`. Anthropic’s documentation says to use it only in isolated environments like containers or VMs. “I want my agent to keep going while I am at lunch” is not that environment.\n\n## Fix 2: pre-approve the specific commands\n\nPre-approving commands with allow rules stops the prompts you can predict, and leaves the ones you cannot. Run `/permissions` to see every rule and which settings file it came from, or write the rules directly:\n\n```\n{\n  \"permissions\": {\n    \"allow\": [\n      \"Bash(npm test)\",\n      \"Bash(git diff *)\",\n      \"Bash(git log *)\",\n      \"Read\",\n      \"Edit\"\n    ]\n  }\n}\n```\n\nThe rule syntax is `Tool` or `Tool(specifier)`. A bare tool name matches every use of that tool. The space before the `*` in `Bash(git diff *)` is load-bearing: without it, `Bash(git diff*)` would also match `git diff-index`.\n\nThe cheapest way to build this list is to stop choosing “Yes” on prompts and start choosing **Yes, and don’t ask again**. For a Bash command or a WebFetch domain, Claude Code saves that rule to `.claude/settings.local.json` at the root of the git repository, and it applies to future sessions anywhere in that repository, including subdirectories and worktrees. File-modification approvals are the exception: they last until the session ends and are not written to the file.\n\nAllow rules are enforced by Claude Code, not by the model. An instruction in your prompt or in `CLAUDE.md` shapes what Claude tries to do and changes nothing about what Claude Code permits.\n\n## Fix 3: run it headless, with the prompts turned off\n\nFor a scheduled or unattended run, headless mode removes the question of who answers a prompt. Pass `-p` with the prompt and name the tools:\n\n```\nclaude -p \"Run the test suite and fix any failures\" \\\n  --allowedTools \"Bash,Read,Edit\"\n```\n\nFor a job where nobody is available at all, `--permission-prompts none` (Claude Code v2.1.259 or later) is the flag that matters. With it, the run consults no permission host and waits on none. Anything that would prompt is denied unless a `PermissionRequest` hook allows it, Claude is told that nobody can approve the request and not to retry it, and the run continues:\n\n```\nclaude -p \"Update the dependency pins and run the tests\" \\\n  --permission-mode auto --permission-prompts none\n```\n\nRead that trade carefully, because it is a real trade. `--permission-prompts none` and `dontAsk` do not get the agent past the decision. They convert an indefinite stall into a denial, so the run finishes instead of hanging, having skipped the thing it wanted to do. For a CI gate that is correct. For “write the migration while I am out,” a denied run that reports success on half the work is worse than a stall you find at 2pm.\n\n## Fix 4: hooks, which push the prompt somewhere you are\n\nHooks are the fix that works when the prompt genuinely needs a human and the human is not at that keyboard. Claude Code fires hook events around permission decisions, and two of them matter here.\n\n- **`PermissionRequest`** can answer the prompt. In modes that ask, a` PermissionRequest` hook decides the request instead of the dialog.\n- **`PreToolUse`** returns a decision in` hookSpecificOutput.permissionDecision` , whose values are`allow` ,`deny` ,`ask` , and`defer` . It can also rewrite the tool input via`updatedInput` before the call runs.\n- **`Notification`** fires when Claude Code sends a notification, and its matcher filters on the notification type. The two types worth wiring are`permission_prompt` and`idle_prompt` .\n\nA `Notification` hook matching `permission_prompt` is the mechanism behind the write-ups people publish about fixing this with hooks. [One developer’s account on dev.to](https://dev.to/mdpp/claude-code-kept-getting-stuck-while-i-was-afk-heres-how-i-fixed-it-with-hooks-k9l) forwards permission requests into Slack to grant or deny them from a phone, and names the constraint that makes the whole exercise necessary: permission prompts are a local thing, and they show up in the terminal rather than anywhere you happen to be.\n\nThat constraint is the honest centre of this problem. A hook can tell you a prompt exists. Answering it still means reaching the session that raised it.\n\n## The floor: prompts that no configuration removes\n\nSome prompts wait for a person no matter which mode or rule you set, and it is worth knowing them so you stop trying to configure them away. Anthropic documents these as the actions no mode auto-approves, including `bypassPermissions`:\n\n- Tools matched by an explicit `ask` rule\n- Connector tools your organization set to `ask`\n- Tools that require user interaction: the built-in `AskUserQuestion` tool, and MCP tools marked`requiresUserInteraction`\n- `rm` and`rmdir` removals targeting a critical path, which no allow rule and no`PreToolUse``\"allow\"` approves\n- The cross-session messaging safeguards\n- Reads outside the working directories while `permissions.blockReadsOutsideWorkingDirectories` is on\n\nOne of these has a thoughtful escape hatch worth knowing. In `auto` and `bypassPermissions` modes, the prompt for a critical-path removal shows a two-minute countdown, and if the countdown runs out Claude Code denies the command and tells Claude what to do instead, so an unattended session keeps working rather than hanging forever.\n\nEverything else on that list waits indefinitely. `AskUserQuestion` is the common one in practice: the agent is not asking for permission, it is asking you which of three approaches to take, and no permission setting answers a question. So the goal is not zero prompts. The goal is that the prompts which remain reach you fast and can be answered from wherever you are.\n\n## Where the single-agent fixes run out\n\nThe four fixes above are sized for one agent in one project, and they stop fitting at three or four agents across different repositories. Three specific things break.\n\n**You cannot pre-approve open-ended work across several repositories.** An allow list is a prediction about which commands a task needs. It holds for a tight task in a familiar repo and it does not hold for “look into why staging is slow.” Multiply that by four projects with four different toolchains and the list stops converging.\n\n**One mode is the wrong granularity.** The settings file that makes a dependency-bump agent productive is the wrong setting for the agent touching auth. A global `auto` or a global `bypassPermissions` applies your loosest judgment to your most sensitive repository.\n\n**A notification that does not say which agent is not much better than silence.** With one session, “something needs permission” is a complete message. With five, the missing half of the message is which project, which session, and what it wants to run. You get the alert, then do the tab-hunting anyway, which is [the tab-hunting problem](https://crystl.dev/blog/tab-hunting-approval/) with an extra step.\n\nAt that point the problem has changed shape. It is no longer “stop the prompts.” It is routing: every waiting agent in one list, each prompt attributed to its project and session, answerable without finding the terminal it came from.\n\n## How crystl handles the prompts that still wait\n\n[crystl](https://crystl.dev/) is a macOS terminal built for the multi-project case, and it treats the approval as something to route rather than something to eliminate. Three parts do the work.\n\n**Auto-approval is set per project, not globally.** crystl intercepts the approval request and applies that project’s [auto-approval mode](https://crystl.dev/docs/approval-modes/): **off** (everything waits), **in gem** (reads anything, changes only inside this project’s tree, safe git only, asks for the rest), or **all**. One sentence is the whole contract for the middle mode, and it is the one most work runs under. The setting lives per gem, so the dependency-bump project and the auth project do not share a judgment.\n\nA permission mode declared inside a repository may narrow what crystl auto-approves and may never widen it. A `.claude/agents/*.md` file that declares `permissionMode: bypassPermissions` grants nothing extra under **in gem**. That matters because anyone who can write that file, an agent with write access included, would otherwise have unattended command execution.\n\n**A waiting prompt is attributed and reachable.** A pending approval surfaces as a floating [card](https://crystl.dev/docs/notifications/) carrying the tool name, the working directory, Allow and Deny buttons, and a session-colored glow that says which session asked. When several queue up, an **Allow All** bar appears. Answer from the keyboard with `Cmd+Return` to allow or `Cmd+Esc` to deny, scoped to the project in front of you so a pending approval in another project cannot be answered by accident. A card for a session already on your screen is withheld, because the terminal is already the notification.\n\nThe project tiles in the [crystal rail](https://crystl.dev/docs/crystal-rail/) carry a red badge counting what needs a human, and the badge heats up as its oldest waiting item ages, so a prompt that has sat for ten minutes stops looking like one that arrived ten seconds ago.\n\n**An agent can be asked, in one command, who is waiting.** `crystl pending` lists pending approvals, `crystl shards --all` flags a parked session as `⏸ awaiting input` across every project in one call, and `crystl wait pending --timeout 60` blocks until the next one arrives rather than polling. Those three are free on every tier. Answering from the CLI, `crystl approve` and `crystl deny`, is a [Guild](https://crystl.dev/pricing/) control command; without it you click Allow or Deny on the card.\n\nFor the case in the title, where you are not at the computer at all, the [iPhone app](https://crystl.dev/docs/mobile-app/) pairs to your Mac and opens on the agents that are waiting on you, so an approval can be answered from a phone. Same Wi-Fi is free; connecting from outside your network routes through an encrypted relay and is a Guild feature.\n\nThree limits worth stating plainly. crystl is macOS only. The depth of approval surfacing varies by agent: it is deepest for Claude Code, partial for Codex, and other CLI agents are supervised at the terminal level. And crystl does not remove the floor described above, because nothing does. `AskUserQuestion` still needs an answer. It changes how fast you find out and how far you have to go to give it.\n\n## The short version\n\n- **One agent, familiar repo:** auto mode plus a handful of allow rules. Most of this problem disappears.\n- **A scheduled or CI run:**`claude -p` with`--allowedTools` , and`--permission-prompts none` so a prompt becomes a denial instead of a hang. Accept that the run may finish having skipped something.\n- **Fully unattended and permissive:**`bypassPermissions` inside a container or VM, never on your working machine.\n- **A prompt that genuinely needs you:** a`PermissionRequest` hook to answer it programmatically, or a`Notification` hook matching`permission_prompt` to push it somewhere you are.\n- **Several agents across several projects:** the binding constraint is routing, not prompt elimination. Per-project modes, attributed cards, and one list of who is waiting.\n\nRelated reading: [monitoring several agents at once](https://crystl.dev/blog/monitor-multiple-agents/), [the tmux setup people build for parallel agents](https://crystl.dev/blog/tmux-setup-for-parallel-agents/) and why a terminal multiplexer cannot tell a blocked agent from a thinking one, and [what a Claude Code GUI should actually do](https://crystl.dev/blog/what-a-claude-code-gui-should-do/).\n\ncrystl is free. Sign up at [crystl.dev/login](https://crystl.dev/login/).", "url": "https://wpnews.pro/news/claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it", "canonical_source": "https://crystl.dev/blog/claude-code-stuck-on-permission-prompt-afk/", "published_at": "2026-10-20 00:00:00+00:00", "updated_at": "2026-10-21 23:11:14.210314+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["Anthropic", "Claude Code", "VS Code", "Claude API", "Amazon Bedrock", "Google Cloud", "Microsoft Foundry"], "also_reported_by": [], "takeaway": "Switching a Claude Code session to auto mode (claude --permission-mode auto, or defaultMode in settings) lets a background classifier approve shell commands and network requests, but classifier calls count toward token usage on Enterprise plans and on accounts using the Claude API, Bedrock, Google C", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it", "markdown": "https://wpnews.pro/news/claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it.md", "text": "https://wpnews.pro/news/claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it.txt", "jsonld": "https://wpnews.pro/news/claude-code-stops-on-a-permission-prompt-when-you-are-away-how-to-fix-it.jsonld"}}