anthropics / anthropics/claude-code

permissions.defaultMode is ignored by the desktop app - new sessions always start in manual mode

Đang mở
#92,394 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:desktop area:permissions bug platform:windows
Ngôn ngữ chính
Python
Star
145k
Fork
23.1k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

## Summary

`permissions.defaultMode: "auto"` is set at both the user level and the managed policy level, but every new session in the desktop app's Code tab starts in "manual". Switching the mode in the UI works, but only for that one session.

## Environment

- Claude Code 2.1.185 (CLI), app-bundled 2.1.260
- Windows 11
- Desktop app, Code tab

## Configuration (all levels agree on `auto`)

| Level | Value |
|---|---|
| User `~/.claude/settings.json` | `permissions.defaultMode = "auto"` (single occurrence, top-level `permissions`) |
| Managed policy `HKCU\SOFTWARE\Policies\ClaudeCode` | `{"permissions":{"defaultMode":"auto"}}` |
| Project `.claude/settings.json` | no `defaultMode` key |
| Parent directories | no `defaultMode` key |
| `~/.claude.json` project entry | no permission-mode key |

`auto` is a documented value — `claude --help` lists it under `--permission-mode` (`acceptEdits`, `auto`, `bypassPermissions`, `default`, `dontAsk`, `plan`).

## Observation

The app keeps its own per-session permission mode, separate from the settings chain:

```
%APPDATA%\Claude\claude-code-sessions\\\local_.json
-> "permissionMode": "default" | "auto"
```

Across sessions created in the last three days: **7x `auto`, 9x `default`** — i.e. new sessions are not seeded from `permissions.defaultMode`. The value only changes when the mode is switched in the UI, and that change stays confined to the session that wrote it.

I could not find any global default for this in the app: `%APPDATA%\Claude\config.json` holds only locale/theme/OAuth/updater state, and neither Local Storage nor IndexedDB contain a permission-mode key. There is also no `CLAUDE_CODE_*` environment variable for it.

Possibly related (observed in `~/.claude.json`, may or may not be the cause):

- `cachedGrowthBookFeatures.tengu_cowork_chrome_automode_default = false`
- `hasResetAutoModeOptInForDefaultOffer = true`

## Expected

A new session starts in the mode configured by `permissions.defaultMode`, with the managed policy level taking precedence — or, if the desktop surface intentionally manages its own mode, a documented setting for its default.

## Actual

Every new session starts in "manual", regardless of user settings and managed policy. The only reliable workaround is launching from a terminal with `claude --permission-mode auto`.

## Impact

A managed policy that is silently overridden by UI session state is a problem beyond convenience: in a managed environment the policy level is the mechanism used to guarantee a permission posture. If the desktop surface ignores it, the guarantee does not hold — in either direction.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Reproduce the issue in the Windows desktop app's Code tab using the reported user and managed-policy settings, then inspect how new sessions are initialized from the settings chain and session JSON. Compare the resulting permission mode with the CLI behavior. Done means a new desktop session honors permissions.defaultMode, with managed policy precedence, or the desktop default is documented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
desktop, security
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.