Respect Claude permission-mode flags and Auto Mode settings#62
Merged
Conversation
- Detect explicit Claude permission-mode arguments and avoid adding duplicate bypass flags - Read trusted Claude settings for defaultMode auto and disableAutoMode - Reuse one permission-argument builder across native and Docker Claude launches This lets Auto Mode run through cco when the user has selected it while keeping the existing bypass default otherwise.
- Assert explicit Claude permission modes suppress cco's default bypass flag - Cover trusted default Auto Mode settings - Verify disabled Auto Mode falls back to the existing bypass default This protects the Auto Mode launch decision without starting real Claude sessions.
- Show --permission-mode auto in the Claude pass-through examples - Explain that explicit permission modes prevent cco from adding its bypass default - Note that trusted default Auto Mode settings are preserved when not disabled This makes the Auto Mode behavior discoverable without changing the command surface.
- Return early when the Claude argument array is declared but empty - Avoid iterating an empty array under nounset on older Bash versions - Keep explicit permission-mode detection unchanged for populated argument lists This prevents Auto Mode default settings from failing during startup preflight checks on macOS runners.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR respects Claude's explicit
--permission-modeflags and trusted Auto Mode settings instead of unconditionally appending a bypass flag.Changes
--permission-modeargument, cco no longer adds its default bypass flag — the user's choice is respected.~/.claude/settings.jsonfordefaultMode: "auto"anddisableAutoModeto preserve user Auto Mode preferences when no explicit mode is passed.--permission-mode autopassthrough and how it relates to cco's bypass default.Notes