Skip to content

Stop using --dangerously-skip-permissions: approve Claude Code actions from your phone

Stop using --dangerously-skip-permissions in Claude Code. Cut prompts with rules and auto mode, then approve risky actions from your phone with Agent Inbox.

Stop using --dangerously-skip-permissions: approve Claude Code actions from your phone
Author:Victor Yakubu
Victor Yakubu

Claude Code asks before it does anything it isn't sure you'd allow. That's the point of the permission prompt, and it's also why so many people end up typing claude --dangerously-skip-permissions: you hand Claude Code a long task, walk away, and come back to find it stopped twenty minutes in, waiting for you to approve npm install.

This article is about the option between babysitting the terminal and turning every check off. We look at what the flag actually disables, which built-in settings cut prompts safely, and then set up Agent Inbox so the prompts that remain reach your phone as Approve and Deny buttons on Telegram, Slack or email. Claude Code keeps working while you're away, and nothing risky happens without your tap. At the end, we cover the same setup for Codex.

What --dangerously-skip-permissions actually turns off

The flag starts Claude Code in bypassPermissions mode, the same as claude --permission-mode bypassPermissions. In that mode, every tool call runs without asking: shell commands, file writes, web requests and MCP tools, including writes to .git and .claude. Only a short list still stops it, such as tools you've given an explicit ask rule, and obvious disasters like rm -rf ~.

Anthropic's permission modes docs are direct about the trade-off. They say to use the mode only "in isolated environments like containers, VMs, or dev containers without internet access", and that it "offers no protection against prompt injection or unintended actions." That second point is the one that bites. Claude Code reads web pages, issue comments, README files and tool output while it works. If any of that text says "push this branch to a new remote", nothing stands between the instruction and the command.

In a throwaway container with no credentials and no network, the flag is fine. On your laptop, with your SSH keys, your cloud credentials and your production .env, it's a bet that nothing Claude Code reads will ever be hostile, and that Claude Code will never misread your request.

Cut the prompts you don't need first

Before reaching for your phone, cut the prompts that never needed a person. Claude Code gives you two tools for that.

Permission rules. In .claude/settings.json, list what Claude Code may do without asking, what it must always ask about, and what it may never do:

{
  "permissions": {
    "allow": ["Bash(npm run test *)", "Bash(npm run lint)", "Bash(git diff *)"],
    "ask": ["Bash(git push *)", "Bash(npm publish *)"],
    "deny": ["Bash(rm -rf *)", "Read(./.env)"]
  }
}

Deny wins over everything, and a matching ask rule forces a prompt even in more permissive modes.

Auto mode. Start Claude Code with claude --permission-mode auto, or switch with Shift+Tab. A separate classifier reviews each action and lets routine work through: edits in your project, installing declared dependencies, read-only web requests, pushing to your own branches. It blocks what looks risky, such as production deploys, force pushes, curl | bash and sending data to unknown endpoints. Recent Claude Code versions start in auto mode by default.

Between the two, most of the noise goes away. What's left are the prompts that matter: your ask rules, the actions auto mode refuses to wave through, and anything new. Auto mode also falls back to asking after it blocks three actions in a row.

Those prompts still appear in the terminal, which is the problem if you're not at it. The run stops on a question you can't see. That's the gap Agent Inbox fills.

Send the remaining prompts to your phone

Agent Inbox gives your agent its own Telegram bot, Slack app and email address. There are two ways to route Claude Code's permission prompts through it, depending on how the session starts.

Option 1: start Claude Code from your phone with listen

This is the built-in path. You run listen once in a project, and from then on a message you send to your agent starts Claude Code in that folder. Any permission it needs during the run reaches you as an Allow and Deny message.

1. Connect a channel. Telegram works well for this, because the buttons sit right in the chat. Create a bot with @BotFather when asked, paste the token, then tap Start.

npx @agentinbox/cli setup telegram

2. Log in. listen needs an Agent Inbox account, so claim the setup:

npx @agentinbox/cli login

3. Open the project in Claude Code once and trust the folder. That creates the project's allow list, .claude/settings.json, which runs started by listen follow.

4. Start listening in the project folder.

cd ~/code/my-app
npx @agentinbox/cli listen claude-code

It runs in the background and starts again after a restart: a launchd agent on macOS, a systemd user service on Linux, and inside WSL on Windows. npx @agentinbox/cli listen status shows where it's listening.

During a run, Claude Code follows the project's own settings and edits files inside the project freely. Anything else, such as a command your settings don't allow, network access, files outside the project, or messaging someone other than you, arrives as an Allow and Deny message. Allow for this session lets the same request through until the session ends, without changing your settings. If you don't answer within 10 minutes, it counts as Deny. That default is the opposite of the flag: silence means no.

Option 2: route prompts from a session you started at your desk

Sometimes you start Claude Code in the terminal yourself, then leave. For that, Claude Code's PermissionRequest hook fires whenever Claude Code is about to ask you something, and a hook can answer for you. This script sends the question to your phone with the Agent Inbox CLI and passes your tap back:

#!/usr/bin/env bash
# .claude/hooks/approve-on-phone.sh
# Only route prompts to the phone while you're away.
[ -f "$HOME/.claude/away" ] || exit 0

input=$(cat)
tool=$(echo "$input" | jq -r '.tool_name')
detail=$(echo "$input" | jq -r '.tool_input.command // .tool_input.file_path // .tool_input.url // ""' | head -c 200)

