session-reset
Skill3 starsChanged 9 months agoMITView on GitHub
Reset the session while preserving context. Commits changes, writes a slim PROMPT.md with session-specific state (current task, method, progress), tears down any active team, then guides the user through /clear and context restoration. Use when the context window is getting large, the session needs a fresh start, or when switching focus. Also use when user says "reset", "fresh start", "save and clear", or "write prompt".
- Reads credentials
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- context-optimizerSkill
- session-startSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Check git status for uncommitted changes.
- Very specific: line 34
If the user chooses to commit, use /commit.
- Distinctive: line 36
If the working tree is already clean, tell the user "Working tree is clean — nothing to commit." and move on.
- Distinctive: line 63
Keep it concise — typically 20-40 lines
- Very specific: line 67
If a team is active (check for team config in $CONFIG_DIR/teams/):
- Distinctive: line 69
Read the team config to discover all active members
- Very specific: line 73
Delete the team with TeamDelete
- Distinctive: line 75
If no team is active, tell the user "No active team — skipping teardown." and move on.
- Distinctive: line 79
After teardown, output this message exactly:
- Distinctive: line 89
When the user says "read PROMPT.md" after a /clear:
- Distinctive: line 91
Read PROMPT.md from the project root
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Session reset
Preserve session-specific state in PROMPT.md across a /clear, then restore afterwards.
PROMPT.md captures only session-specific state — current task, method, and progress. Persistent knowledge (user preferences, codebase patterns, dev quirks, workflow lessons) is handled separately by auto-memory and must NOT be included in PROMPT.md.
Workflow
1. Commit and push
Check git status for uncommitted changes. If there are any:
Security check — before staging, scan changed files for secrets. Flag and exclude any files matching
common sensitive patterns (.env*, *.key, *.pem, credentials.*, *secret*, *.token). Warn
the user if any are found and never stage them without explicit confirmation.
Then ask the user:
- Commit and push — stage safe changes, commit with a concise message, and push to the current branch
- Commit only — stage and commit without pushing
- Skip — leave changes as-is
If the user chooses to commit, use /commit. If they also want to push, push after the commit succeeds.
If the working tree is already clean, tell the user "Working tree is clean — nothing to commit." and move on.
2. Write PROMPT.md
Generate PROMPT.md at the project root by reviewing the current session state. PROMPT.md is ephemeral and must never be committed.
# PROMPT.md
## Current task
<!-- What we're working on - the goal, feature, or fix -->
## Method
<!-- Which workflow/approach is active (e.g. OpenSpec, manual, etc.) -->
<!-- Include any active change IDs, branch names, or tracking references -->
## Progress
<!-- Where we are in the process -->
<!-- What's done, what's in flight, what's next -->
<!-- Any blocking issues or open questions -->Guidelines:
- Do NOT include user preferences, codebase patterns, dev quirks, or general knowledge — auto-memory handles that
- Do include task-specific context: current branch, active OpenSpec change, what's done, what's next, blocking issues
- Be specific and actionable — include file paths, branch names, change IDs, and concrete references
- Keep it concise — typically 20-40 lines
3. Tear down team (if active)
If a team is active (check for team config in $CONFIG_DIR/teams/):
- Read the team config to discover all active members
- List the active members to the user and confirm they want to tear down the team
- Send
shutdown_requestto each teammate - Wait for confirmations
- Delete the team with
TeamDelete
If no team is active, tell the user "No active team — skipping teardown." and move on.
4. Guide the user
After teardown, output this message exactly:
Session state saved to PROMPT.md. All agents shut down.
Run `/clear` now, then tell me: **read PROMPT.md**5. Restore (post-clear)
When the user says "read PROMPT.md" after a /clear:
- Read PROMPT.md from the project root
- Summarise the restored context to the user
- Resume work based on the progress section
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.

