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
Copy file name to clipboardExpand all lines: CLAUDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ Two backends, selected by `CLAYDE_CLAUDE_BACKEND`:
204
204
- Session resumption: saves `session_id` from JSON output, resumes via `--resume <session_id>`
205
205
- Rate/usage limit detection: text-pattern matching on stdout/stderr
206
206
- No per-token cost tracking (returns `cost_eur=0.0`)
207
-
- Requires: OAuth credentials mounted from host `~/.claude/.credentials.json`(see docker-compose.yml)
207
+
- Requires: a dedicated Claude config dir dir-mounted from the host (`~/clayde-claude` → `/home/clayde/.claude`); use a separate `CLAUDE_CONFIG_DIR=~/clayde-claude claude login`. Mount the directory, not the `.credentials.json`file — token refresh renames the file (new inode) and a single-file mount goes stale. See docker-compose.yml / README.
Copy file name to clipboardExpand all lines: README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,17 +131,32 @@ Uses the Anthropic Python SDK with a tool-use loop. Pay-per-token.
131
131
132
132
Runs the Claude Code CLI as a subprocess. Uses your Claude Pro/Max subscription — no per-token cost.
133
133
134
-
1. On the host machine, log in to the CLI:
134
+
1. On the host machine, create a **dedicated** login for the container in its
135
+
own config directory (kept separate from your personal `~/.claude`):
135
136
```bash
136
-
claude login
137
+
CLAUDE_CONFIG_DIR=~/clayde-claude claude login
137
138
```
138
139
2. Set in `data/config.env`:
139
140
```
140
141
CLAYDE_CLAUDE_BACKEND=cli
141
142
```
142
143
(`CLAYDE_CLAUDE_API_KEY` is not required for the CLI backend.)
143
144
144
-
The `docker-compose.yml` mounts `~/.claude/.credentials.json` from the host directly into the container. Token refreshes, logouts, and account switches on the host are immediately reflected.
145
+
The `docker-compose.yml` mounts the `~/clayde-claude`**directory** into the
146
+
container as its Claude config dir. Two things matter here:
147
+
148
+
-**Mount the directory, not the `.credentials.json` file.** The CLI refreshes
149
+
its short-lived OAuth token by writing a new file and atomically renaming it
150
+
into place — which changes the file's inode. A single-file bind mount is
151
+
pinned to the original inode at container start, so it never sees the new
152
+
token and the container fails with "authentication expired" until you restart
153
+
the stack. A directory mount resolves the path live, so refreshes propagate
154
+
with no restart.
155
+
-**Use a dedicated login, not your personal `~/.claude`.** That directory
156
+
holds your interactive sessions, projects, and history; sharing it exposes
157
+
that state to the container. A separate login also gives the container its own
158
+
OAuth refresh-token lineage, so its token refreshes can't invalidate your
0 commit comments