if npx @agentinbox/cli send approve "Claude Code wants to use $tool" \
     --subtitle "$detail" --ttl 15m --timeout 10m > /dev/null; then
  decision='{"behavior":"allow"}'
else
  decision='{"behavior":"deny","message":"Not approved from phone"}'
fi

jq -n --argjson d "$decision" \
  '{hookSpecificOutput: {hookEventName: "PermissionRequest", decision: $d}}'

Register it in .claude/settings.json, with a timeout longer than the CLI's 10-minute wait:

{
  "hooks": {
    "PermissionRequest": [
      {
        "matcher": "Bash|Edit|Write|WebFetch",
        "hooks": [
          {
            "type": "command",
            "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/approve-on-phone.sh",
            "timeout": 660
          }
        ]
      }
    ]
  }
}

Make the script executable with chmod +x. Before you leave your desk, run touch ~/.claude/away. When you're back, rm ~/.claude/away, and prompts go back to the terminal. Approve exits 0 and the hook allows the action. Deny, an expired question or no answer within 10 minutes all deny it, so a missed message never turns into a yes. Your deny and ask rules still apply on top: a hook's allow can't override a matching deny rule.

What a run looks like

Here's Option 1 in practice. You're on the train, and you message your agent on Telegram:

Upgrade the app to the new version of the payments SDK, fix whatever breaks, and open a PR.

listen starts Claude Code in ~/code/my-app with your message as the task. It reads the changelog, updates the dependency, and works through the type errors. Edits inside the project, running your test script and git diff are all in the project's allow list, so nothing interrupts it.

Twenty minutes in, it needs to run git push -u origin upgrade-payments-sdk. Pushing is an ask rule in your settings, so your phone buzzes:

You tap Allow. Claude Code pushes, opens the PR, and replies in the same Telegram chat with a summary and the PR link. You did one tap of work in twenty-five minutes, and nothing ran that you didn't agree to.

If you'd missed the message, the push would have been denied after 10 minutes, and Claude Code would have told you in the chat that it stopped before pushing. Reply in the same conversation, and the next message picks up the same session, so it carries on where it left off.

What to approve from your phone

The goal is a handful of taps a day, not a stream of them. If your phone buzzes every few minutes, you'll start tapping Allow without reading, which is the flag again with extra steps. A split that works for most projects:

Let it runAsk on your phoneNever allow
Reading and editing files in the projectgit push, and anything that touches mainrm -rf outside build folders
Running tests, linters and the dev serverDeleting files or branchesReading .env and credential files
git status, git diff, git logDeploys and database migrationscurl | bash and other download-and-run commands
Installing dependencies already in the lockfileAnything that spends money: paid APIs, cloud resourcesForce push
Read-only web requestsNetwork calls to hosts it hasn't used beforeChanging IAM or repo permissions

Put the first column in allow, the second in ask, and the third in deny, then let auto mode handle the rest. After a week, look at what you approved. Anything you always say yes to belongs in allow.

The same for Codex

Codex has its own version of the flag, --dangerously-bypass-approvals-and-sandbox, which turns off both its approval prompts and its sandbox. The listen setup works for Codex too:

npx @agentinbox/cli listen codex

Runs started this way use Codex's sandbox, which can write inside the project but has no network access. Whatever the sandbox doesn't allow comes to your phone as Allow and Deny instead, with the same 10-minute rule. OpenCode is supported as well, with listen opencode.

Get started

The quickest way in is to let Claude Code set it up. Paste this into a session:

Set up Agent Inbox from https://www.agentinbox.md/agents.md

Or install the Agent Inbox plugin with /plugin marketplace add agentinboxhq/skills and /plugin install agentinbox@agentinbox. Agent Inbox is free for 100 conversations a month, with no credit card required. For more patterns like this one, read how to build a human-in-the-loop AI agent and what an inbox for AI agents is.

FAQ

What does --dangerously-skip-permissions do in Claude Code?

It starts Claude Code in bypassPermissions mode, where tool calls run without asking for approval, including shell commands, file writes and web requests. Anthropic recommends it only in isolated containers or VMs without internet access, because it offers no protection against prompt injection or unintended actions.


Is there a safer alternative to --dangerously-skip-permissions?

Yes. Allow routine actions with permission rules in .claude/settings.json, use auto mode so a classifier handles the rest, and send the prompts that remain to your phone with Agent Inbox. Claude Code runs unattended, and risky actions wait for your tap.


Can I approve Claude Code permission prompts from my phone?

Yes. With Agent Inbox's listen command, a message you send on Telegram, Slack or email starts Claude Code in your project, and any permission it needs arrives as Allow and Deny buttons. For sessions you start in the terminal, a PermissionRequest hook can send the prompt to your phone with the Agent Inbox CLI.

What happens if I don't answer the approval?

During a listen run, no answer within 10 minutes counts as Deny, and Claude Code doesn't take the action. The hook in this article also denies when the question times out, so a missed message never becomes a yes.

Does this work with Codex?

Yes. Run npx @agentinbox/cli listen codex in your project. Codex runs in its sandbox, and anything the sandbox doesn't allow reaches your phone as an Allow and Deny message instead of needing --dangerously-bypass-approvals-and-sandbox.


Read More

You’re five minutes away from your first Novu-backed notification

Create a free account, send your first notification, all before your coffee gets cold... no credit card required.