context-doctor

context-doctor is a skill for Claude Code from Mark-Life/agent-skills. It costs 72 tokens per session (4,678 once invoked), scanned A, original, MIT.

A workflow for auditing the fixed instructions and tools loaded into every coding-agent session. It looks at items such as plugins, skills, connected tools, memory files, and built-in features.

In plain words
What is it for?
Use it when the agent's context feels bloated, when reviewing token usage, or after connecting many tools and skills.
Why use it?
It helps find unused or unnecessary context that consumes the agent's available working space and can make sessions harder to manage.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

Good fit Use it when the agent's context feels bloated, when reviewing token usage, or after connecting many tools and skills.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mark-life/agent-skills/context-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.

Any agent
npx skills add Mark-Life/agent-skills --skill context-doctor
Clone the repo
git clone --depth 1 https://github.com/Mark-Life/agent-skills

Made for: Claude Code.

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 context-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/mark-life/agent-skills/context-doctor/github.svg)](https://agentmods.dev/skills/mark-life/agent-skills/context-doctor)
Your own site
<a href="https://agentmods.dev/skills/mark-life/agent-skills/context-doctor"><img src="https://agentmods.dev/badge/skills/mark-life/agent-skills/context-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 context-doctor

Your own site · 80×15
<a href="https://agentmods.dev/skills/mark-life/agent-skills/context-doctor"><img src="https://agentmods.dev/badge/skills/mark-life/agent-skills/context-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 72 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,678 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.00072 $0.04678
Opus 5 $0.00036 $0.02339
Sonnet 5 $0.00014 $0.00936
Haiku 4.5 $0.00007 $0.00468

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

Security

Grade A, and why

context-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.

Reads agent configuration directorieslowAgent snooping

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

find ~/.claude/projects -type d -name workflows 2>/dev/null | head

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/inspect-and-debug/context-doctor/SKILL.md · 199 lines

How it starts

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

Context Doctor

Every session opens with a fixed tax paid before the user speaks: system prompt, tool definitions, MCP servers, plugins, skill descriptions, subagents, memory/rules files. Some is load-bearing; much is junk — unused in this repo yet shipped every turn, shrinking the window and feeding rot. This skill is the cleanup pass. Run it on "why is my context so full", token-budget triage, or after the user connects a pile of tools/MCP/skills.

You are the instrument — you can see your own loaded context. Read what you were actually given this session and cross-check it against real usage; don't guess what the harness injects.


The surfaces

Split by who controls it:

  • Harness-injected — system prompt, the core-loop scaffolding, provider attachments. Mostly unchangeable; account for it. But less is truly fixed than it looks: on the Anthropic harness many built-in tools and whole feature subsystems are now switch-off-able — see Fix G.
  • User-controlled (your target):
    • Tool definitions — built-ins plus every MCP/connector tool. Usually the largest, most ignorable chunk. Built-in tools you never use in this repo (plan mode, notebooks, artifacts, cron, the ask-question UI…) can be denied by name.
    • Feature subsystems — bundled-skill catalogues, the multi-agent workflow engine, remote control, connectors. Each ships its own tool defs; many drop with a single flag.
    • MCP servers — project, user-level, and provider-synced "connectors" (enabled on a vendor site, synced down).
    • Plugins — bundle their own tools/skills/MCP.
    • Skills — each auto-loadable one spends its name + description every turn just to stay discoverable.
    • Subagents — each definition costs tokens.
    • Memory & rulesCLAUDE.md / AGENTS.md / memory indexes at every scope; always-on, paid every turn.

Method

1. Measure. Inventory your own context, concretely:

  • tools grouped by origin (built-in vs. each MCP server / connector / plugin); flag namespaces you never call here.
  • skills + descriptions; auto-loaded vs. invoke-only.
  • MCP servers and where each is configured.
  • subagents and memory/rules in effect.

Read the full file on GitHub · 199 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. 10d ago First seen · 199 lines · 72 tokens per session scan A f0bce12698a9

Subscribe to this mod's changes

context-doctor is a skill published in the GitHub repository Mark-Life/agent-skills (2 stars, last pushed 26d ago), licensed MIT. It adds 72 tokens to every session and 4,678 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A 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.

Related

Other skills, from other repositories

wiki

LLM Wiki — persistent markdown knowledge base that compounds across sessions (Karpathy model).

Yeachan-Heo/oh-my-claudecode · 19 tokens

remember

Review reusable project knowledge and decide what belongs in project memory, notepad, or durable docs.

Yeachan-Heo/oh-my-claudecode · 20 tokens

context-fundamentals

This skill should be used when the user asks to "understand context", "explain context windows", "design agent architecture", "debug context issues", "optimize context usage", or discusses context components, attention mechanics, progressive disclosure, or context budgeting. Provides foundational understanding of…

foryourhealth111-pixel/Vibe-Skills · 69 tokens

knowledge-steward

A knowledge-management helper that saves useful prompts, solutions, ideas, patterns, and workflow notes to an Obsidian knowledge base. Obsidian is a local app for organizing linked notes.

foryourhealth111-pixel/Vibe-Skills · 85 tokens

digital-brain

This skill should be used when the user asks to "write a post", "check my voice", "look up contact", "prepare for meeting", "weekly review", "track goals", or mentions personal brand, content creation, network management, or voice consistency.

foryourhealth111-pixel/Vibe-Skills · 57 tokens

moai-foundation-context

Manages context window optimization, session state persistence, and token budget allocation for multi-agent workflows. Use for token budget management, context limits, or session handoff across agents.

modu-ai/moai-adk · 41 tokens