CodeLoop

Claude Code Setup

This guide covers setting up CodeLoop specifically for Claude Code. Make sure you have your API key ready (see API Keys).

Automatic Setup (Recommended)

cd your-project
npx codeloop init

The init command auto-detects Claude Code and creates the necessary config files.

Manual MCP Configuration

Create .claude/settings.local.json in your project root:

{
  "mcpServers": {
    "codeloop": {
      "command": "npx",
      "args": ["-y", "@codeloop/mcp-server"],
      "env": {
        "CODELOOP_API_KEY": "cl_live_your_key_here"
      }
    }
  }
}

Agent Instructions

CodeLoop creates an AGENTS.md file in your project root that provides Claude Code with instructions on when and how to use CodeLoop tools:

# CodeLoop Integration

## After implementing any feature:
1. Call codeloop_verify to check build, lint, and tests
2. If verification fails, call codeloop_diagnose
3. Fix the identified issues
4. Call codeloop_verify again (loop until passing)
5. Call codeloop_gate_check for confidence scoring

## For multi-section projects:
- Call codeloop_section_status to track progress
- Continue to the next section when gate check passes
- Call codeloop_release_readiness when all sections are done

Subagent Definitions

For advanced workflows, CodeLoop can define subagent configurations that Claude Code uses for specialized tasks like visual review or release readiness checks. These are automatically created by npx codeloop init.

Expected Result

After setup, Claude Code should have access to all 7 CodeLoop tools:

  • codeloop_verify — build, lint, test, screenshot
  • codeloop_diagnose — failure categorization and repair tasks
  • codeloop_gate_check — confidence-scored quality gate
  • codeloop_section_status — multi-section orchestration
  • codeloop_visual_review — screenshot-based UI review
  • codeloop_design_compare — coded UI vs design comparison
  • codeloop_release_readiness — final release check

Troubleshooting

Tools not available in Claude Code

  • Verify .claude/settings.local.json exists and is valid JSON
  • Restart Claude Code after creating the config
  • Check that CODELOOP_API_KEY is set in your shell environment
  • Look for MCP connection errors in Claude Code's output

Connection timeout

  • Ensure Node.js 18+ is installed
  • Check internet connectivity for API key validation
  • Try running the server directly: npx -y @codeloop/mcp-server

Next Steps