/claude-init:doctorfrom claude-init
Validates .claude/ configuration: checks CLAUDE.md health, agent frontmatter, and skill structure. Run after /claude-init or /update to catch issues.
Ships in claude-init. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run diagnostics on the .claude/ configuration and report issues.
@import paths resolve to existing filesnpm test --help, cargo test -- --help)<your-framework-here>)ls would show, verbatim README paragraphs) — flag for trimming, matching Claude Code's own /doctor CLAUDE.md-trimming check (changelog 2.1.206)For each .claude/agents/*.md:
opus, sonnet, haiku, fable, inherit, or a full model ID)background is a boolean and memory is one of user/project/local if presenteffort is one of low/medium/high/xhigh/max, isolation is worktree, color is one of red/blue/green/yellow/purple/orange/pink/cyan, and permissionMode is one of default/acceptEdits/auto/dontAsk/bypassPermissions/plan/manual — if present (per https://code.claude.com/docs/en/sub-agents frontmatter table)For each .claude/skills/*/SKILL.md:
name matches the skill's directory name and is lowercase-kebab-caseUse when…, Use before…, or Auto-triggered…) — descriptions with no trigger won't reliably fireRed Flags / rationalization-rebuttal content and a verification step (the generated skills should all carry these)context: fork, verify no Task/Skill tool references in body (forked skills can't spawn subagents)context: fork, verify background is explicitly set (true or false) rather than omitted — since Claude Code 2.1.218 these skills default to running in the background, so an omitted field means a Claude Code upgrade can silently change the skill from blocking to backgroundedpaths: frontmatter exists, verify globs match at least one file (dead scopes = skill never loads)allowed-tools uses real tool names (Read, Edit, Write, Bash, Grep, Glob, Agent — not Tool, File, etc.)!`cmd` or ```! shell-preprocessing blocks run read-only commands only (never rm, curl http://..., writes, or long-running ops)scripts/ directory exist and are executable/skill-doctor (2.1.261+) as a complementary check — it reports which loaded skills go unused and what they cost in context, which this structural review does not measureFor each .claude/rules/*.md:
paths: frontmatter exists, verify those glob patterns match at least one file.claude/rules/ — find .claude/rules -xtype l should return nothing (shared rule libraries are linked in via symlink; a broken link silently drops those rules from context)paths:-scoped rule that reads like a hard "always/never/must" constraint rather than reference material — flag it for a move to CLAUDE.md. Per https://code.claude.com/docs/en/memory, a paths: rule only reloads after /compact when Claude next reads a matching file, unlike the project-root CLAUDE.md, which always re-reads and re-injectsRead .claude/settings.json:
"//" comment keys are OK, but trailing commas and JS comments break Claude Code's parser)preToolUse or OnEdit silently never firestype is present and one of command, http, mcp_tool, prompt, agent (required field — no default)type: command)PreToolUse hooks use the current decision schema (hookSpecificOutput.permissionDecision), NOT the legacy {"decision": "allow"|"block"} form, which PreToolUse ignoresgit\s+push\s+(-f\b|--force\b) not git push.*-f — the lazy form matches git push-to-origin --forward).* (e.g., mcp__memory__.*, not mcp__memory)|| true or exit 0 so a missing tool doesn't block writes.claude/settings.json, .claude/hooks/**, .claude/agents/**, .claude/skills/**/SKILL.md should be blocked from Edit/WriteConfig fails open: a rule that matches nothing, or a hook that never fires, raises no error. Prove each item; never pass it by reading the file.
Write(path) rule is an error: it matches nothing; the fix is Edit(path). Bash(...) rules prefix-match, so note they are a floor, not a wall.Edit|Write matcher, bash edits (sed, heredocs, scripts, as used in bypass-permissions mode) never arm it. Expect a PostToolUse Bash hook that detects changes by mtime.printf '{"session_id":"doctor","cwd":"%s","tool_name":"Edit","tool_input":{"file_path":"%s/package-lock.json"}}' "$PWD" "$PWD" | .claude/scripts/pre-edit-hook.sh; echo $? must print 2; a post-edit payload for a source file must create .claude/.cache/full-check-needed.doctor; the Stop hook with that marker must run the gate. Clean up the doctor files after..githooks/pre-push call one project command (CHECK_CMD in .claude/scripts/gate.conf, or the project's check script), not a hardcoded subset of checks. Compare against the project's check runner: a check that exists there but not in the gate is an error.cds to $CLAUDE_PROJECT_DIR gates worktree sessions on the main checkout; it should resolve the payload's cwd git toplevel.git config core.hooksPath equals .githooks (or wherever the repo keeps them) and each file there is executable. A committed hook with no core.hooksPath is a file, not a gate..claude/.cache/ older than a day (orphaned gate markers from sessions that ended red), skills or agents that reference paths that no longer exist, rules pointing at moved files.~/.claude/skills/claude-init from the claude-init repo), diff -r the installed copy against the source; any difference means the running skill is not the committed one.For each .claude/output-styles/*.md:
name and descriptionkeep-coding-instructions is a boolean (not a string) if presentoutputStyle in .claude/settings.json OR documented in CLAUDE.md so users know it exists/claude-init should have generated it)<What this system does>, <ASCII diagram>)ls).claude/settings.local.json is in .gitignore.claude/agent-memory-local/ is in .gitignore.claude/checkpoints/ is in .gitignore (PreCompact hook writes here).claude/settings.local.json.example IS committed (it's the onboarding artifact).claude/ files (grep for API keys, tokens, passwords)## Doctor Report
Passed: N checks
Warnings: N
Errors: N
### Errors (must fix)
- [file] Description
### Warnings (should fix)
- [file] Description
### All Clear
- [file] OK
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/claude-initAnalyze any codebase and generate a complete .claude/ configuration to make it AI-native. Use when setting up Claude Code for a new or existing repo. Handles cold-start by detecting stack, framework, patterns, and generating tailored CLAUDE.md, agents, skills, rules, and hooks./onboardQuick onboarding to an existing codebase. Generates a mental model of the architecture, key patterns, and how things connect. Use when joining a new repo or when a teammate needs to get up to speed fast./updateRe-analyze a repo and update its existing .claude/ configuration. Detects stack changes, new dependencies, and config drift without overwriting customizations. Use when the codebase has evolved since initial /claude-init.Other plugins' skills for the same job
npx claudepluginhub yash-gadodia/claude-init --plugin claude-init