code-analyzer — Claude Code skill: what it does, how to install
code-analyzer measures cyclomatic complexity, lines of code, maintainability and duplicates, then points at the files worth touching first.
no license 138 installs ★ 45 updated 2026-07-14
npx skills add oimiragieo/agent-studio --skill code-analyzer -a claude-codeWhat code-analyzer does
The skill runs a static pass over a repository and reports cyclomatic complexity, lines of code, a maintainability index and duplicated blocks. The work happens through one Node script kept in the project at .claude/tools/analysis/project-analyzer/analyzer.mjs, driven by Bash; files are read with Read, Glob and Grep. Actions are split by job: analyze-file and analyze-project for scope, complexity, loc, cyclomatic, maintainability and duplicates for numbers, summary, hotspots and trends on top.
Start project-wide, narrow down to hotspots, and only then refactor or add tests. It is built to sit beside code-reviewer and c4-code as primary partners, with developer and qa in support; a pre-commit or CI gate goes through project-analyzer/doctor. Results are meant to land in .claude/context/memory/learnings.md, issues.md and decisions.md.
You need Node.js v18+ and the analyzer script present in the project, since that is what gets called. On thresholds the skill is blunt: keep the ESLint complexity rule at 15 or below and never let it pass 20. A one-off snapshot tells you little, so the trend across runs is the number that counts.
What it helps with
- find the most tangled files before a refactor
- get LOC and maintainability figures for the whole repo
- spot duplicated blocks across the codebase
- catch complexity creeping up between runs
- add a complexity gate to pre-commit or CI
Example prompts for the agent
- Analyze the whole project and list the complexity hotspots.
- Run the cyclomatic check on
src/parser.tsand tell me what to simplify. - Compare this week's metrics with the last run and flag what got worse.
How to install code-analyzer
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill code-analyzer -a claude-code2Manually: put the files in place
~/.claude/skills/code-analyzer/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/code-analyzer/
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill code-analyzer -a codex2Manually: put the files in place
.agents/skills/code-analyzer/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill code-analyzer -a cursor2Manually: put the files in place
.cursor/skills/code-analyzer/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install oimiragieo/agent-studio .claude/skills/code-analyzer2Manually: put the files in place
.github/skills/code-analyzer/SKILL.md1Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill code-analyzer -a gemini-cli2Platform CLI
gemini skills install https://github.com/oimiragieo/agent-studio --path .claude/skills/code-analyzerManually: put the files in place
.devin/skills/code-analyzer/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add oimiragieo/agent-studio --skill code-analyzer -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about code-analyzer
How do I install code-analyzer in Claude Code?
Run npx skills add oimiragieo/agent-studio --skill code-analyzer -a claude-code. The skill lands at ~/.claude/skills/code-analyzer/SKILL.md.
What does code-analyzer do?
It measures code metrics: cyclomatic complexity, LOC, maintainability index and duplicates. It also returns a summary, complexity hotspots and metric trends.
Do I need anything besides the skill?
Node.js v18+ and the in-repo analyzer at .claude/tools/analysis/project-analyzer/analyzer.mjs. The skill calls that script, so nothing runs without Node.