CppDepend AI
Claude Code
Setup
cd my-cpp-repo
cppdepend-ai init
cppdepend-ai analyze --run --project MyApp.cdproj
claude
If CppDepend is not in your PATH, run init with the full path, so every instruction contains it: "C:\CppDepend\cppdepend-ai.exe" init.
init adds these files. Claude Code picks them up by itself.
| File | What it is for |
|---|---|
CLAUDE.md and AGENTS.md |
where the results are and how Claude must use them. Loaded at the start of every session |
.claude/skills/cppdepend/SKILL.md |
a skill with ready-made procedures: quality, complexity, architecture, debt |
.claude/skills/cppdepend-review/SKILL.md |
the review procedure: type /cppdepend-review |
.claude/agents/architecture-reviewer.md |
a reviewer agent that only reads: gives a verdict and findings with file and line |
.claude/cppdepend-hooks.example.json |
optional, see below |
Things to ask
Review my current change using CppDepend.
/cppdepend-review
Use the architecture-reviewer agent on this branch.
Fix the Critical issues in src/net/ using the CppDepend rules.
Which classes should I refactor first, and why?
Does my change create a dependency cycle?
Optional: stop Claude from finishing when the gate fails
Copy the hooks part of .claude/cppdepend-hooks.example.json into your .claude/settings.json (shared with the team) or .claude/settings.local.json (just you). It does two things:
* at the start of a session, it reminds Claude to re-run the analysis if the results are missing or out of date;
* when Claude wants to finish, it checks the quality gate. If the gate fails, Claude is told why and keeps working. It never blocks twice in a row.
By default the check uses the latest analysis. For a stricter check, change the command to cppdepend-ai gate --hook --run --quiet: it analyzes again before checking, which is slower and needs your code to be built.
Avoid a permission prompt on every command
Allow the program once in .claude/settings.json:
{ "permissions": { "allow": [ "Bash(cppdepend-ai:*)" ] } }
If you use the full path in your instructions, allow that path instead. If it is not accepted, use /permissions in Claude Code.
In scripts
claude -p "Run cppdepend-ai status, then list the new Critical issues of my change" works the same way. For pull requests, see Review.
