orgkit-doctor

A diagnostic and repair command for orgkit, a repository memory system stored in the .org folder. It checks the system files, role settings, role instructions, hooks, and ORG.md.

In plain words
What is it for?
Use it to check an orgkit setup, investigate missing or invalid files, remove dangling hooks, restore role settings, or register missing hooks.
Why use it?
It helps find why orgkit is not working and can offer to repair broken settings or hooks. Dry-run mode reports problems without changing files.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/hdk10/orgkit/orgkit-doctor
Clone the repo
git clone --depth 1 https://github.com/hdk10/orgkit
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 935 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00050 $0.00935
Opus 5 $0.00025 $0.00467
Sonnet 5 $0.00010 $0.00187
Haiku 4.5 $0.00005 $0.00093

Measured yesterday against content hash 7e2feaffb05d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

orgkit-doctor scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- **The repair pass mutates state** (removes dangling hooks, restores roles.json, re-registers hooks, edits `~/.claude/settings.json` with a timestamped backup). Get explicit confirmation before the `--yes` pass; tell th
commands/orgkit-doctor.md · 45 lines

How it starts

The opening of the file, as written. The whole thing — 45 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running orgkit's doctor — a diagnostic and repair command for the current repo's org-memory setup. It checks whether the engine, config, role brains, and hooks are all wired correctly, flags anything broken, and — with your confirmation — repairs broken states (removes dangling hooks, restores roles.json, re-registers missing hooks). The repair pass only runs after you confirm; a --dry-run report-only mode is also available.

Steps

  1. Locate the doctor module. Prefer the engine installed in the repo; fall back to the plugin copy.

    DOCTOR_PY="${CLAUDE_PROJECT_DIR:-$PWD}/.org/doctor.py"
    if [ ! -f "$DOCTOR_PY" ]; then
      DOCTOR_PY="${CLAUDE_PLUGIN_ROOT}/orgkit/doctor.py"
    fi
    

    The user's repo root is ${CLAUDE_PROJECT_DIR} (fall back to $PWD).

  2. Diagnose first (report-only, no changes). Always run a --dry-run pass to get the diagnosis. This never prompts and never mutates anything, so it is safe to run from a non-interactive shell:

    python3 "$DOCTOR_PY" --target "${CLAUDE_PROJECT_DIR:-$PWD}" --dry-run
    

    This checks for: a valid .org/roles.json, the engine scripts under .org/, each role's memory/ROLE.md brain, registered lifecycle hooks, and a current ORG.md. The dry-run prints the diagnosis table and lists the fixable issues without applying any of them.

  3. Present the diagnostics as a checklist (PASS / WARN / FAIL per check), then summarize the overall health and the single most important fix if anything failed.

  4. Confirm before repairing. If — and only if — the dry-run reported one or more fixable issues, use the AskUserQuestion tool to ask whether to apply the fixes (list exactly what will change: e.g. "remove N dangling hooks", "restore roles.json", "re-register hooks"). Do not apply anything without an explicit yes. If the user passed --dry-run themselves, stop here and skip the repair pass entirely.

  5. Apply fixes non-interactively (only on confirmation). doctor.py's interactive prompt relies on a TTY stdin that this tool does not have, so apply with --yes rather than the bare invocation:

    python3 "$DOCTOR_PY" --target "${CLAUDE_PROJECT_DIR:-$PWD}" --yes
    

    This re-diagnoses and applies every fixable repair without prompting. Report what changed (it prints a settings.json backup filename for any hook edits).

  6. Suggest remedies based on what failed:

    • No .org/roles.json → run /orgkit-init to onboard.
    • Hooks missing → re-run /orgkit-init (it re-registers hooks idempotently).
    • Stale role brains / pending content → /orgkit:org-status then /orgkit:role-promote <role>.

Read the full file on GitHub · 45 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 45 lines · 50 tokens per session scan B 7e2feaffb05d

Subscribe to this mod's changes

orgkit-doctor is a command published in the GitHub repository hdk10/orgkit (2 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 935 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.