Skip to content

fix(cli): add --dangerously-skip-permissions to ClaudeCliProvider#1239

Merged
christso merged 2 commits into
mainfrom
fix/1238-claude-cli-bypass-permissions
May 13, 2026
Merged

fix(cli): add --dangerously-skip-permissions to ClaudeCliProvider#1239
christso merged 2 commits into
mainfrom
fix/1238-claude-cli-bypass-permissions

Conversation

@christso
Copy link
Copy Markdown
Collaborator

Summary

  • ClaudeCliProvider was missing permission bypass flags, causing permission prompts on every tool call during evals
  • Added bypassPermissions option to ClaudeResolvedConfig (optional, defaults to true in buildArgs)
  • When bypassPermissions !== false, appends --dangerously-skip-permissions to the Claude CLI args — matching ClaudeSdkProvider's unconditional permissionMode: 'bypassPermissions'
  • Added bypass_permissions YAML field support in resolveClaudeConfig

Red/Green

Red (before): ClaudeCliProvider.buildArgs() returned ['-p', '--output-format', 'stream-json', '--include-partial-messages', '--verbose'] — no permission bypass flags, causing interactive prompts in evals.

Green (after): buildArgs() now includes --dangerously-skip-permissions by default. Setting bypass_permissions: false in the target YAML omits it.

Test plan

  • ClaudeCliProvider.buildArgs() includes --dangerously-skip-permissions by default
  • ClaudeCliProvider.buildArgs() includes the flag when bypassPermissions: true
  • ClaudeCliProvider.buildArgs() omits the flag when bypassPermissions: false
  • All pre-push hooks pass (build, typecheck, lint, test, validate)

Closes #1238

🤖 Generated with Claude Code

christso and others added 2 commits May 14, 2026 00:04
Evals using `provider: claude` were hitting permission prompts on every
tool call because ClaudeCliProvider never passed permission bypass flags
to the Claude CLI. ClaudeSdkProvider already sets
`permissionMode: 'bypassPermissions'` unconditionally, so this aligns
the two providers.

- Add `bypassPermissions` option to `ClaudeResolvedConfig` (optional,
  defaults to true in buildArgs)
- Append `--dangerously-skip-permissions` to CLI args when
  `bypassPermissions !== false`
- Read `bypass_permissions` from target YAML in `resolveClaudeConfig`
- Add `executable` to test mock config; add three new tests covering
  default, explicit-true, and explicit-false behavior

Closes #1238

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying agentv with  Cloudflare Pages  Cloudflare Pages

Latest commit: 58491d7
Status: ✅  Deploy successful!
Preview URL: https://bc502c35.agentv.pages.dev
Branch Preview URL: https://fix-1238-claude-cli-bypass-p.agentv.pages.dev

View logs

@christso christso merged commit 4885415 into main May 13, 2026
4 checks passed
@christso christso deleted the fix/1238-claude-cli-bypass-permissions branch May 13, 2026 22:22
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.

feat(cli): add permission bypass to ClaudeCliProvider

1 participant