Ctx doctor

From ActiveMemory/ctx · View interactive version

Ctx doctor is an AI agent skill from the GitHub repository ActiveMemory/ctx. Troubleshoot ctx behavior. Runs structural health checks, analyzes event log patterns, and presents findings with suggested actions.

How to use this skill

Skill file

Diagnose ctx problems by combining structural health checks with

event log analysis.

When to Use

When NOT to Use

Diagnostic Playbook

Follow this triage sequence:

Phase 1: Structural Baseline

Run ctx doctor --json to get the full structural health report.

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:

ctx hook event --json --last 100

If the user is asking about a specific hook:

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:

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.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.