Agent skill

Codehealth MCP

by affaan-m in affaan-m/ECC

Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs.

MITAuto-check passedDevelopment

Install Codehealth MCP

skills CLI
$ npx skills add affaan-m/ECC --skill codehealth-mcp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install affaan-m/ECC codehealth-mcp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/affaan-m/ECC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codehealth-mcp .claude/skills/codehealth-mcp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codehealth-mcp
GitHub stars
276k
Used in
1 other repo
Token cost
~1.8k tokens
SKILL.md length
717 words
Files
1
Skills in repo
683
Repo updated
First seen
Licence
MIT

At a glance

Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs.

  • Works in 4 steps: Connect the MCP server → Call standalone tools only → Interpret scores (1–10) → …
  • Reviewing code quality
  • SKILL.md covers Security and boundaries, When to Use, When to Activate and How It Works, plus 3 more sections
  • Needs CS_ACCESS_TOKEN

What it does

Codehealth MCP is an agent skill from affaan-m/ECC. Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs. Use when reviewing code quality, refactoring, checking if AI changes degraded a file, or before commit/PR.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Code quality, MCP servers and Refactoring. It works with Model Context Protocol. The repository describes itself as: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond. The licence is MIT.

When your agent uses it

  • Reviewing code quality
  • Checking if AI changes degraded a file
  • Before commit/PR

Example prompts

  • “/codehealth-mcp”

Requirements

  • A credential in CS_ACCESS_TOKEN

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Connect the MCP server
  2. Call standalone tools only
  3. Interpret scores (1–10)
  4. Run the feedback loop

What it can do on your machine

Read from SKILL.md and the folder at commit 4eb71d9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com
    • codescene.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • CS_ACCESS_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codehealth MCP loads about 1.8k tokens when it runs. Until then it costs about 63 tokens; SKILL.md has 717 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from affaan-m/ECC at commit 4eb71d9, republished under its MIT licence (© affaan-m). 717 words, ~1,848 tokens.

