Companion repo for the article Adding Claude Code and Codex as Tools in OpenClaw.
Add Claude Code CLI/SDK and OpenAI Codex CLI/SDK as tools to your OpenClaw instance. Choose the path that matches your setup.
skills/
├── claude-code/SKILL.md # Skill — teaches the agent to use Claude Code
└── codex/SKILL.md # Skill — teaches the agent to use Codex
docker/
├── Dockerfile.snippet # Dockerfile additions (CLIs + SDKs)
├── docker-compose.snippet.yml # Volume mount additions
└── .env.example # Environment variable configuration
native/
├── install.sh # One-command install for macOS
└── README.md # Native quick-start reference
article/ # The full article
If you run OpenClaw directly on macOS (no Docker):
- Run the install script (or
npm install -gboth tools manually):./native/install.sh
- Authenticate:
claude # Anthropic OAuth codex login # OpenAI/ChatGPT OAuth
- Copy skills into your OpenClaw skills directory:
cp -R skills/claude-code ~/.openclaw/skills/ cp -R skills/codex ~/.openclaw/skills/
- Verify: ask the agent to do a code task — it should invoke Claude Code by default
See native/README.md for details.
If you run OpenClaw in Docker:
- Copy the Dockerfile lines into your OpenClaw
Dockerfile(beforeUSER node) - Add the volume mounts to your
docker-compose.yml - Add
CODEX_CONFIG_DIRandCLAUDE_CONFIG_DIRto your.env(see docker/.env.example) - Authenticate on your host:
claudeandcodex login - Copy
skills/claude-code/andskills/codex/into your OpenClawskills/directory - Rebuild:
docker compose build && docker compose up -d - Verify: ask the agent to do a code task — it should invoke Claude Code by default
Both tools use OAuth. On a native Mac, the CLIs handle everything — tokens live in ~/.claude and ~/.codex.
In Docker, mount your host's config directories into the container read-only:
- Claude Code —
~/.claudemounted as:ro. Authenticate on host withclaude. - Codex —
~/.codexmounted as:ro. Authenticate on host withcodex login.
Both are mounted on the openclaw-cli and openclaw-node services. The Codex CLI (@openai/codex) and SDK (@openai/codex-sdk) are separate packages; Claude Code bundles both in @anthropic-ai/claude-code.
Read the full article for details on the skill system and model stack.