Skip to content

feat(claude): Allow for session sends the suggested rule for the session (D-250) - #226

Open
blove wants to merge 5 commits into
mainfrom
blove/claude-session-allow
Open

blove wants to merge 5 commits into
mainfrom
blove/claude-session-allow

Conversation

@blove

@blove blove commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Step 2 of hill climb defect 8, built on #225 (D-248). Until #225 merges, this diff also shows its commits.

What changes

  • A Claude Code tool permission whose permission_suggestions include an allow rule gets allowScope: "session" and allowRule (for example Bash(touch one.txt)), so the card offers "Allow for session".
  • allow_always sends the allow with that rule as updatedPermissions, each re-addressed to destination: "session". Nothing is written to a settings file.
  • A suggested setMode or addDirectories is never sent back: echoing them switched the session to acceptEdits in the recording.
  • The rule is the exact command, so the card draws "Allow for session covers Bash(touch one.txt)" above its buttons, and the CLI's request listing prints the same.
  • A request that suggests no allow rule is unchanged: once or deny, and allow_always is refused.

Verification

docs/verification/2026-11-17-allow-for-session-on-claude-code.md.

  • Live recording on Claude Code 2.1.282: baseline asked 3 of 3; with the rule for the session, the repeated command was not asked and a different one was; no .claude directory written.
  • Opt-in live test through the adapter (ClaudeLiveTests.sessionAllowStopsTheSameAskLive) passed.
  • Lint clean; 525 + 1532 tests pass; docs-index --check passes.

Untested

  • The card on screen, Mac or phone; the installed app.
  • Suggestions for tools other than Bash.
  • A resumed process asking again.
  • No independent review was run.

🤖 Generated with Claude Code

blove and others added 5 commits November 17, 2026 15:54
Adapters write allowScope into a request's payload: session on Codex's
approvals, always on a B4 prompt that allows it, none on Claude Code. An
adapter refuses a wider allow it cannot apply instead of narrowing it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…none

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The card draws its buttons from the request's allowScope: Allow once and
Deny, with Allow for session (Codex) or Always allow (B4) only where the
runtime applies one. A multiSelect question takes several answers. The
CLI's answer hint lists --accept-session only where the request offers it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ion (D-250)

A tool permission whose permission_suggestions include an allow rule offers
"Allow for session" and says what the rule covers. allow_always sends the
allow with that rule as updatedPermissions, destination session; a suggested
mode change or directory is never sent, and no settings file is written.
Recorded and tested live on Claude Code 2.1.282.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@blove
blove changed the base branch from blove/approval-choices to main November 18, 2026 03:12
@blove
blove enabled auto-merge November 18, 2026 03:12

This branch has not been deployed

No deployments
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.

1 participant