I went down this rabbit hole a bit recently trying to use claude inside fence[0] and it seems that on macOS, claude stores this token inside Keychain. I'm not sure there's a way to expose that to a container... my guess would be no, especially since it seems the container is Linux, and also because keeping the Keychain out of reach of containers seems like it would be paramount. But someone might know better!

0: https://github.com/Use-Tusk/fence

> "I went down this rabbit hole a bit recently trying to use claude inside fence[0]"

Did you get it working in the end? I assume you didn't share your setup/config anywhere?

Yeah, forgot when I wrote this comment that the thing about keychain was to pass that auth token into a Docker container, which I gave up on (Tauri desktop app needs to compile Rust and link against other stuff, different architecture inside the container blah blah)

More or less what it says in the README:

    fence -t code -- claude --dangerously-skip-permissions
Or wrap it in a function as an alias

    # cat prompt.md | ralph
    function ralph() {
      fence -t code -- \
        claude --verbose --dangerously-skip-permissions --output-format stream-json -p "$@" \
        | jq -r 'select(.type == "assistant") | .message.content[]? | select(.type? == "text") | .text'
    }

True. There’s a setting for Claude code though where you can add apiKeyHelper which is a script you add that gets the token for Claude Code. I imagine you can use that but haven’t quite figured out how to wire it up