session-state
Skill0 starsChanged 4 months agoMITView on GitHub
Maintain a state file so a task can resume correctly across sessions, compaction, or a handoff to another agent. Use for any task expected to span more than one session, before /clear on an in-progress task, when a session-hygiene check flags an upcoming compaction, or when handing work to a subagent via the Task tool. Without this, decisions and context are lost the moment the session ends.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- NickKostovny/marketing-playbookstheir own version, first seen Nov 8, 2026
- danielvm-git/bigpowerstheir own version, first seen Nov 6, 2026
- Data-Wise/crafttheir own version, first seen Oct 31, 2026
- LazyIsEfficient/agentic-ostheir own version, first seen Oct 22, 2026
- camunda/camundatheir own version, first seen Oct 8, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- camunda/camunda★ 4.4ksame name
- danielvm-git/bigpowers★ 288same name
- LazyIsEfficient/agentic-os★ 17same name
- Data-Wise/craft★ 4same name
- NickKostovny/marketing-playbooks★ 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-hygieneSkill
- strangler-migrationSkill
- tdd-loopSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Before proposing or executing /clear.
- Distinctive: line 34
When session-hygiene flags the context is near compaction.
- Distinctive: line 42
When spawning a subagent to continue or take a slice of this task, pass a self-contained brief — the subagent has no memory of this session:
- Very specific: line 62
Read docs/state/<task-slug>.md in full before touching any code.
- Distinctive: line 63
Treat "Next step" as the literal starting instruction, not a suggestion to re-derive from scratch.
- Distinctive: line 65
If Decisions and current code disagree (code changed since last write), say so before proceeding — don't silently trust a stale file.
“Common” is measured: kept by at least 6 in 10 of the 5 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 State
File location and format
One file per task: docs/state/<task-slug>.md. Four sections, always in
this order, always present even if empty (write "none yet"):
# <task-slug>
## Decisions
- <date/turn> — <decision> — <one-line why>
## Files touched
- <path> — <what changed, one line>
## Next step
<the single next action, stated so a fresh session with no other context
could execute it. Not "continue the refactor" — "run
`npm test -- billing.spec.ts`, fix the 2 failing assertions listed in
Decisions, then move to the pricing module.">
## Open questions
- <question> — <who/what resolves it>Update triggers (write to the file, don't just hold it in context)
- Before proposing or executing
/clear. - When session-hygiene flags the context is near compaction.
- At each natural checkpoint: a phase transition (Explore→Plan, Plan→Code), a passing test run, a merged/committed chunk of work.
- Immediately before spawning a subagent for a related piece of work — write the handoff artifact (below) referencing this file.
- On session end for any task not fully closed out.
Handoff artifact (agent-to-agent, via the Task tool)
When spawning a subagent to continue or take a slice of this task, pass a self-contained brief — the subagent has no memory of this session:
## Objective
<what this subagent must accomplish, one or two sentences>
## Constraints
- Allowed paths: <explicit list, not "the codebase">
- Must not: <hard bans carried over from this task, e.g. "do not modify
the test file", "read-only, report only">
## Prior decisions (from docs/state/<task-slug>.md)
<paste the Decisions section verbatim — don't summarize away specifics>
## Definition of done
<machine-checkable: the exact command(s) that must pass>Resume procedure (start of a session that has a matching state file)
- Read
docs/state/<task-slug>.mdin full before touching any code. - Treat "Next step" as the literal starting instruction, not a suggestion to re-derive from scratch.
- If Decisions and current code disagree (code changed since last write), say so before proceeding — don't silently trust a stale file.
Anti-patterns
- Writing "Next step: continue" — if it can't be executed by a reader with zero other context, it isn't done.
- Letting the file grow unbounded: prune resolved Open questions and superseded Decisions on each update rather than only appending.
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.

