Skip to content

Commit c2f4a63

Browse files
committed
set files back to readonly
1 parent 295c839 commit c2f4a63

File tree

4 files changed

+436
-20
lines changed

4 files changed

+436
-20
lines changed

.devcontainer/claude-code/README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,20 @@ These are **read-only** (`ro` flag) to prevent:
3333

3434
### Read-Write Mounts (Authentication & State)
3535
- `~/.claude/.credentials.json` → OAuth access/refresh tokens
36-
- `~/.claude/.claude.json` → Account info, user ID, cached configs
36+
- `~/.claude/.claude.json` → Account info, user ID, workspace setup tracking
3737

38-
These files are **writable** to enable:
39-
- OAuth authentication flow in the container
40-
- Account state sharing between host and container
41-
- Persistent authentication across container rebuilds
42-
- Session continuity (no re-login required)
38+
These files **must be writable** to enable:
39+
- OAuth authentication flow and token refresh
40+
- Workspace setup state tracking (`projectOnboardingSeenCount`)
41+
- Session continuity across container rebuilds
4342

44-
⚠️ **Security Note**: While these files are mounted read-write, they are only accessible by the container user and stored securely with `600` permissions. Only use this feature with trusted repositories.
43+
### Why These Must Be Writable
44+
45+
**`.credentials.json`**: OAuth tokens need to be refreshed periodically. Claude writes updated tokens to this file.
46+
47+
**`.claude.json`**: Claude tracks per-workspace setup state here. The `projectOnboardingSeenCount` field must be writable so Claude doesn't show the setup wizard on every launch.
48+
49+
⚠️ **Security Note**: These files contain sensitive data and are mounted read-write by necessity. They are only accessible by the container user and stored with `600` permissions. Only use this feature with trusted repositories.
4550

4651
## Usage
4752

@@ -222,6 +227,29 @@ The OAuth flow opens a local callback server. In containers, this can behave dif
222227
- Ensure the `.credentials.json` file exists on your host before rebuilding
223228
- Check file permissions: `chmod 600 ~/.claude/.credentials.json`
224229

230+
**Setup wizard runs on every rebuild (theme selection, OAuth):**
231+
232+
This happens because Claude tracks setup completion **per-workspace**, not globally.
233+
234+
**Quick fix:**
235+
```bash
236+
# On your HOST machine:
237+
# Set the onboarding flag for your workspace
238+
jq '.projects["/workspaces/pythontemplate"].projectOnboardingSeenCount = 1' ~/.claude/.claude.json > ~/.claude/.claude.json.tmp
239+
mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json
240+
241+
# Also ensure themeMode is set (if needed)
242+
jq '. + {themeMode: "dark"}' ~/.claude/.claude.json > ~/.claude/.claude.json.tmp
243+
mv ~/.claude/.claude.json.tmp ~/.claude/.claude.json
244+
245+
# Rebuild container
246+
devpod up . --recreate
247+
```
248+
249+
**Root cause:** Claude tracks setup wizard completion per-workspace in `.claude.json` under `.projects["/workspaces/pythontemplate"].projectOnboardingSeenCount`. When this is `0`, the setup wizard runs. Set it to `1` to mark setup as complete.
250+
251+
**For future workspaces:** Replace `/workspaces/pythontemplate` with your actual container workspace path.
252+
225253
## Modifying Configuration
226254

227255
Configuration files (except credentials) are read-only. You **cannot** modify Claude settings from within the container.

0 commit comments

Comments
 (0)