[BUG] --worktree flag results in downgrade from --dangerously-skip-permissions in the middle of conversations
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When I invoke Claude Code with the --worktree flag and --dangerously-skip-permissions flag, at seemingly random points in the conversation, the --dangerously-skip-permissions is downgraded to accept edits on. This never happens when utilizing Claude Code without --worktree. I have also tried using without --worktree and asking Claude to create a worktree from within the session, and haven't seen this issue (but haven't done this extensively). When using Claude Code normally, --dangerously-skip-permissions is never downgraded.
What Should Happen?
--dangerously-skip-permissions should persist in sessions with the --worktree flag without any degradation
Error Messages/Logs
Steps to Reproduce
- Invoke Claude Code via CLI with the
claude --dangerously-skip-permissions --worktreeflags. - Proceed with coding as normal.
- Watch for degradation of
--dangerously-skip-permissionstoaccept edits on, requiring user approval on every future step.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.84
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