save-state
Skill71 starsChanged 7 months agoMITView on GitHub
Dump the current working context into production/session-state/active.md as a session checkpoint, AND write an atomic per-task checkpoint to .tasks/checkpoints/[task_id].md when a task ID is provided. Session checkpoint is automatically read by session-start.sh at the next session start and surfaced by pre-compact.sh before context compaction. Per-task checkpoints are used by /resume-from [task_id] to restore granular cognitive state at the exact point of failure. Parse $ARGUMENTS to extract: Before writing anything, collect the following from the current conversation and working state: If…
3 other projects use a version of this.
Adopted by
Most recently taken up by
- collectifweb/claude-skillstheir own version, first seen Oct 17, 2026
- tylerzonk/save-statetheir own version, first seen Aug 4, 2026
- bitan-del/claude-skill-save-statetheir own version, first seen May 30, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- collectifweb/claude-skills★ 4same name
- bitan-del/claude-skill-save-state★ 2same name
- tylerzonk/save-state★ 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 repository117 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-healthSkill
- agent-styleSkill
- angular-best-practicesSkill
- annotateSkill
- api-designSkill
- architecture-decision-recordsSkill
- aws-serverlessSkill
- backend-architectSkill
- backend-patternsSkill
- brainstormSkill
- bug-reportSkill
- changelogSkill
- claude-apiSkill
- cloud-architectSkill
- cloud-run-puppeteerSkill
- code-review-checklistSkill
- code-reviewSkill
- code-simplificationSkill
- codex-sddSkill
- commitSkill
- context-engineeringSkill
- database-architectSkill
- db-reviewSkill
- deep-interviewSkill
- design-reviewSkill
- design-systemSkill
- devops-deploySkill
- diagnoseSkill
- django-patternsSkill
- docker-patternsSkill
- dotnet-backend-patternsSkill
- dreamSkill
- drizzle-orm-expertSkill
- estimateSkill
- event-sourcing-architectSkill
- fastapi-proSkill
- fork-joinSkill
- freezeSkill
- frontend-designSkill
- frontend-patternsSkill
- frontend-ui-dark-tsSkill
- gate-checkSkill
- gemini-api-integrationSkill
- gitlab-ci-patternsSkill
- guardSkill
- handoffSkill
- hotfixSkill
- hybrid-cloud-architectSkill
- kubernetes-architectSkill
- laravel-patternsSkill
- launch-checklistSkill
- learnerSkill
- llm-app-patternsSkill
- localizeSkill
- map-systemsSkill
- map-workflowSkill
- markdown-injection-scannerSkill
- microservices-patternsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. 0 are common, 4 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Before writing anything, collect the following from the current conversation and working state:
- Very specific: line 36
Files modified: Run git diff --name-only && git diff --staged --name-only && git ls-files --others --exclude-standard to get the current …
- Very specific: line 41
If a note was parsed from $ARGUMENTS, append it to the "Notes" section.
- Very specific: line 45
If so, before writing active.md, extract them to the .claude/memory/ directory:
- Very specific: line 46
Write or update a specific topic file (e.g.
- Very specific: line 47
Update .claude/memory/MEMORY.md with a pointer to that file if it's not already listed.
- Very specific: line 96
If a task_id was parsed in Step 1, write .tasks/checkpoints/[task_id].md:
- Very specific: line 149
Before /clear or starting a new unrelated task
- Distinctive: line 150
When context usage feels high (>60%)
- Distinctive: line 151
After completing a major milestone (phase, feature, design section)
- Distinctive: line 152
Before ending a work session
- Very specific: line 153
When pre-compact.sh warns about no active session state
“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
Dump the current working context into production/session-state/active.md as a session checkpoint, AND write an atomic per-task checkpoint to .tasks/checkpoints/[task_id].md when a task ID is provided.
Session checkpoint is automatically read by session-start.sh at the next session start and surfaced by pre-compact.sh before context compaction.
Per-task checkpoints are used by /resume-from [task_id] to restore granular cognitive state at the exact point of failure.
Steps
1. Parse arguments
Parse $ARGUMENTS to extract:
- task_id (optional): First token matching pattern
^\d{3}or a word without spaces (e.g.042,auth-api). If present, an atomic checkpoint will be written. - note (optional): Remaining text after task_id, used as a note.
2. Gather context
Before writing anything, collect the following from the current conversation and working state:
- Current task: What is the primary task being worked on right now?
- agent_id: Which agent is currently executing (e.g.
backend-developer,qa-engineer)? - Progress: What has been completed in this session? List key milestones.
- Decisions made: What architectural, design, or implementation decisions were made? (These are the most important to preserve.)
- Files modified: Run
git diff --name-only && git diff --staged --name-only && git ls-files --others --exclude-standardto get the current working tree state. - output_snapshot: A concise snapshot of the last significant output — last file written, last test result, last API response shape, or last command output.
- Open questions: What is unresolved or blocked?
- Next step: What is the very next action to take when resuming.
If a note was parsed from $ARGUMENTS, append it to the "Notes" section.
2. Extract Durable Memory (Native System)
Are there any lessons learned, coding patterns established, constraints added, or technical decisions made in this session that apply globally to the project?
If so, before writing active.md, extract them to the .claude/memory/ directory:
- Write or update a specific topic file (e.g.
project_tech_decisions.mdorfeedback_rules.md), ensuring it has the required YAML frontmatter (name,description,type). - Update
.claude/memory/MEMORY.mdwith a pointer to that file if it's not already listed.
3. Write production/session-state/active.md
Overwrite the file with this structure:
# Session State
> Saved: [ISO timestamp]
> Branch: [current git branch]
## Current Task
[One sentence describing what is being worked on]
<!-- STATUS -->
Epic: [epic name or leave blank]
Feature: [feature name or leave blank]
Task: [specific task or leave blank]
<!-- /STATUS -->
## Progress (This Session)
[Bulleted list of what was completed]
## Key Decisions Made
[Bulleted list — include the decision AND the rationale. These survive context loss.]
## Files Being Actively Worked On
[List of files currently modified or in progress]
## Open Questions / Blockers
[List of unresolved items. Mark with [BLOCKED] if waiting on someone.]
## Next Step
[The single most important next action to take when resuming]
## Notes
[$ARGUMENTS if provided, otherwise omit this section]4. Write Atomic Checkpoint (only if task_id was provided)
If a task_id was parsed in Step 1, write .tasks/checkpoints/[task_id].md:
---
task_id: [task_id]
agent_id: [agent currently executing]
saved_at: [ISO timestamp]
status: in_progress
retry_count: 0
backoff_next_s: 2
---
# Checkpoint: [task_id]
## Output Snapshot
[Concise snapshot of the last significant output — last file written, last test result,
last command output, or last API response shape. Max 10 lines.]
## Completed Steps
[Bulleted list of sub-steps already done within this task]
## Next Step
[The exact next action to resume from — be specific enough that a cold-start agent can continue]
## Open Questions
[Unresolved items blocking progress, if any]
## Files Modified
[List of files touched so far in this task]5. Confirm
Print:
✅ Session state saved → production/session-state/active.md
[If task checkpoint written]: ✅ Atomic checkpoint saved → .tasks/checkpoints/[task_id].md
[If memory was extracted]: ✅ Durable memories updated → .claude/memory/MEMORY.md
To resume this task: /resume-from [task_id]
To resume session: read production/session-state/active.md firstWhen to run /save-state
- Before
/clearor starting a new unrelated task - When context usage feels high (>60%)
- After completing a major milestone (phase, feature, design section)
- Before ending a work session
- When
pre-compact.shwarns about no active session state - After any agent failure — pass the
task_idto create a recoverable checkpoint
The
session-start.shhook automatically detects and previewsactive.mdat the start of each new session. Thepre-compact.shhook reads it before compaction to inject it into the summary. Use/resume-from [task_id]to recover a specific task without re-reading the full session.
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.

