anthropics / anthropics/claude-code

defaultMode: bypassPermissions in .claude/settings.local.json silently ignored, missing from Shift+Tab cycle

Offen
#91,296 4 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:permissions bug has repro platform:macos
Vorherrschende Sprache
Python
Sterne
145k
Forks
23.1k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

### Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code

### What's Wrong?
`permissions.defaultMode: "bypassPermissions"` set in a project's `.claude/settings.local.json` is silently ignored — bypass permissions mode never appears in the `Shift+Tab` mode cycle, and the session starts in a different mode entirely. The CLI flags (`--permission-mode bypassPermissions`, `--dangerously-skip-permissions`) work correctly as a workaround, which suggests this is specifically a settings-file resolution bug rather than bypass mode being blocked outright.

### Environment
- Claude Code version: 2.1.257
- Interface: CLI (terminal), macOS
- Plan: Claude Max (personal account, not Team/Enterprise — confirmed no managed-settings.json present, `/Library/Application Support/ClaudeCode/managed-settings.json` is empty)

### Steps to Reproduce
1. Set `"permissions": {"defaultMode": "auto"}` in `~/.claude/settings.json` (user-level)
2. In a project directory, set `"permissions": {"defaultMode": "bypassPermissions"}` in `.claude/settings.local.json`
3. Run `claude` with no flags/args in that project directory
4. Press `Shift+Tab` to cycle permission modes

### Expected Behavior
Per docs (https://code.claude.com/docs/en/permission-modes#which-mode-a-session-starts-in and #switch-permission-modes):
- Project-local settings (`.claude/settings.local.json`) should take precedence over user settings (`~/.claude/settings.json`)
- A `defaultMode` value other than `"auto"` should apply "from any settings file"
- `bypassPermissions` should appear in the `Shift+Tab` cycle since `permissions.defaultMode: "bypassPermissions"` is set

Session should start in `bypassPermissions` mode, with it available in the cycle.

### Actual Behavior
Only `default` (manual), `acceptEdits`, `plan`, and `auto` appear in the `Shift+Tab` cycle. `bypassPermissions` is completely absent, despite being set in the higher-precedence project-local settings file.

`/status` confirms all three setting sources are being read ("Setting sources: User settings, Shared project settings, Project local settings"), so the file is being loaded — the `bypassPermissions` value within it just isn't taking effect for mode-cycle purposes.

### Workaround Confirmed
Both of the following work correctly and restore `bypassPermissions` to the cycle:
```
claude --permission-mode bypassPermissions
claude --dangerously-skip-permissions
```
This isolates the bug to settings-file resolution specifically, not bypass mode being disabled or blocked for the account.

### Relevant Config
`~/.claude/settings.json` (user-level, conflicting defaultMode):
```json
{
"permissions": {
"defaultMode": "auto",
...
}
}
```

`.claude/settings.local.json` (project-local, not taking effect):
```json
{
"permissions": {
"defaultMode": "bypassPermissions",
...
}
}
```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduce with a user ~/.claude/settings.json defaultMode of auto and a project .claude/settings.local.json defaultMode of bypassPermissions, then run claude and use Shift+Tab. Start by tracing settings-file precedence and the permission-mode cycle logic. Done means project-local bypassPermissions starts the session in that mode and appears in the Shift+Tab cycle, while the existing CLI flag workarounds still behave correctly.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, developer-experience, security
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
Ein halber Tag
Aktivitätsstatus
Aktiv
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
58/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.