claude-session-doctorlisted
Install: claude install-skill MLliu6/lMl_skills
# claude-session-doctor
**English** | [中文](#中文)
A first-aid kit for the two things that most often break a long Claude Code
session: **the disk fills up**, and **`--resume` history goes wrong** (missing,
out of order, or truncated). It is a set of small, self-contained scripts that
**diagnose read-only** and fix exactly one thing — resume ordering — and only
when you explicitly ask with `--apply`.
## What it assumes (and nothing more)
Only the generic Claude Code layout:
```
${CLAUDE_CONFIG_DIR:-~/.claude}/projects/<encoded-cwd>/<session-id>.jsonl
```
`<encoded-cwd>` is your working directory with the path separators encoded (e.g.
`/home/alice/work/myproject` → `-home-alice-work-myproject`). Each
`<session-id>.jsonl` is one conversation; `--resume` lists these files. No host,
account, or environment specifics are baked in.
## The two failure families
### A. Disk full / ENOSPC / `/tmp` full
Symptoms: writes fail with `ENOSPC`, a tool reports "no space left on device",
or Claude Code cannot save. Causes are usually one of:
- a filesystem at **100% bytes** (`df`);
- a filesystem out of **inodes** even though bytes look free (`df -i`);
- a big directory/file you forgot about (`du`, large-file scan);
- **deleted-but-still-open files** — space that `du` cannot see because a running
process still holds the handle. Restarting that process reclaims it.
### B. `--resume` history missing / reverted / out of order / truncated
- **Missing/reverted**: the transcript store moved