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 initThe 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 doneSubagent 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, screenshotcodeloop_diagnose— failure categorization and repair taskscodeloop_gate_check— confidence-scored quality gatecodeloop_section_status— multi-section orchestrationcodeloop_visual_review— screenshot-based UI reviewcodeloop_design_compare— coded UI vs design comparisoncodeloop_release_readiness— final release check
Troubleshooting
Tools not available in Claude Code
- Verify
.claude/settings.local.jsonexists and is valid JSON - Restart Claude Code after creating the config
- Check that
CODELOOP_API_KEYis 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
- Tool Reference — detailed guide for each tool
- Configuration — customize settings
- FAQ — common questions