secondmate-doctor

A setup and repair command for secondmate, a tool that checks code with another model and related helper tools.

In plain words
What is it for?
Use it to set up secondmate, install missing dependencies, check whether its model connection works, and report anything that still needs manual setup.
Why use it?
It finds missing requirements such as Git, GitHub CLI, Python, the checker, and companion tools, then runs approved fixes for them.

Command

Part of the secondmate plugin — 1 skill, 4 commands, 1 hook shipped together

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/eshwarvijay/secondmate/secondmate-doctor
Clone the repo
git clone --depth 1 https://github.com/eshwarvijay/secondmate

Or install secondmate, the plugin that ships this one along with the rest of its 1 skill, 4 commands, 1 hook.

Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 392 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00047 $0.00392
Opus 5 $0.00023 $0.00196
Sonnet 5 $0.00009 $0.00078
Haiku 4.5 $0.00005 $0.00039

Measured 2d ago against content hash b9104b747451, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

secondmate-doctor scanned grade A with 0 findings 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 2d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/secondmate-doctor.md · 22 lines

What it actually says

Set up secondmate end to end. YOU (the agent) run every fix so the human only approves it via the normal permission prompt — never make the human hunt for install steps.

  1. Detect: bash "${CLAUDE_PLUGIN_ROOT}/bin/doctor.sh" --json
  2. For each item with "status":"MISSING" and a non-empty "fix", RUN that fix command yourself (the human approves via the permission prompt). Order: CORE (git/gh/python3) → CHECKER harness → COMPANIONS (herdr, ponytail, adhd; /loop-task is bundled with this plugin).
  3. For a MISSING item with an empty "fix" (a companion whose source isn't wired in), tell the human the one concrete thing to provide (the marketplace or URL for that skill) and set the matching SM_* env var — do not block the rest on it.
  4. After healing, if the checker harness is present, confirm a reachable model with a dry check: "${CLAUDE_PLUGIN_ROOT}/bin/reason.sh" --dry-run "ping" — and remind the human that cross-model checking needs a 2nd model family + credentials (SM_CHECKER_* / SM_REASON_*), which only they can supply.
  5. Re-run bash "${CLAUDE_PLUGIN_ROOT}/bin/doctor.sh" and report: what was already OK, what you fixed, what still needs the human.

Rule: propose and run the commands; the human's only job is to approve. Do not hand them a manual checklist.

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. 2d ago First seen · 22 lines · 47 tokens per session scan A b9104b747451

Subscribe to this mod's changes

secondmate-doctor is a command published in the GitHub repository eshwarvijay/secondmate (3 stars, last pushed 6d ago), licensed MIT. It adds 47 tokens to every session and 392 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.