Skip to content

Fix Claude Code threads losing full access after plan approval - #4628

Merged
SawyerHood merged 3 commits into
get-bb:mainfrom
stefanroex:claude-code-keep-full-access-after-plan
Oct 2, 2026
Merged

SawyerHood merged 3 commits into
get-bb:mainfrom
stefanroex:claude-code-keep-full-access-after-plan

Conversation

@stefanroex

@stefanroex stefanroex commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Human comments

I'm improving how the Claude Code provider follows Claude Code's own permission settings and patterns. Related PRs: #4629, #4630. Each PR stands on its own and can be merged in any order. One more PR is pending: honouring permissions.ask from settings.json in full access mode, which depends on these initial PRs.

What was wrong

In a Full Access thread that starts in plan mode, approving the plan didn't bring Claude Code back to full access. The session wasn't launched with allowDangerouslySkipPermissions, so the switch to bypassPermissions failed and Claude Code stayed in default mode.

Nobody notices yet: in default mode Claude Code asks about each command, but bb approves every full access request itself (which also means permissions.ask is ignored). It matters for the upcoming PR that follows #4630 and respects ask rules in full access too.

What changed

Full access sessions are now always launched with allowDangerouslySkipPermissions, also when they start in plan mode. Root is unchanged, because Claude Code refuses the flag there.

How you verified

  • pnpm exec turbo run typecheck test --filter=bb-plugin-provider-claude-code passes all 350 tests.
  • New test: a full access session that starts in plan mode gets the flag. It fails without the fix.
  • Manually QA'd, together with the follow-up that lets Claude Code's prompts through in full access: after approving a plan in a Full Access thread, commands ran without approval prompts.

AGENT GENERATED

@stefanroex stefanroex changed the title Keep full access after approving a plan in Claude Code threads Fix Claude Code threads losing full access after plan approval Oct 1, 2026
A full access thread that starts in plan mode dropped out of full
access once the plan was approved. Claude Code fell back to its
"default" mode while bb still showed the thread as full access. This
stays hidden today because bb approves every request in full access
threads itself, but it breaks as soon as bb lets Claude Code's own
prompts through in those threads.

Claude Code only lets a session switch into bypassPermissions when it
was launched with allowDangerouslySkipPermissions. bb set that flag
only for sessions that started in bypassPermissions, so the switch
back after plan approval failed and was only logged. The flag now
follows the thread's permission scope, so every full access session
gets it, including ones that start in plan mode. The flag does
nothing while the session stays in plan mode. Root keeps launching
without it, because Claude Code refuses the flag there.
@stefanroex
stefanroex force-pushed the claude-code-keep-full-access-after-plan branch from e87e390 to 6a54dc3 Compare October 1, 2026 18:03
SawyerHood pushed a commit that referenced this pull request Oct 2, 2026
## Human comments

I'm improving how the Claude Code provider follows Claude Code's own
permission settings and patterns. Related PRs: #4628, #4630. Each PR
stands on its own and can be merged in any order. One more PR is
pending: honouring `permissions.ask` from `settings.json` in full access
mode, which depends on these initial PRs.

## What was wrong

In Accept Edits, run `npm --version` and choose "Allow for session".
After that, every Bash command ran without asking, such as `python3 -c
'print(42)'`. bb ignored the rule Claude Code suggests (`Bash(npm
--version)`) and allowed the whole Bash tool instead. This shows most
with the Claude Code sandbox off or unavailable; with it on, few
commands ask in the first place.

## What changed

"Allow for session" now sends back Claude Code's suggested rule, plus
any folders the command needed. It covers that command only, like Claude
Code's own "don't ask again". bb no longer remembers Bash approvals
itself and no longer labels Bash prompts as "Network access". The first
commit is a refactoring without behavior change.

## How you verified

- `pnpm exec turbo run typecheck test
--filter=bb-plugin-provider-claude-code` passes all 352 tests.
- New tests: only the suggested rule is sent back, and a different
command still prompts. The second check fails without the fix.
- Manually QA'd the steps above with the sandbox off: `npm --version`
ran again without a prompt, and `python3 -c 'print(42)'` prompted.

> AGENT GENERATED
# Conflicts:
#	plugins/provider-claude-code/src/bridge/__tests__/sdk-session.test.ts
SawyerHood added a commit that referenced this pull request Oct 2, 2026
…rompt (#4630)

## Human comments

I'm improving how the Claude Code provider follows Claude Code's own
permission settings and patterns. Related PRs: #4628, #4629. Each PR
stands on its own and can be merged in any order. One more PR is
pending: honouring `permissions.ask` from `settings.json` in full access
mode, which depends on these initial PRs.

## What was wrong

Add `"ask": ["Bash(*askprobe*)"]` to a project's `.claude/settings.json`
and ask Claude to run `echo askprobe`: it runs without a prompt.

Claude Code does ask bb about it, but the request carries no details: no
folder, reason or suggested rule. bb treated requests without details as
harmless and approved them itself.

## What changed

bb now shows every approval request from Claude Code to the user. Other
requests always carry details (checked with the Claude Agent SDK across
modes, sandbox on and off), so nothing else starts prompting. Threads
set to never ask now deny these commands. Full access will follow in a
separate PR.

The first commit makes sure this holds: an earlier "Allow for session"
for a folder also approved any later request without details, because
nothing requested counted as covered. Session approvals now only cover
requests that ask for a folder or network access.

## How you verified

- `pnpm exec turbo run typecheck test
--filter=bb-plugin-provider-claude-code` passes all 350 tests.
- New tests for both changes. Each fails without its fix.
- Manually QA'd the steps above: `echo askprobe` prompted, also after an
earlier "Allow for session", and Deny was reported back to Claude.

> AGENT GENERATED

---------

Co-authored-by: SawyerHood <[email protected]>
@SawyerHood
SawyerHood merged commit 94d704e into get-bb:main Oct 2, 2026
25 checks passed
ymichael pushed a commit that referenced this pull request Oct 15, 2026
…4764)

## Human comments

I'm improving how the Claude Code provider follows Claude Code's own
permission settings and patterns. This is the last PR in the series and
builds on #4628 and #4630, which are merged. Related: #4629.

## What was wrong

In a Full Access thread, add `"ask": ["Bash(*askprobe*)"]` to the
project's `.claude/settings.json` and ask Claude to run `echo askprobe`:
it runs without a prompt. Claude Code does ask in its own full access
mode (`bypassPermissions`), as
[documented](https://code.claude.com/docs/en/permission-modes#actions-no-mode-auto-approves),
but bb approved every full access request itself.

## What changed

bb now shows these requests in full access threads too. Nothing else
starts prompting: in `bypassPermissions` Claude Code only asks about ask
rules and PreToolUse hooks that answer "ask". As root, bb keeps
approving requests itself, because Claude Code refuses
`bypassPermissions` there and bb runs those sessions in `default` mode.

Worth noting: an unattended full access thread, such as an automation,
now waits at such a command until someone answers.

## How you verified

- `pnpm exec turbo run typecheck test
--filter=bb-plugin-provider-claude-code` passes all 368 tests.
- New tests: an ask-rule request in a full access thread reaches the
user, which fails without the fix; as root, requests are still approved
without a prompt.
- Manually QA'd in a local dev app: in a Full Access thread that started
in plan mode, after approving the plan, `echo askprobe` prompted and `ls
-la` ran without a prompt.

> AGENT GENERATED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants