anthropics / anthropics/claude-code
defaultMode: bypassPermissions in .claude/settings.local.json silently ignored, missing from Shift+Tab cycle
- 主要言語
- Python
- スター
- 145k
- フォーク
- 23.1k
- PR マージ指標
- PR 指標を取得中
説明
### 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",
...
}
}
```
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- cli, developer-experience, security
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 半日
- 活発さ
- 活発
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 58/100