session-hygiene
Skill0 starsChanged 4 months agoMITView on GitHub
Keep Claude Code sessions effective on large codebases. Consult at the start of complex or long tasks, when a session has gone through two failed correction attempts, when the user asks why quality degraded, when switching to an unrelated task mid-session, or when context feels polluted. Encodes scoping, /clear discipline, restart-over-correct, and compaction awareness.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Design-of-Man/claude-skillstheir own version, first seen Oct 30, 2026
- Thingscorp/skillstheir own version, first seen Sep 25, 2026
- NorkzYT/claude-code-autopilottheir own version, first seen Jun 11, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- NorkzYT/claude-code-autopilot★ 2same name
- Thingscorp/skills★ 1same name
- Design-of-Man/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- angular-enterpriseSkill
- angular-migrationSkill
- characterization-testsSkill
- claude-md-architectSkill
- code-archaeologySkill
- feature-flag-changeSkill
- frontend-review-checklistSkill
- rxjs-modernizeSkill
- session-stateSkill
- strangler-migrationSkill
- tdd-loopSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Prefer: entrypoint + direct dependencies + one test file as convention reference.
- Very specific: line 24
Write acceptance criteria as commands (test/lint/build) into the task's first message or a state file.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- owner: Muskan, added: 2026-07-16, model: claude-sonnet-5, review: quarterly -->Session Hygiene
The five failure patterns and the countermeasure for each
- Kitchen-sink session (unrelated tasks share context) → propose /clear between unrelated tasks; state what will be lost and what to save first.
- Repeated correction (2 failed fixes) → STOP. Do not attempt a third patch on polluted context. Summarize the corrected understanding into a fresh prompt, recommend restart with that prompt.
- Infinite exploration → every investigation gets a scope sentence up front: "answering X by reading Y, Z; not reading beyond."
- Trust-then-verify gap → never assert a check passed without running it in this session. If it wasn't run, say "unverified".
- Repo-loading → include the files the task needs, not directories. Prefer: entrypoint + direct dependencies + one test file as convention reference.
Before long tasks
- Write acceptance criteria as commands (test/lint/build) into the task's first message or a state file.
- For work spanning sessions, maintain
docs/state/<task>.mdwith: decisions made, files touched, next step. Update before context is compacted; assume anything not in a file may be lost to compaction.
Signals to surface to the user proactively
- Context includes > ~3 abandoned approaches → recommend restart.
- Task switched domains → recommend /clear.
- About to exceed a diff budget → recommend splitting (see diff-budget hook).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

