Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.crewship.ai/llms.txt

Use this file to discover all available pages before exploring further.

@anthropic-ai/claude-code (v2.1.126+). Production-ready in Crewship since day one; the canonical reference for what every other adapter targets for parity.

Install

Pre-installed in every seeded crew via the ghcr.io/devcontainers-extra/features/claude-code:2 devcontainer feature. To pull manually:
npm install -g @anthropic-ai/claude-code

Auth

Two modes, both supported:
TypeEnv varFormat
API keyANTHROPIC_API_KEYsk-ant-api03-…
OAuth (Claude Pro / Max)CLAUDE_CODE_OAUTH_TOKENsk-ant-oat01-…
Crewship’s sidecar reverse-proxy injects the API key into api.anthropic.com requests so the agent container never sees the raw token. OAuth tokens flow through the HTTPS CONNECT tunnel directly (sidecar passes through, Claude Code sets Authorization: Bearer itself).

Models

API stringTierNotes
claude-opus-4-7frontierDefault for complex reasoning
claude-sonnet-4-6frontierBest speed/intelligence balance — Crewship default
claude-haiku-4-5-20251001fast200k ctx
Legacy claude-opus-4-6 / 4-5 / 4-1, claude-sonnet-4-5, claude-opus-4-5 still selectable. Claude 4 (claude-*-4-20250514) retires 2026-06-15.

Command shape

Crewship’s adapter builds:
claude --print --output-format stream-json --include-partial-messages \
       --dangerously-skip-permissions --verbose \
       [--bare] --strict-mcp-config --no-session-persistence \
       --model <model> --system-prompt <preamble+persona> \
       --max-turns 50 \
       [--mcp-config /crew/agents/<slug>/.mcp.json] \
       -- <user message>
--bare disables auto-discovery of ~/.claude/CLAUDE.md, plugins, hooks, skills, and MCP — Crewship sets all of those explicitly via flags. It is appended only when the agent’s credential is an API key. Claude Code 2.x changed the --bare auth contract: it now strictly requires ANTHROPIC_API_KEY (or an apiKeyHelper via --settings) and IGNORES CLAUDE_CODE_OAUTH_TOKEN. To keep OAuth-seeded workspaces working (AI_CLI_TOKEN credentials with sk-ant-oat* values), the adapter drops --bare when it detects OAuth on the run, so the normal Claude auth flow can pick up CLAUDE_CODE_OAUTH_TOKEN. API-key runs keep the isolation win. See internal/orchestrator/adapter_claude.go:21-50.

MCP

Configured at /crew/agents/<slug>/.mcp.json. Standard schema:
{
  "mcpServers": {
    "linear": {
      "type": "http",
      "url": "https://mcp.linear.app/sse",
      "headers": {"Authorization": "Bearer ${LINEAR_TOKEN}"}
    },
    "fs": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/work"],
      "env": {"FOO": "${FOO}"}
    }
  }
}
Env-var refs ${VAR} resolve from the agent container’s process env at MCP server spawn time. Crewship’s injectMCPCredentialEnvVars populates them from workspace credentials.

Memory

Same canonical memory file set as every other adapter — AGENTS.md, CLAUDE.md, GEMINI.md, .cursor/rules/crewship.md, .factory/AGENTS.md — written to /output/<slug>/. Even though --bare skips Claude Code’s own CLAUDE.md discovery (system prompt arrives via --system-prompt), Crewship writes the file so a customer SSH-ing into the container sees the same context the agent operates on.

Output stream

JSONL events documented at code.claude.com/docs/en/cli-reference. Crewship parses every documented type:
  • system (subtype init / api_retry)
  • stream_event (text / thinking deltas)
  • assistant (tool_use, tool_result blocks)
  • tool / user (tool result blocks)
  • result (terminal envelope with usage + cost)

Troubleshooting

claude: not found — devcontainer feature didn’t install; check crew devcontainer_config for ghcr.io/devcontainers-extra/features/claude-code:2. 401 from Anthropic — credential not assigned to agent. Check crewship credential assign <name> <agent> and verify the credential has type=API_KEY or type=AI_CLI_TOKEN with provider=ANTHROPIC. Model retires 2026-06-15 — UI shows a badge on retiring models (claude-3.5-, claude--4-20250514). Migrate to claude-sonnet-4-6 or claude-opus-4-7.