Download SKILL.mdSave it as .claude/skills/codehealth-mcp/SKILL.md (or your agent's skills folder).
name
codehealth-mcp
description
Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs. Use when reviewing code quality, refactoring, checking if AI changes degraded a file, or before commit/PR.
metadata.origin
community

Code Health MCP (CodeScene)

Structural maintainability feedback for AI-assisted coding. Complements style/lint skills (coding-standards, plankton-code-quality) with design-level health scores and regression gates.

Upstream: codescene-oss/codescene-mcp-server Package: @codescene/codehealth-mcp (stdio via npx)

Security and boundaries

Opt-in (ECC): The codescene block in mcp-configs/mcp-servers.json is a template only. ECC plugin installs do not auto-enable bundled MCP servers. Copy the entry into your config only if you want it. You can exclude it during ECC install/sync with ECC_DISABLED_MCPS=codescene,....

Credentials: No bundled token. Set CS_ACCESS_TOKEN yourself (see getting-a-personal-access-token.md in the upstream repo). Never commit tokens to the repo.

What the tools read: When invoked, tools analyze files and git state in the local repository you point them at (paths you pass, plus branch context for analyze_change_set). They do not run by themselves. For standalone mode, follow upstream privacy docs: codescene-mcp-server README and CodeScene policies. Do not use this skill for secrets, credentials, or paths you do not want analyzed.

If the MCP is unavailable (offline, bad token, server crash): Do not invent Code Health scores. Tell the user the check was skipped. Continue only with explicit user approval. Prefer lint/tests/verification-loop for gating when MCP is down. Re-enable checks once the server connects.

When to Use

  • User asks to review code quality, refactor a file, or check if AI changes degraded maintainability
  • Before editing a hotspot, legacy module, or unfamiliar file
  • Before commit or pull request when you need a maintainability safeguard
  • After a large agent-written diff — verify Code Health did not regress
  • Pair with verification-loop, tdd-workflow, or /quality-gate as a structural check (not a replacement for tests/lint)

When to Activate

Same triggers as When to Use above — this heading is what ECC uses for skill auto-activation.

How It Works

1. Connect the MCP server

Copy the codescene entry from mcp-configs/mcp-servers.json into your harness MCP config.

Claude Code (~/.claude.json → mcpServers):

json
"codescene": {
  "command": "npx",
  "args": ["-y", "@codescene/codehealth-mcp"],
  "env": {
    "CS_ACCESS_TOKEN": "YOUR_CS_ACCESS_TOKEN_HERE"
  }
}

Project-scoped: merge the same block into .mcp.json at the repo root.

Token setup is documented in the upstream repo (link above). Standalone mode does not require a paid CodeScene platform account for the four tools listed below. Restart the session and confirm the codescene server is connected before relying on scores.

2. Call standalone tools only
ToolWhen to use
code_health_reviewFull structural analysis before modifying a file
code_health_scoreQuick numeric score after each change (delta check)
pre_commit_code_health_safeguardBlock commits that introduce Code Health regressions
analyze_change_setBranch-level check before opening a PR

Do not call platform-only tools (e.g. repository-wide technical debt hotspot lists). Do not reference delta_analysis — not available on standalone.

3. Interpret scores (1–10)
RangeMeaningAgent behavior
9.0–10.0Green — healthySafer to extend; still prefer vertical slices
4.0–8.9Yellow — debtTread carefully; no drive-by refactors
1.0–3.9Red — severe debtNarrow scope only
Show full SKILL.md (271 more words)Show less
4. Run the feedback loop

Before touching a file

  1. Run code_health_review on the target path.
  2. Record baseline score and listed code smells.
  3. Plan the smallest change that addresses the task.

Scope by score: below 5 — minimal diff only; 5–7 — no broad refactors; above 7 — safer to refactor, still verify after each edit.

After each change

  1. Run code_health_score on the same file.
  2. Compare to the baseline from code_health_review.
  3. If the score regressed, fix before continuing. Never mark the task done while the score is lower than when you started.

Before every commit — run pre_commit_code_health_safeguard on the repository path.

Before a PR — run analyze_change_set against the base branch (e.g. main).

Examples

Example: Flask maintainability improvement

On pallets/flask, an agent loop using only standalone tools:

  1. code_health_review on a target module (baseline 4.82)
  2. Targeted refactor addressing listed smells
  3. code_health_score after each edit
  4. pre_commit_code_health_safeguard before commit
  5. analyze_change_set before PR

Result: Code Health 4.82 → 9.1 (free standalone token only).

Example: AGENTS.md enforcement block

Paste into the project AGENTS.md or CLAUDE.md:

md
## Code Health (CodeScene MCP)

Before modifying any file: run `code_health_review`, note score and issues.

- Score below 5: problematic range — scope changes narrowly.
- Score 5–7: warning range — no broad refactors.

After each change: run `code_health_score` to verify delta.

- If score regressed: fix before continuing; never declare done if score dropped.

Before every commit: run `pre_commit_code_health_safeguard`.

Before PR: run `analyze_change_set`.
Example: anti-patterns vs correct loop
markdown
# BAD: Edit first, check later
[large refactor without code_health_review]

# BAD: Ignore score drop
"Tests pass" → mark task done while Code Health decreased

# BAD: Broad refactor on red-score file (below 5)
Drive-by cleanup across the module

# GOOD: review → small change → score → commit safeguard → analyze_change_set

Pairing with ECC

ECC skill / flowCode Health MCP role
coding-standardsStyle/naming; Code Health = structure/complexity
plankton-code-qualityWrite-time lint/format; Code Health = pre/post edit structural gate
verification-loop / /quality-gateAdd structural regression check before "done"
security-reviewSecurity vs maintainability — use both when relevant
tdd-workflowTests pass ≠ healthy design — check score after refactors

Context tip: ECC recommends keeping MCP count low. Enable codescene when doing substantive edits; disable when not needed.

  • coding-standards — baseline conventions
  • plankton-code-quality — write-time lint/format hooks
  • verification-loop — build/test/lint gate
  • tdd-workflow — test-first development
  • security-review — security checklist
  • documentation-lookup — library docs via Context7 (orthogonal)

© affaan-m, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/codehealth-mcp of affaan-m/ECC.

Open the folder on GitHubat commit 4eb71d9

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in affaan-m/ECC, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Codehealth MCP next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codehealth MCP compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codehealth MCP this skillaffaan-m/ECC276k1 repos~1.8kAutomated safety check: PassMIT
Trace-MCP Refactoringnikolai-vysotskyi/trace-mcp189—~672Automated safety check: PassMIT
Graph-Guided Safe Refactoringtirth8205/code-review-graph32k1 repos~332Automated safety check: PassMIT
Roslynkmrpmorris/Roslynk132—~3.3kAutomated safety check: PassMIT
Refactortermide/termide171—~2.8kAutomated safety check: PassMIT
Idea MCPdtprj/dongting208—~698Automated safety check: PassApache-2.0

Similar skills

  • Trace-MCP Refactoring

    nikolai-vysotskyi/trace-mcp

    Refactors code safely in projects indexed by trace-mcp: assess risk, find candidates, check impact and rename symbols across every file without missing a reference.

    189 GitHub stars~672 tokensUpdated today
    DevelopmentAuto-check passed
  • Graph-Guided Safe Refactoring

    tirth8205/code-review-graph

    Plans a refactor from a code dependency graph, previews renames before applying them and checks that the final impact matches the plan.

    32k GitHub starsUsed in 1 repo~332 tokens
    DevelopmentAuto-check passed
  • Roslynk

    mrpmorris/Roslynk

    How to use the Roslynk MCP tools (mcproslynk) effectively for .NET work.

    132 GitHub stars~3.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Refactor

    termide/termide

    Full-workspace code quality analysis and refactoring with validation

    171 GitHub stars~2.8k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Idea MCP

    dtprj/dongting

    IntelliJ IDEA MCP for Java code analysis, testing, refactoring, and project navigation.

    208 GitHub stars~698 tokensUpdated today
    DevelopmentAuto-check passed
  • MCP Refactoring

    adeze/raindrop-mcp

    Refactoring MCP Tools for Better LLM Integration and Usability

    188 GitHub stars~972 tokensUpdated 2 mo ago
    DevelopmentAuto-check passed

More from affaan-m/ECC

All 683 skills in this repo
  • Skill Stocktake

    affaan-m/ECC

    Audits your installed Claude skills and commands for quality, with a quick mode for recently changed skills and a full mode that evaluates all of them through subagents.

    276k GitHub starsUsed in 5 repos~3.1k tokens
    Auto-check passed
  • Ingests, indexes, searches, edits and monitors video, audio and live streams through the VideoDB Python SDK, returning stream links, clips and timestamps.

    276k GitHub starsUsed in 3 repos~3.5k tokens
    Auto-check: notes
  • Docs Governance

    affaan-m/ECC

    Route broad documentation-governance requests to existing ECC skills and run an opt-in, read-only audit of mapped documentation roles, links, ADR indexes, and evidence references.

    276k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Rules Distillation

    affaan-m/ECC

    Scans installed skills for principles that recur across them and proposes rule-file changes: append, revise, add a section, create a file or leave as covered.

    276k GitHub starsUsed in 2 repos~2.3k tokens
    Auto-check passed
  • Builds DRAFT counterparty agreements from one markdown template and a small JSON spec per party, with clauses picked by the party's role.

    276k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Measures whether agents actually follow a skill, rule or agent definition by generating scenarios at three strictness levels and scoring tool-call traces.

    276k GitHub starsUsed in 1 repo~623 tokens
    Auto-check passed

Categories

Questions about Codehealth MCP

What does Codehealth MCP do?

Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs. Codehealth MCP is an agent skill from affaan-m/ECC. Real-time structural Code Health via CodeScene MCP — review before edits, verify score deltas after changes, gate commits and PRs.

When should I use Codehealth MCP?

Codehealth MCP fits situations like: reviewing code quality; checking if AI changes degraded a file; before commit/PR.

How do I install Codehealth MCP in Claude Code?

Run `npx skills add affaan-m/ECC --skill codehealth-mcp -a claude-code`. Or copy the skill folder (skills/codehealth-mcp in affaan-m/ECC) into .claude/skills/codehealth-mcp in your project. Claude Code loads it when a task matches its description.

How do I install Codehealth MCP in Codex?

Run `npx skills add affaan-m/ECC --skill codehealth-mcp -a codex`. Or copy the skill folder (skills/codehealth-mcp in affaan-m/ECC) into .agents/skills/codehealth-mcp in your project. Codex loads it when a task matches its description.

Can I use Codehealth MCP in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add affaan-m/ECC --skill codehealth-mcp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codehealth-mcp, .gemini/skills/codehealth-mcp, .github/skills/codehealth-mcp and .opencode/skills/codehealth-mcp in your project.

What does Codehealth MCP need to run?

Going by SKILL.md and its folder, Codehealth MCP needs credentials named CS_ACCESS_TOKEN. Our summary lists: A credential in CS_ACCESS_TOKEN.

Does Codehealth MCP access the network?

SKILL.md names 2 domains. As links in the text: github.com and codescene.com. This is read from the text; nothing was executed.

Is Codehealth MCP safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codehealth MCP use?

Codehealth MCP is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codehealth MCP use?

About 1.8k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Codehealth MCP?

Skills that share tags, products or a category with Codehealth MCP: Trace-MCP Refactoring (nikolai-vysotskyi/trace-mcp, 189 stars), Graph-Guided Safe Refactoring (tirth8205/code-review-graph, 32k stars), Roslynk (mrpmorris/Roslynk, 132 stars) and Refactor (termide/termide, 171 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codehealth MCP?

affaan-m (a GitHub user) maintains it in affaan-m/ECC, which has 276,111 GitHub stars. The repository holds 683 skills in this directory. The repository was last updated on October 10, 2026.

Source: affaan-m/ECC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.