Skip to content
Claude Code

Claude Code

Run Claude Code in the container, sharing your host login, settings and transcripts.

Set up

Run claude once on the host first, so that ~/.claude exists. Then use the files in examples/guides/claude-code:

~/.config/isodev/config.yaml
# yaml-language-server: $schema=https://isodev.dyszkiewicz.me/config.schema.json
# Claude Code with your host login, settings and transcripts.
image: isodev-claude-code:latest
build:
  context: image
environment:
  # Optional: only needed for --dangerously-skip-permissions. Containers run as
  # root, and Claude Code refuses that flag as root unless this is set.
  IS_SANDBOX: "1"
volumes:
  # Login, settings and transcripts, shared with the host.
  - type: bind
    source: ~/.claude
    target: /root/.claude
lifecycle:
  on_exec:
    # Alternative credentials, passed to commands when set on the host.
    forward_env_vars: [ANTHROPIC_API_KEY, CLAUDE_CODE_OAUTH_TOKEN]
~/.config/isodev/image/Dockerfile
FROM ubuntu:24.04
ARG DEBIAN_FRONTEND=noninteractive
# mise installs tools to ~/.local/share/mise and puts them on PATH through its
# shims. /usr/local/bin comes first, so files mounted there win.
ENV PATH=/root/.local/bin:/usr/local/sbin:/usr/local/bin:/root/.local/share/mise/shims:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update \
    && apt-get install -y --no-install-recommends ca-certificates curl git \
    && rm -rf /var/lib/apt/lists/*

# mise, which installs the tools.
RUN curl -fsSL https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh

# Claude Code.
RUN mise use --global claude-code

Credentials

  • Linux: claude stores its login in ~/.claude/.credentials.json, which the mount provides. Token refreshes are shared through the same file.
  • macOS: Claude Code keeps the login in the Keychain instead. Run claude setup-token on the host and export the result as CLAUDE_CODE_OAUTH_TOKEN, or export ANTHROPIC_API_KEY.

Variables in forward_env_vars are passed to commands that Isodev runs, such as isodev exec and Paseo agents, but not to isodev enter shells.

Use it

isodev up --recreate
isodev exec claude

With Paseo, install the provider and choose Claude (Isodev):

isodev int paseo install-provider --type=claude
paseo reload --json

Paseo reads Claude transcripts from the host’s ~/.claude to restore and rewind conversations; the shared mount is what makes that work.

Trade-offs

  • The container can modify your Claude configuration. It can read all host transcripts and memory, and write settings, hooks, skills and plugins that host Claude sessions will load. Mount a separate directory instead if you need stronger separation; Paseo then can’t restore or rewind container conversations.
  • ~/.claude.json is not shared. Claude Code replaces that file by renaming it, which breaks single-file bind mounts, so each container keeps its own.
  • Plugin paths may break. ~/.claude/plugins records absolute host paths, which only resolve in the container if your host home is also /root.
Last updated on