497 words
2 minutes
How to Configure Claude Code and Codex
2025-10-27

What Are Claude Code and Codex?#

Claude Code is Anthropic’s “agentic” coding tool. It comes as a local CLI, a VS Code extension, and a cloud/web offering (research preview, available on Pro/Max). It can read and modify code, run commands, and ships with extras that push its autonomy further — subagents, checkpoint rollbacks, and more.

Codex is OpenAI’s local terminal coding agent (open source, written in Rust). It can read, edit, and run the code in your current directory, with an interactive TUI, a scriptable exec mode, fine-grained sandbox and approval policies, and native MCP integration (STDIO and streamable HTTP, including OAuth). One shared config.toml covers both the CLI and the IDE extension.

Use Cases#

DimensionClaude CodeOpenAI Codex CLI
Form factorTerminal, VS Code extension, web (cloud)Terminal CLI + IDE extension
PriceExpensive, even through third-party API relaysCheaper; can ride on a Team subscription
Where it runsLocally; or in isolated cloud sandboxes running tasks in parallel (auto PRs, progress tracking)Locally, reading/editing/running inside your working directory (interactive TUI / scripted mode)
Security modelSandbox built on filesystem + network isolation, fewer permission prompts; Git goes through a controlled proxyChoose an “approval mode”: Auto by default (free rein inside the workspace), approval needed for anything outside it or online; read-only and full-access modes also available
MCP (tool extension)Official docs and a plugin ecosystem; connect external tools via MCPNative MCP: STDIO and streamable HTTP (with OAuth; requires enabling experimental_use_rmcp_client); the CLI and IDE share one config.toml
WindowsSupported (including WSL / Git Bash routes)Experimental; officially recommends WSL
Typical scenariosMulti-repo / parallel small changes, TDD fixes, controlled cloud environmentsDeep local refactors, scripted integration, one config shared with the IDE

Node Environment Setup#

You need Node 20 or later.

If you’re a frontend engineer, I’d recommend managing your Node.js versions with nvm.

Terminal window
# List available remote Node.js versions
nvm ls-remote
# Install the Node.js LTS
nvm install --lts
# Switch to the Node.js LTS
nvm use --lts

Once installed, verify the version:

Terminal window
node --version

Claude Code Configuration#

In the Terminal#

Terminal window
# Install the CLI
npm install -g @anthropic-ai/claude-code
# Start (in the terminal)
claude

In VS Code#

Install Claude Code for VS Code from the marketplace.

Authorization#

Edit ~/.claude/settings.json and add the following:

{
"env": {
"ANTHROPIC_AUTH_TOKEN": "", // Your Claude API key. If you're using a third-party relay, put the relay's API key here
"ANTHROPIC_BASE_URL": "", // Usually https://api.anthropic.com/v1. If you're using a third-party relay, put the relay's API URL here
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"permissions": {
"allow": [],
"deny": []
}
}

Codex Configuration#

In the Terminal#

Terminal window
# Install (either one)
npm install -g @openai/codex
# Start the interactive TUI
codex

In VS Code#

Install OpenAI Codex for VS Code from the marketplace.

Authorization#

Create the ~/.codex directory.

Create and edit ~/.codex/config.toml with the following:

model_provider = "codex"
model = "gpt-5" # Can be changed to model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
[model_providers.codex]
name = "codex"
base_url = "https://api.openai.com/v1" # Usually https://api.openai.com/v1. If you're using a third-party relay, put the relay's API URL here
wire_api = "responses"
requires_openai_auth = true

Create and edit ~/.codex/auth.json with the following:

{
"OPENAI_API_KEY": "your-api-key-here" // Your OpenAI API key. If you're using a third-party relay, put the relay's API key here
}
How to Configure Claude Code and Codex
https://www.mihouo.com/en/posts/ai/claude-code-and-codex-configuration/
Author
Jia
Published at
2025-10-27
License
CC BY-NC-SA 4.0