doctor

doctor is a command for Claude Code from jianzhichun/permafrost. It costs 13 tokens per session (328 once invoked), scanned A, original, MIT.

A diagnostic command for checking why DeepSeek's prompt-prefix cache is not being reused in the current Claude Code session. It examines the proxy report, prefix changes, and two environment settings.

In plain words
What is it for?
Run it to inspect cache-anchor stability, find volatile content such as dates or git details, check custom-endpoint settings, and get suggested fixes such as changing the mode or restarting the session.
Why use it?
It helps identify changing prompt content, repeated cache resets, and settings that may cause the full tool list to be sent again on every turn. It then explains possible next steps.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

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

Good fit Run it to inspect cache-anchor stability, find volatile content such as dates or git details, check custom-endpoint settings, and get suggested fixes such as changing the mode or restarting the session.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/jianzhichun/permafrost/doctor
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.

Clone the repo
git clone --depth 1 https://github.com/jianzhichun/permafrost

Made for: Claude Code.

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

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for doctor

README.md
[![agentmods](https://agentmods.dev/badge/commands/jianzhichun/permafrost/doctor/github.svg)](https://agentmods.dev/commands/jianzhichun/permafrost/doctor)
Your own site
<a href="https://agentmods.dev/commands/jianzhichun/permafrost/doctor"><img src="https://agentmods.dev/badge/commands/jianzhichun/permafrost/doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for doctor

Your own site · 80×15
<a href="https://agentmods.dev/commands/jianzhichun/permafrost/doctor"><img src="https://agentmods.dev/badge/commands/jianzhichun/permafrost/doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 328 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00013 $0.00328
Opus 5 $0.00006 $0.00164
Sonnet 5 $0.00003 $0.00066
Haiku 4.5 $0.00001 $0.00033

Measured 10d ago against content hash d84f4dd955e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

doctor scanned grade A 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 10d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

allowed-tools: Bash(curl:*)
commands/doctor.md · 21 lines

What it actually says

Diagnose the DeepSeek prefix cache for this session.

Pull the proxy's alignment report and prefix-change history:

!curl -fsS "http://127.0.0.1:${PERMAFROST_PORT:-8787}/permafrost/doctor" 2>/dev/null || echo '{"error":"proxy not reachable — start it with: permafrost up"}'

Also check the two environment knobs that most often break the cache under a custom endpoint:

!echo "ANTHROPIC_BASE_URL=${ANTHROPIC_BASE_URL:-<unset>} ENABLE_TOOL_SEARCH=${ENABLE_TOOL_SEARCH:-<unset>} PERMAFROST_MODE=${PERMAFROST_MODE:-aggressive}"

Then explain to the user, in plain language:

  • Whether the cache anchor (tools + system) is staying frozen or churning, and the count of resets.
  • Any volatile content still detected in the system prefix (dates, git status, UUIDs, hashes) and what it costs.
  • If ENABLE_TOOL_SEARCH is not true while ANTHROPIC_BASE_URL is a custom host, warn that Claude Code is likely re-inlining the full tool set every turn (a major buster) and that it must be set before launching claude.
  • Concrete next steps (e.g. switch to PERMAFROST_MODE=aggressive, set the env var, restart the session).
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. 10d ago First seen · 21 lines · 13 tokens per session scan A d84f4dd955e9

Subscribe to this mod's changes

doctor is a command published in the GitHub repository jianzhichun/permafrost (22 stars, last pushed 2mo ago), licensed MIT. It adds 13 tokens to every session and 328 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.