Overview
| Credential | Method | Default | Config Key |
|---|---|---|---|
| SSH agent | Socket bridge (muxrpc) | On | security.git_credentials.forward_ssh |
| GPG agent | Socket bridge (muxrpc) | On | security.git_credentials.forward_gpg |
| Git HTTPS | Host proxy (HTTP) | On | security.git_credentials.forward_https |
.gitconfig | Bind mount (read-only) | On | security.git_credentials.copy_git_config |
| Claude Code auth | Volume injection | On | agent.claude_code.use_host_auth |
SSH Agent Forwarding
SSH agent forwarding lets the agent use your host SSH keys for Git operations, without exposing the private keys inside the container.SSH agent forwarding handles the authentication side (your keys). But the firewall must also allow SSH traffic to your Git host. By default, no SSH destinations are allowed. You need an explicit rule:The
clawker project init template includes this rule for GitHub. See the Firewall guide for more examples.- When a container starts, Clawker spawns a socket bridge daemon on the host
- The daemon uses
docker execto establish a muxrpc connection with a socket server inside the container - The container-side server creates a Unix socket at
~/.ssh/agent.sock SSH_AUTH_SOCKis set automatically inside the container- Git SSH operations (
git clone git@github.com:...) use the forwarded agent transparently
GPG Agent Forwarding
GPG forwarding lets the agent sign commits with your host GPG key. How it works:- The same socket bridge daemon handles GPG forwarding alongside SSH
- A socket is created at
~/.gnupg/S.gpg-agentinside the container - Your GPG public key is exchanged via the muxrpc protocol
- The container’s
gpg.confis configured withno-autostartto prevent a local GPG agent from conflicting
Git HTTPS Credential Forwarding
HTTPS credential forwarding lets the agent authenticate with Git remotes over HTTPS using your host’s credential store (e.g., macOS Keychain, Windows Credential Manager). How it works:- The host proxy daemon runs on your machine (default port 18374)
- Inside the container, a
git-credential-clawkerhelper is configured - When Git needs HTTPS credentials, the helper sends a request to the host proxy
- The host proxy queries your host’s native
git credential fillcommand - Credentials are returned to the container without being stored there
- The host proxy must be running (
security.enable_host_proxy: true) forward_httpsdefaults to follow theenable_host_proxysetting
Setting
forward_https: true has no effect if enable_host_proxy is false. HTTPS credential forwarding requires the host proxy.Git Config Copying
By default, Clawker copies your host~/.gitconfig into the container so Git operations use your name, email, aliases, and other settings.
Important: The credential.helper lines are filtered out during copying. This forces the container to use Clawker’s forwarded credential helpers instead of trying to access a host-side credential store that doesn’t exist inside the container.
Disable:
Claude Code Authentication
By default, Clawker forwards your Claude Code authentication into the container so the agent is pre-authenticated on startup. How it works:- During container creation, Clawker looks for credentials in this order:
- OS keyring (macOS Keychain, etc.)
- File fallback (
~/.claude/.credentials.json)
- Credentials are injected into the container’s config volume
- Claude Code starts pre-authenticated
Which containers are actually exposed — and it’s at most once each. A collision requires a refresh, and a refresh only happens once the access token expires. A container that lives shorter than the access-token lifetime never refreshes: it uses the inherited (still-valid) access token and exits, so it never collides. The default is a clean win for these ephemeral and short-lived containers — zero-touch auth, no downside.Only long-lived containers — ones that outlive the inherited access token and must refresh — can hit the stale-token
/login, and only once: that /login mints the container its own independent credential (its own family), after which it is fully decoupled from the host and never collides again. So this is a one-time event per long-lived container, not recurring churn. If you want a long-lived container to skip even that single prompt, set use_host_auth: false and /login once up front — it starts on its own family from the beginning.Config Strategy
Theconfig.strategy setting controls how Claude Code’s configuration is initialized:
copy(default) — Copies your host~/.claude/settings (plugins, preferences, MCP config) into the containerfresh— Starts with a clean Claude Code configuration
Full Configuration Example
Troubleshooting
SSH: “Permission denied (publickey)”
- Verify your SSH agent is running on the host:
ssh-add -l - Check that
forward_sshis enabled - Try restarting the container — the socket bridge daemon reconnects automatically
GPG: “No secret key” when signing commits
- Verify your GPG key is available on the host:
gpg --list-secret-keys - Check that
forward_gpgis enabled - The container’s GPG agent might have auto-started before the forwarded socket was ready. Restart the container to fix.
Git HTTPS: “Authentication failed”
- Verify the host proxy is running: check for the process or look at
~/.local/state/clawker/pids/hostproxy.pid - Verify credentials work on the host:
git credential fillwith your repo URL - Check that
enable_host_proxyandforward_httpsare both enabled
Claude Code: “Please authenticate”
- Verify you’re logged in on the host:
claude auth status - Check that
use_host_authistrue(default) - If using the file fallback, verify
~/.claude/.credentials.jsonexists - A one-time
/loginafter the access token expires is expected if the shared refresh token was already rotated by the host or another container. Refresh tokens are single-use (see the warning above) — the stale side must re-login once, then self-heals. This is not a misconfiguration. Re-authenticating on the host only fixes containers created afterward.