Skip to main content

claudemd-doctor

Your CLAUDE.md is probably hurting Claude Code more than helping it. This finds out why.

A zero-dependency CLI that generates a lean CLAUDE.md from your repo and lints an existing one for the mistakes that make Claude ignore it: stale paths, dead commands, vague rules, bloat and leaked secrets.

CI PyPI Python License Dependencies

The problem

CLAUDE.md is the one file Claude reads at the start of every session. But most of them:

  • grow to 500 lines until nothing in them has weight,
  • say things like "write clean code" (Claude already does),
  • point at files and scripts that were renamed months ago,
  • repeat what the formatter already enforces,
  • sometimes even contain an API key.

Nobody notices, because nothing checks the file. Until now.

See it work

$ claudemd-doctor lint

CLAUDE.md  (12 lines)
     L8  error    stale-command       `deploy-everything` is not a script in package.json.
    L12  error    secret              Possible hard-coded credential. Never commit secrets to CLAUDE.md.
     L3  warning  vague-rule          "write clean code" says nothing Claude doesn't already do. Replace it with a concrete, checkable rule.
     L4  warning  vague-rule          "be careful" says nothing Claude doesn't already do. Replace it with a concrete, checkable rule.
     L7  warning  stale-path          `src/utils/helpers.ts` does not exist in the repo. Update or remove it.
    L10  info     duplicate           Same line as line 9.

Score: 47/100

It checks your CLAUDE.md against the actual repo, so a rule that points at something that no longer exists gets caught.

Install

pip install claudemd-doctor
# or, isolated:
pipx install claudemd-doctor
# or the latest from GitHub:
pip install git+https://github.com/claudeee617-hue/claudemd-doctor

Usage

# Starting from scratch? Scan the repo and write a starter CLAUDE.md
claudemd-doctor generate

# Preview without writing
claudemd-doctor generate --stdout

# Lint the CLAUDE.md in the current repo (also finds .claude/CLAUDE.md)
claudemd-doctor lint

# CI-friendly: fail below a score, machine-readable output
claudemd-doctor lint --fail-under 80 --format json

Exit code is 1 when there are errors or the score is under --fail-under, so it drops straight into CI.

What generate detects

Ecosystem What it picks up
Node package.json scripts, npm / pnpm / yarn / bun (from the lockfile)
Python pip / poetry / uv, pytest vs unittest, ruff, mypy, black
Make real targets from your Makefile
Rust / Go cargo and go toolchain commands
Embedded PlatformIO build and upload

It also lists your top-level directories, formatter configs and CI workflows. The result is short on purpose: you add the 2-3 things only you know.

Lint rules

Rule Severity What it catches
secret error API keys, tokens, private keys, hard-coded passwords
stale-command error npm run x / make x where x doesn't exist
too-long warning / error Over 200 / 400 lines
stale-path warning Backticked file paths that no longer exist
vague-rule warning "Write clean code", "follow best practices"...
no-commands warning No build/test commands, so Claude can't verify its work
no-headings warning A wall of text with no structure
shouting warning Overuse of IMPORTANT / NEVER / MUST
style-in-claude-md info Indent/quote rules a formatter config already enforces
duplicate info The same line repeated
placeholder info Leftover TODO / TBD text

Score starts at 100: each error costs 15, warning 7, info 2.

Use it in CI (GitHub Action)

- uses: actions/checkout@v4
- uses: claudeee617-hue/claudemd-doctor@main
  with:
    fail-under: 80

Development

pip install -e .
python -m unittest discover -s tests

Add a rule: write the check in claudemd_doctor/linter.py, add a test, add a row to the table above. PRs welcome.

License

MIT

Metadata

Release files for claudemd-doctor 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claudemd-doctor 0.1.1
File Size Uploaded Provenance Actions
claudemd_doctor-0.1.1.tar.gz 16.2 kB With provenance Details for claudemd_doctor-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for claudemd-doctor 0.1.1
File Interpreter ABI Platform Actions
claudemd_doctor-0.1.1-py3-none-any.whl Python 3 none any Details for claudemd_doctor-0.1.1-py3-none-any.whl

Total release size: 31.0 kB

Release files / claudemd_doctor-0.1.1.tar.gz

Download URL claudemd_doctor-0.1.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ddf16689b7c6be32ceb58559f2ceef83836544cbc46ccea3ed637a3332e09918
BLAKE2b-256 checksum
How to use checksums
71b5c76aa46461cfb6235727b944ce14330d315eaa716b20dd7ec4481c55faae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / claudemd_doctor-0.1.1-py3-none-any.whl

Download URL claudemd_doctor-0.1.1-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
485c865cbc67596f8c4cdba5bbef3d43f2c1fe4f0eec63769d4f1a51b18764d6
BLAKE2b-256 checksum
How to use checksums
2fe3d5c52be200d5d0d5518c3ee7d6c34372e3b59c86fdff51688330376dabb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for claudemd-doctor 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for claudemd_doctor-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page