claudeacp passes --allow-dangerously-skip-permissions whatever the mode: find what brings Claude Code's 'use Bash' instruction #9
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/claudeacp!9
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/claudeacp-5st"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Answer
--allow-dangerously-skip-permissionsis not the cause, so no code changes: this pull request is the README paragraph and changelog entry that record the finding.The "do your work through Bash" instruction follows the permission mode being
bypassPermissions, however the session gets there:--dangerously-skip-permissions,--permission-mode=bypassPermissions, or a switch to the mode over the control channel (what an ACPsession/set_modedoes).How it was found (no model call)
claude 2.1.322, started as claudeacp starts it (
--output-format stream-json --verbose --input-format stream-json --permission-prompt-tool=stdio --model=… --effort=highplus the flags below), withANTHROPIC_BASE_URLon a listener of my own on 127.0.0.1 that wrote each request to a file and answered 400. A throwawayCLAUDE_CONFIG_DIRand an empty working folder, so no user settings or CLAUDE.md. I compared the request bodies (system, messages, and the tools' descriptions) with UUIDs normalized.--permission-mode=dontAsk--permission-mode=dontAsk --allow-dangerously-skip-permissions(what the Operator's sessions ran)--allow-dangerously-skip-permissionsalone--dangerously-skip-permissions--permission-mode=bypassPermissions --allow-dangerously-skip-permissionsUnder bypass two things differ, and nothing else:
The first message gains, ahead of "Today's date is …":
The Bash tool's description loses its line:
The system prompt itself (6039 characters) is the same in all six.
A switch over the control channel. Starting in
dontAskand sendingset_permission_mode bypassPermissionsafter the first turn:--allow-dangerously-skip-permissions: success, and the next request carries text 1 (the Bash tool's description, fixed at start, keeps its line);{"subtype":"error","error":"Cannot set permission mode to bypassPermissions because the session was not launched with --dangerously-skip-permissions","error_code":"bypass_not_launched"}, and no instruction is sent.Wanted item 2
The flag's purpose is the switch above: a client can pick "Bypass permissions" after the session started. Passing it only in bypass mode would stop that (the mode would be refused with
bypass_not_launched) and brings nothing in return, since the flag changes no text. Left as it is.What this means for the five sessions
Their transcripts show the mode
dontAskatsession/new(currentModeId) and no mode change after, so by the table they got neither text 1 nor the removal of line 2: the instruction is not what made them 84% Bash. I did not look for what did (underdontAska tool not allowed by a rule is refused, which would push a model toward whatever is allowed; that is a guess, not checked). Worth its own bead if the Operator wants it chased.Changes
README (a "Bypass permissions" paragraph under Claude's options) and CHANGELOG (Unreleased, Changed). No test: nothing in the code changes, and
claudeagent's options test already pins the flag.go build ./...andgo test ./...pass.Bead: claudeacp-5st
Review of
2bab27b523for claudeacp-5st. Checks of the head: success.Verdict
pass
Findings
SetPermissionModenames claude's refusal code asbypass_disabled, while this pull request records claude 2.1.322 answeringbypass_not_launched, and the new README paragraph names that one. Not blocking here, because the bead says to change no code when the flag is not the cause. A later change could fix the comment, or name both codes.Verified
bypassPermissions, not--allow-dangerously-skip-permissions. Item 2: the flag is not the cause, so the code is unchanged. The PR says what the flag is for (a laterset_permission_mode bypassPermissions, refused withbypass_not_launchedwithout it) and what passing it only in bypass mode would break. Item 3: no code change, so no test. The README paragraph sits under "Claude's options", next to the list of what claudeacp passes, and the changelog has an entry under [Unreleased] / Changed.claudeacp/options.go:63setsAllowBypasswhen euid != 0 orIS_SANDBOXis set.claudeagent/options.go:176turns that into--allow-dangerously-skip-permissions.claudeacp/config.go:78,161offers the bypass mode only when it is allowed.claudeagent/options_test.go:58-59already pins the flag, as the PR says.a911a08) is a fast-forward with no conflicts. On the merged tree, with the city's variables removed:go build ./...,go vet ./...andgo test -race -shuffle=on ./...all pass. The changelog checker, built from mikluko/changelog at 7ec45bb (v1.6.0, the action's pin), givesvalid=true, exit 0. golangci-lint and govulncheck were not run locally: the change is two Markdown files, and the head's CI passed.