agentdoctor

Getting started

Requirements

Node 20 or newer. Nothing else — agentdoctor has zero dependencies and installs no transitive packages.

Run it

No install needed:

npx @jqntn/agentdoctor

Or install it:

npm install -g @jqntn/agentdoctor    # global CLI
npm install -D @jqntn/agentdoctor    # per-project, for CI

By default it audits the current directory plus your user-level config in ~/.claude. To audit a specific project, pass the path:

agentdoctor path/to/repo
agentdoctor --no-user          # project config only (use this in CI)

What gets scanned

FileWhat it is
.claude/settings.jsonProject settings: permissions, hooks, env, model
.claude/settings.local.jsonPersonal overrides (should be gitignored)
~/.claude/settings.jsonUser-level settings
.mcp.jsonMCP server definitions
CLAUDE.md, CLAUDE.local.md, AGENTS.mdMemory files, at any depth
.claude/agents/*.mdSubagent definitions
.claude/skills/*/SKILL.mdSkill definitions
.claude/commands/*.mdSlash commands
.claude/hooks/*Hook scripts (existence and permissions only)
.claude/keybindings.jsonKey bindings

Never scanned: .credentials.json, .netrc, private keys. These are skipped by path before anything opens them, and the summary reports how many files were skipped. agentdoctor also makes no network calls — nothing leaves your machine.

Reading a finding

.claude/settings.json
  4:7     error  "Bash(*)" auto-approves every shell command, including ones
                 you have not seen.
                 | Bash(*)
                 -> Replace the wildcard with the specific commands you actually
                    want unattended, e.g. "Bash(npm test:*)".
                 security/unrestricted-bash

Top to bottom: file, line:column, severity, what is wrong, the offending value, what to do instead, and the rule id. Every rule id works with --explain:

agentdoctor --explain security/unrestricted-bash

The grade

Every report ends with a health grade - A+ (zero findings), A (info only), B/C (warnings), D/F (errors). It is computed from what is actionable today, so fixing or deliberately suppressing findings raises it. agentdoctor --share prints a paste-ready score card (rule ids and counts only - safe to share from private repos), and agentdoctor --badge emits README markdown for it.

Severities

SeverityMeaning
errorBroken or dangerous. A guardrail that does not work, a pre-approved destructive command, a committed credential.
warningVery likely a problem, occasionally intentional.
infoWorth knowing; act on it or ignore it.

Exit codes

CodeMeaning
0No errors (and warnings within --max-warnings, if set)
1At least one error, or too many warnings
2Bad usage: unknown flag, missing path, unreadable baseline

Next steps

  • Configuration — every flag, suppression, disabling rules
  • CI setup — SARIF annotations, exit-code gating
  • Baselines — adopting agentdoctor on a repo that already has findings
  • Team policy — holding many repos to one standard
  • Rule reference — every rule and the reasoning behind it