Documentation

Agents

Choose Claude Code, Codex, or OpenCode. Use a subscription or an API key.

On this page

Choose an agent

Set the enabled list with CROCODE_AGENTS. Choose the server default with CROCODE_DEFAULT_AGENT. Installation settings and repository config can override it.

AgentRead-only controlsCredentials
Claude CodeRead, Grep, and Glob tools only. Bare and restricted mode, or safe mode for subscription tokens.Claude subscription token in CLAUDE_CODE_OAUTH_TOKEN, or ANTHROPIC_API_KEY
Codexexec --sandbox read-only with an ephemeral session.ChatGPT subscription login in CROCODE_CODEX_AUTH_DIR, or CODEX_API_KEY
OpenCodeAll permissions denied except read, glob, and grep. Pure mode disables external plugins.Provider key, such as OPENROUTER_API_KEY

Use your subscription

Claude Code and Codex can run on the plan you already pay for. You do not need an API key or a per-token bill.

  • Claude Code: use your Claude subscription through claude setup-token.
  • Codex: use your ChatGPT subscription through codex login --device-auth.

Reviews count against your plan usage limits. API keys also work.

Claude Code

To use a Claude subscription:

  1. Run claude setup-token with your own Claude CLI.
  2. Set the result as CLAUDE_CODE_OAUTH_TOKEN in the worker environment.
  3. Leave ANTHROPIC_API_KEY empty. A nonempty API key takes priority.

To use an API key, set ANTHROPIC_API_KEY on the worker.

Subscription reviews count against subscription usage limits. CroCode uses safe mode for this path because bare mode does not read OAuth credentials. Safe mode also blocks the OSV vulnerability tools.

Codex

To use a ChatGPT subscription:

  1. Create a dedicated directory on the Docker host. Give UID and GID 10001:10001 access. Set its mode to 0700.
  2. Mount that directory at /home/agent/.codex in a temporary sandbox-image container. Run codex login --device-auth as 10001:10001 and complete the login.
  3. Set CROCODE_CODEX_AUTH_DIR to the absolute host path. Leave CODEX_API_KEY empty.

Reserve that login for CroCode. Do not mount your normal Codex home. Only Codex containers receive the directory. Reviews count against your ChatGPT plan limits.

To use an API key, set CODEX_API_KEY. An alternative API endpoint can use OPENAI_BASE_URL.

Before enabling Codex, use a compatible dedicated runtime and repeat the read, blocked-write, and blocked-network probes. Do not add privileged mode or bypass the sandbox to hide a namespace failure.

See the container build and verification notes for the pinned CLI versions and known host limits.

OpenCode

Set the selected provider’s key. CroCode passes ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, and OPENCODE_API_KEY when present.

CroCode supplies a fixed permission config. It disables project config, Claude config, external skills, and external plugins. These controls prevent repository files from adding startup code.

Credential boundary

Only the selected agent’s listed model variables and explicit CROCODE_AGENT_ENV names enter the sandbox. The agent can read its own model key.

Never pass GitHub tokens, private keys, database URLs, OAuth secrets, or session secrets. Do not mount your personal CLI home. Use separate model keys with provider spending limits.