You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add non-interactive auth via CLAUDE_CODE_OAUTH_TOKEN
Bypass the interactive onboarding wizard when CLAUDE_CODE_OAUTH_TOKEN is
set. On container create, post_install.py runs `claude -p` to populate
auth state and sets hasCompletedOnboarding so the TUI starts without the
login wizard.
Workaround for anthropics/claude-code#8938.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,22 @@ cd client-repo-1
114
114
claude # Ready to work
115
115
```
116
116
117
+
## Token-Based Auth (Headless)
118
+
119
+
For non-interactive setups (CI, headless servers, or skipping the login wizard):
120
+
121
+
```bash
122
+
claude setup-token # run on host, one-time
123
+
export CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
124
+
devc rebuild # rebuilds with token
125
+
```
126
+
127
+
The token is forwarded into the container. On first create, `post_install.py` runs a one-shot auth handshake so `claude` starts without the login wizard.
128
+
129
+
This works around Claude Code's interactive onboarding wizard always showing in containers, even with valid credentials ([#8938](https://github.com/anthropics/claude-code/issues/8938)).
130
+
131
+
If you don't set a token, the interactive login flow works as before.
0 commit comments