skills/claude-doctor-session-diagnostics/SKILL.md
```markdown --- name: claude-doctor-session-diagnostics description: Diagnose Claude Code sessions for behavioral anti-patterns and auto-generate CLAUDE.md rules from transcript history triggers: - analyze my claude sessions - diagnose claude code behavior - generate CLAUDE.md rules from history - check for edit thrashing in my sessions - why does claude keep making the same mistakes - audit my claude transcript history - find anti-patterns in my AI coding sessions - create rules
npx skillsauth add aradotso/trending-skills skills/claude-doctor-session-diagnosticsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
---
name: claude-doctor-session-diagnostics
description: Diagnose Claude Code sessions for behavioral anti-patterns and auto-generate CLAUDE.md rules from transcript history
triggers:
- analyze my claude sessions
- diagnose claude code behavior
- generate CLAUDE.md rules from history
- check for edit thrashing in my sessions
- why does claude keep making the same mistakes
- audit my claude transcript history
- find anti-patterns in my AI coding sessions
- create rules from my claude session history
---
# claude-doctor Session Diagnostics
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
`claude-doctor` reads your `~/.claude/` JSONL transcripts, scores them for structural and behavioral anti-patterns, and generates ready-to-paste rules for `CLAUDE.md` or `AGENTS.md`.
## Install
```bash
# Global install
npm i -g claude-doctor
# Or run without installing
npx claude-doctor
# Analyze all sessions (default)
claude-doctor
# Analyze a specific session by ID
claude-doctor <session-id>
# Analyze a specific JSONL file directly
claude-doctor path/to/session.jsonl
# Filter to a named project
claude-doctor -p myproject
# Generate rules for CLAUDE.md / AGENTS.md
claude-doctor --rules
# Save model and guidance to .claude-doctor/
claude-doctor --save
# Output results as JSON (for piping/scripting)
claude-doctor --json
# Combine flags
claude-doctor -p myproject --rules --json
| Signal | Meaning |
|---|---|
| edit-thrashing | Same file edited 5+ times in one session |
| error-loop | 3+ consecutive tool failures without approach change |
| excessive-exploration | Read-to-edit ratio above 10:1 |
| restart-cluster | Multiple sessions started within 30 minutes |
| high-abandonment-rate | Most sessions have fewer than 3 user messages |
| Signal | Meaning |
|---|---|
| correction-heavy | 20%+ of user messages start with "no", "wrong", "wait" |
| keep-going-loop | User repeatedly says "keep going" / "continue" |
| repeated-instructions | Same instruction rephrased within 5 turns (Jaccard >60%) |
| negative-drift | Messages get shorter and more corrective over time |
| rapid-corrections | User responds within 10s of agent output |
| high-turn-ratio | User sends 1.5x+ messages per agent response |
Lexical scoring uses AFINN-165 sentiment with custom agent tokens (undo, revert, wrong, broken, etc.).
--rules)The most actionable feature — scans your full history and outputs rules tuned to your actual patterns:
claude-doctor --rules
Example output:
## Rules (auto-generated by claude-doctor)
Based on analysis of 838 sessions. Paste into your CLAUDE.md or AGENTS.md.
- Read the full file before editing. Plan all changes, then make ONE complete edit.
- After 2 consecutive tool failures, stop and change your approach entirely.
- When the user corrects you, stop and re-read their message.
- Complete the FULL task before stopping.
- Every few turns, re-read the original request to make sure you haven't drifted.
Paste the output directly into your project's CLAUDE.md or AGENTS.md.
--save)claude-doctor --save
Creates .claude-doctor/ in the current directory with:
model.json — signal baselines and project profilesguidance.md — agent-readable rules suitable for CLAUDE.md inclusion or hook injectionYou can reference guidance.md from your CLAUDE.md:
<!-- CLAUDE.md -->
# Project Rules
<!-- Auto-generated diagnostics -->
{{include .claude-doctor/guidance.md}}
Or source it in a hook script:
#!/bin/bash
# .claude/hooks/pre-session.sh
cat .claude-doctor/guidance.md
# Pipe into jq for signal filtering
claude-doctor --json | jq '.signals[] | select(.severity == "high")'
# Save report
claude-doctor --json > session-report.json
# Check a specific project's signals
claude-doctor -p myproject --json | jq '.signals[].name'
Example JSON shape:
{
"sessions": 838,
"project": "myproject",
"signals": [
{
"name": "edit-thrashing",
"severity": "high",
"count": 14,
"description": "Same file edited 5+ times in one session"
},
{
"name": "correction-heavy",
"severity": "medium",
"count": 23,
"description": "20%+ of user messages are corrections"
}
],
"sentiment": {
"score": -0.42,
"label": "negative"
}
}
# Full audit with saved model
claude-doctor --save
# Review guidance
cat .claude-doctor/guidance.md
# Generate rules scoped to one project
claude-doctor -p myproject --rules > /tmp/new-rules.md
# Append to existing CLAUDE.md
echo "" >> CLAUDE.md
cat /tmp/new-rules.md >> CLAUDE.md
# Find recent session IDs in ~/.claude/
ls ~/.claude/
# Analyze one session
claude-doctor abc123-session-id
# Or point at the file directly
claude-doctor ~/.claude/projects/myproject/abc123.jsonl
#!/bin/bash
# scripts/check-sessions.sh
SIGNALS=$(claude-doctor --json | jq '[.signals[] | select(.severity == "high")] | length')
if [ "$SIGNALS" -gt 0 ]; then
echo "High-severity session signals detected:"
claude-doctor --json | jq '.signals[] | select(.severity == "high")'
exit 1
fi
The package exposes internal modules if you want to integrate diagnostics into your own tooling:
import { analyzeSessions, generateRules } from 'claude-doctor';
// Analyze all sessions
const report = await analyzeSessions({
project: 'myproject', // optional filter
jsonl: undefined, // optional path to specific file
});
console.log(report.signals);
console.log(report.sentiment);
// Generate CLAUDE.md rules from report
const rules = generateRules(report);
console.log(rules);
import { analyzeFile } from 'claude-doctor';
// Analyze a single JSONL transcript
const result = await analyzeFile('~/.claude/projects/myproject/session.jsonl');
for (const signal of result.signals) {
console.log(`${signal.name} (${signal.severity}): ${signal.description}`);
}
git clone https://github.com/millionco/claude-doctor
cd claude-doctor
pnpm install
pnpm build
pnpm test
# Run locally against your own sessions
node dist/cli.js --rules
No sessions found
~/.claude/. Run at least one Claude Code session first.ls ~/.claude/projects/ to confirm transcript directories exist.--rules produces generic output
-p myproject to scope rules to a specific project's patterns.Permission errors reading ~/.claude/
chmod -R u+r ~/.claude/
JSON output is empty signals array
high-abandonment-rate signal.TypeScript errors when importing
# Ensure you're on a compatible Node version
node --version # requires Node 18+
pnpm build # rebuild after pulling updates
development
```markdown --- name: compose-performance-skills description: Install and use the skydoves/compose-performance-skills agent skill library to diagnose and fix Jetpack Compose performance issues including stability, recomposition, lazy layouts, modifiers, side effects, and build configuration. triggers: - "my composable recomposes too often" - "LazyColumn drops frames during scroll" - "diagnose Compose stability issues" - "fix unnecessary recomposition in Jetpack Compose" - "optimize Com
development
Headless iOS Simulator manager with host-side HID input injection, 60fps streaming, and device farm web UI for iOS 26
development
```markdown --- name: claude-code-game-studios description: Turn Claude Code into a full 49-agent game dev studio with 72 workflow skills, automated hooks, and a real studio hierarchy for Godot, Unity, and Unreal projects. triggers: - "set up claude code game studios" - "use ai agents for game development" - "set up game dev studio with claude" - "add game studio agents to my project" - "how do I use claude code for game dev" - "set up godot unity unreal ai workflow" - "49 agents g
development
```markdown --- name: xq-py-quantum-vm description: Python implementation of the Quip Network's quantum virtual machine (xqvm) triggers: - quantum virtual machine python - xqvm quip network - quantum circuit simulation python - xq-py quantum vm - quip network quantum python - simulate quantum gates python - quantum vm xqvm - xqvm-py quantum circuit --- # xq-py Quantum Virtual Machine > Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection. `xqvm-py` is a Python impl