Skip to content

Claude Code Integration

Erode integrates with Claude Code through a custom skill that checks local changes for architecture drift during coding sessions. When Claude Code edits code that introduces an undeclared dependency, the skill flags it and shows what changed, what the model declares, and how to fix the mismatch.

No global install is needed. The skill runs Erode via npx, which downloads the package on first use and caches it for subsequent runs.

Download SKILL.md and save it to .claude/skills/erode-check/SKILL.md in your repository:

Terminal window
mkdir -p .claude/skills/erode-check
curl -o .claude/skills/erode-check/SKILL.md \
https://erode.dev/.well-known/agent-skills/erode-check/SKILL.md

2. Add a project config (if you don’t have one)

Section titled “2. Add a project config (if you don’t have one)”

The skill reads model path and provider settings from .eroderc.json in the repository root. If you already have one, skip this step.

{
"$schema": "https://erode.dev/schemas/v0/eroderc.schema.json",
"ai": { "provider": "gemini" },
"adapter": { "modelPath": "./architecture" }
}

Set adapter.modelPath to the directory containing your architecture model files. Set ai.provider to your preferred provider (gemini, openai, or anthropic).

API keys go in environment variables (ERODE_GEMINI_API_KEY, ERODE_OPENAI_API_KEY, or ERODE_ANTHROPIC_API_KEY), not in the config file. See Configuration for the full reference.

Terminal window
git add .claude/skills/erode-check/SKILL.md .eroderc.json
git commit -m "chore: add erode architecture check skill for Claude Code"

The skill is now available to Claude Code in all sessions for this repository.

When Claude Code makes changes that introduce new integrations (imports, API calls, service connections), the skill runs erode check against the local diff. Erode analyzes the changes against your declared architecture model and reports any undeclared dependencies.

A violation is not necessarily a problem. Claude Code surfaces what it found so you can decide: fix the code to follow the declared path, or update the model to reflect the new dependency. Either way, the change is conscious.

For automatic checking after every code edit, add a PostToolUse hook to .claude/settings.json:

{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "if jq -re '.tool_input.file_path // .tool_input.filePath // empty' | grep -qE '\\.(ts|js|py|go|java|rs)$'; then npx @erode-app/cli check --format json 2>&1; fi"
}
]
}
]
}
}

This runs erode check after every edit to a source file and feeds the output back to Claude Code.

The erode-check skill is published at erode.dev/.well-known/agent-skills/ following the Agent Skills Discovery RFC. Agents that support the protocol can discover and load the skill automatically without manual setup.