Preflight Checklist
What's Wrong?
(bug #1414 was closed due to inactivity but core workflow issue remains. this is an extension of that with workflow description)
To get the most out of claude I run in a container with --dangerously-skip-permissions. This lets me leverage the full power of the agent while protecting my development machine. To do this I create a container with needed dev cli tools and mount in claude config files from my home directory (code for reference gh:seekayel/yolo
My base machine is macOS and the container is Ubuntu.
When I login to claude on my mac my credentials are stored into my keychain and the credentials file in $HOME gets deleted.
I have tried to reading my credentials out of my keychain before launching the container with security find-generic-password -s "Claude Code-credentials" -w > $HOME/.claude/credentials.json but the containerized claude --dangerously-skip-permissions still isn't finding (or honoring?) the $HOME/.claude/credentials.json this means I have to login each time.
This seems like a use case that is intended to be supported given the reference implementation: https://github.com/anthropics/claude-code/tree/main/.devcontainer but with CLI only setup.
What Should Happen?
claude should provide a way to do one of the following:
- keep
credentials.json on disk aka don't shuffle into macOS keychain
- write temporary
credentials.json to disk that can be used in a docker (or devcontainer?)
- not require login each time?
Error Messages/Logs
Steps to Reproduce
- write macOS keychain credentials back to file:
security find-generic-password -s "Claude Code-credentials" -w > "$HOME/.claude/credentials.json"
- Build container
docker build -t repo-credentials -f - . <<EOF
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=UTC
RUN apt-get update && apt-get install -y nodejs npm
RUN npm install -g @anthropic-ai/claude-code
EOF
-
Run container
docker run -it --rm --name repo-credentials -v "$HOME/.claude:/root/.claude" repo-credentials
-
Verify credentials file exists and is mounted
cat /root/.claude/credentials.json
-
See claude not pickup credentials
claude
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
2.0.24 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response
Preflight Checklist
What's Wrong?
(bug #1414 was closed due to inactivity but core workflow issue remains. this is an extension of that with workflow description)
To get the most out of
claudeI run in a container with--dangerously-skip-permissions. This lets me leverage the full power of the agent while protecting my development machine. To do this I create a container with needed dev cli tools and mount inclaudeconfig files from my home directory (code for reference gh:seekayel/yoloMy base machine is macOS and the container is Ubuntu.
When I login to
claudeon my mac my credentials are stored into my keychain and the credentials file in$HOMEgets deleted.I have tried to reading my credentials out of my keychain before launching the container with
security find-generic-password -s "Claude Code-credentials" -w > $HOME/.claude/credentials.jsonbut the containerizedclaude --dangerously-skip-permissionsstill isn't finding (or honoring?) the$HOME/.claude/credentials.jsonthis means I have to login each time.This seems like a use case that is intended to be supported given the reference implementation: https://github.com/anthropics/claude-code/tree/main/.devcontainer but with CLI only setup.
What Should Happen?
claudeshould provide a way to do one of the following:credentials.jsonon disk aka don't shuffle into macOS keychaincredentials.jsonto disk that can be used in a docker (or devcontainer?)Error Messages/Logs
Steps to Reproduce
security find-generic-password -s "Claude Code-credentials" -w > "$HOME/.claude/credentials.json"Run container
docker run -it --rm --name repo-credentials -v "$HOME/.claude:/root/.claude" repo-credentialsVerify credentials file exists and is mounted
cat /root/.claude/credentials.jsonSee
claudenot pickup credentialsclaudeClaude Model
None
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
2.0.24 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
No response