anthropics / anthropics/claude-code

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

Ouverte
#91,296 4 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
area:permissions bug has repro platform:macos
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

### 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",
...
}
}
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
cli, developer-experience, security
Type d'issue
Bug
Difficulté
3/5
Temps estimé
Une demi-journée
Activité
Active
Clarté
Clairement spécifiée
Accessibilité débutants
58/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.