doctor

Diagnose and fix Claude Code configuration and session integrity issues.

368|36|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/Ruya-AI/cozempic --skill doctor-ruya-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doctor
Source: https://github.com/Ruya-AI/cozempic/tree/main/plugin/skills/doctor
Command: npx skills add https://github.com/Ruya-AI/cozempic --skill doctor-ruya-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Large or corrupted Claude Code sessions and misconfigured local installations can cause hangs, 400/403 API errors, orphaned agent state, and silent hook failures that waste tokens and break Agent Teams coordination. This Skill provides focused health checks to identify the root causes of session instability and configuration problems so you can repair state before compaction or data loss occurs.

Core Features & Use Cases

  • Comprehensive integrity checks for trust dialog entries, hook acceptance flags, spawned agent model inheritance, and session JSON structure to detect corruption and race-write issues.
  • Tool and artifact diagnosis that finds corrupted tool_use/tool_result blocks, oversized sessions that trigger compaction, orphaned results, stale backups, and disk usage hot spots.
  • Recovery and remediation with an optional --fix mode to automatically clean or repair common issues and preserve Agent Teams by checkpointing state.
  • Use Case: When an Agent Team becomes unresponsive after a session compaction or a spawned subagent starts returning 403 errors, run the doctor checks to locate model mismatches, corrupted files, or missing hooks and recover the team state.

Quick Start

Run the cozempic doctor health checks and apply automatic fixes for any detected issues.

Frequently Asked Questions about doctor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose Claude Code session hangs and configuration issues?

Diagnose Claude Code session hangs by running integrity checks on session JSON files, hook acceptance flags, and agent model inheritance. This process detects corrupted metadata, race-write issues, and oversized sessions that trigger instability before data loss occurs.

Why does my spawned subagent return 403 errors after session compaction?

Spawned subagents return 403 errors after session compaction when agent model inheritance fails or tool_result blocks become corrupted. Diagnosing the local session files locates model mismatches and orphaned state to recover the Agent Teams coordination.

What causes oversized Claude Code sessions and disk bloat?

Oversized Claude Code sessions and disk bloat are caused by accumulating orphaned results, stale backups, and corrupted tool blocks. Running diagnostic checks reports token usage and identifies disk usage hot spots to prevent automatic compaction.

Can I automatically repair corrupted Claude Code session files?

You can automatically repair corrupted Claude Code session files by applying the optional --fix mode. This cleans common issues, preserves Agent Teams coordination by checkpointing state, and remediates silent hook failures without requiring external dependencies.

Does the Claude Code diagnostic repair require external dependencies?

The Claude Code diagnostic repair does not require external dependencies. It performs integrity checks on trust dialog entries, hook flags, and session JSON structure, and applies optional automated fixes entirely within the local installation environment.

When should I run health checks on my local Claude Code installation?

Run health checks on your local Claude Code installation when Agent Teams become unresponsive, sessions trigger compaction, or API errors like 400/403 occur. This detects trust dialog corruption and stale backups before token waste escalates.