This guide covers the setup and usage of Claude Code as the primary AI development assistant in this repository.
Claude Code is Anthropic's official CLI tool for AI-assisted development. It serves as the primary development partner for complex tasks including architecture design, implementation, debugging, and documentation.
- Node.js 22.16.0 (specifically required by Claude CLI)
- nvm (Node Version Manager) - recommended for managing Node.js versions
# Install nvm (if not already installed)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Reload shell configuration
source ~/.bashrc # or ~/.zshrc
# Install and use Node.js 22.16.0
nvm install 22.16.0
nvm use 22.16.0# Ensure correct Node.js version
nvm use 22.16.0
# Install Claude Code globally
npm install -g @anthropic-ai/claude-code# Run the login command
claude loginThis opens a browser for authentication. After successful login, credentials are stored in one of these locations:
~/.claude.json(most common)~/.config/claude/claude.json~/.claude/claude.json
Claude CLI uses subscription-based authentication tied to your Anthropic account:
claude loginImportant: Subscription authentication is machine-specific. The tokens cannot be transferred to containers or other machines.
For CI/CD environments or when subscription auth is unavailable:
export ANTHROPIC_API_KEY="your-api-key-here"The agents automatically prefer API key authentication when available.
# Start an interactive Claude Code session
./tools/cli/agents/run_claude.sh
# Or directly
claudeClaude Code is configured via CLAUDE.md which provides:
- Project context and philosophy
- Available commands and tools
- Container-first guidelines
- MCP server configurations
- Security considerations
| Feature | Description |
|---|---|
| Multi-file Editing | Can read and modify multiple files in a single session |
| Command Execution | Runs shell commands with proper sandboxing |
| MCP Integration | Connects to 19 MCP servers for extended capabilities |
| Context Awareness | Understands entire codebase through CLAUDE.md |
| Tool Use | Full tool use capabilities for development tasks |
Claude Code connects to the following MCP servers (configured in .mcp.json):
| Server | Port | Purpose |
|---|---|---|
| Code Quality | 8010 | Formatting, linting, autoformat |
| Gemini | 8006 | AI consultation |
| OpenCode | 8014 | Code generation |
| Crush | 8015 | Quick code generation |
| Codex | 8021 | OpenAI code assistance |
See MCP Documentation for the complete list of available servers.
Claude Code runs on the host machine rather than in containers due to authentication constraints:
- Session-based Auth: Subscription tokens are machine-specific
- Container Isolation: Credentials don't transfer to container environments
- Security Design: Prevents credential sharing across environments
For detailed technical explanation, see Claude Authentication.
- Be Specific: Clear, detailed requests yield better results
- Provide Context: Reference specific files or code sections
- Use CLAUDE.md: The configuration file provides project-specific guidance
- Follow Conventions: Request adherence to project patterns
- Review Generated Code: Always review AI-generated code before committing
- No Secrets in Prompts: Never include API keys or credentials
- Container-First: Use containerized commands for CI/CD operations
- Validate Changes: Run tests after significant modifications
Claude Code works alongside:
| Agent | Role | When to Use |
|---|---|---|
| Gemini | Code review | Automated PR reviews |
| Codex | Code generation | OpenAI-based generation |
| OpenCode | Code generation | OpenRouter-based generation |
| Crush | Code generation | OpenRouter-based generation |
| GitHub Copilot | PR suggestions | Inline code suggestions |
| Issue | Solution |
|---|---|
claude: command not found |
Run nvm use 22.16.0 then reinstall |
Invalid API key |
Run claude login or set ANTHROPIC_API_KEY |
| Wrong Node.js version | Use nvm use 22.16.0 before running claude |
| Auth not persisting | Check ~/.claude.json exists and has correct permissions |
# Check Node.js version
node --version # Should be v22.16.0
# Check Claude CLI
claude --version
# Check authentication
ls -la ~/.claude.jsonIf authentication issues persist:
# Remove existing auth
rm ~/.claude.json
# Re-login
nvm use 22.16.0
claude loginA setup script is provided to automate host configuration:
./automation/setup/agents/setup-host-for-agents.shThis script:
- Checks for required tools (Python, pip, Claude CLI, GitHub CLI)
- Verifies authentication status
- Installs Python dependencies
- Provides guidance for missing components
| Variable | Purpose | Required |
|---|---|---|
ANTHROPIC_API_KEY |
API key authentication (alternative to login) | No |
GITHUB_TOKEN |
GitHub API access for agent operations | Yes (for agents) |
GITHUB_REPOSITORY |
Repository context | Yes (for agents) |
- CLAUDE.md - Project-specific Claude configuration
- Claude Authentication - Why agents run on host
- Claude Expression - Communication style guide
- AI Agents Overview - Complete agent ecosystem
- AI Code Agents - Code generation agents