ctx-doctor
Troubleshoot ctx behavior. Runs structural health checks, analyzes event log patterns, and presents findings with suggested actions.
Best use case
ctx-doctor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Troubleshoot ctx behavior. Runs structural health checks, analyzes event log patterns, and presents findings with suggested actions.
Teams using ctx-doctor should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ctx-doctor/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How ctx-doctor Compares
| Feature / Agent | ctx-doctor | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Troubleshoot ctx behavior. Runs structural health checks, analyzes event log patterns, and presents findings with suggested actions.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
Diagnose ctx problems by combining structural health checks with event log analysis. ## When to Use - User says "doctor", "diagnose", "troubleshoot", "health check" - User asks "why didn't my hook fire?" - User says "hooks seem broken" or "context seems stale" - User says "too many nudges" or "something seems off" - User asks "what happened last session?" ## When NOT to Use - User wants a quick status check (use `/ctx-status`) - User wants to fix drift (use `/ctx-drift`) - User wants to change hook messages (use `ctx hook message`) - User wants to pause hooks (use `/ctx-pause`) ## Diagnostic Playbook Follow this triage sequence: ### Phase 1: Structural Baseline Run `ctx doctor --json` to get the full structural health report. ```bash ctx doctor --json ``` Parse the JSON output. Note any warnings or errors. ### Phase 2: Event Log Analysis (if available) If the doctor report shows event logging is enabled, query recent events: ```bash ctx hook event --json --last 100 ``` If the user is asking about a specific hook: ```bash ctx hook event --hook <hook-name> --json --last 20 ``` If event logging is not enabled, note: "Enable `event_log: true` in `.ctxrc` for hook-level diagnostics." ### Phase 3: Targeted Investigation Based on findings, check additional sources: - **Hook config**: read `.claude/settings.local.json` to verify hook registration - **Custom messages**: run `ctx hook message list` to check for silenced hooks - **RC config**: read `.ctxrc` to check configuration - **Reminders**: run `ctx remind list` for pending reminders ### Phase 4: Present Findings Structure your report as: ``` ## Doctor Report ### Structural health - Summarize ctx doctor results ### Event analysis (if available) - Patterns, gaps, or anomalies in event data - Specific hook behavior observations ### Suggested actions - [ ] Actionable items based on findings ``` ### Phase 5: Suggest, Don't Fix Present actionable next steps but do NOT auto-fix anything. The user decides what to act on. ## Available Data Sources | Source | Command | What it reveals | |----------------------|------------------------------------------|-----------------------| | Structural health | `ctx doctor --json` | All mechanical checks | | Event log | `ctx hook event --json --last 100` | Recent hook activity | | Event log (filtered) | `ctx hook event --hook <name> --json` | Specific hook | | Reminders | `ctx remind list` | Pending reminders | | Hook messages | `ctx hook message list` | Custom vs default | | RC config | Read `.ctxrc` | Configuration | ## Graceful Degradation If event logging is not enabled, the skill still works with reduced capability. Run `ctx doctor` for structural checks and note that event-level diagnostics require `event_log: true` in `.ctxrc`.
Related Skills
ctx-verify
Verify before claiming completion. Use before saying work is done, tests pass, or builds succeed.
ctx-skill-creator
Create, improve, test, and deploy skills. Full skill lifecycle from intent to working skill file.
ctx-sanitize-permissions
Audit tool permissions for dangerous or overly broad entries. Use to ensure safe agent configuration.
ctx-recall
Browse session history. Use when referencing past discussions or finding context from previous work.
ctx-prompt
Apply, list, and manage saved prompt templates from .context/prompts/. Use when the user asks to apply, list, or create a reusable template like code-review or refactor.
ctx-journal-normalize
Normalize journal source markdown for clean rendering. Use after journal site shows rendering issues: fence nesting, metadata formatting, broken lists.
ctx-import-plans
Import plan files into project specs directory. Use to convert external plans into project-tracked specs.
ctx-compact
Archive completed tasks and trim context. Use when context files are growing large.
ctx-check-links
Audit docs for dead links. Use before releases, after restructuring docs, or when running a documentation audit.
ctx-add-task
Add a task. Use when follow-up work is identified or when breaking down complex work into subtasks.
ctx-add-learning
Record a learning. Use when discovering gotchas, bugs, or unexpected behavior that future sessions should know about.
ctx-add-decision
Record architectural decision. Use when a trade-off is resolved or a non-obvious design choice is made that future sessions need to know.