session-cleanup
Skill0 starsChanged 9 months agoMITView on GitHub
End-of-session cleanup that syncs all persistent state. Use when the user says "cleanup", "wrap up", "end session", "save state", "sync everything", or "/cleanup". Performs four phases: (1) Vault update + session note, (2) Auto memory sync, (3) Error learnings check, (4) Git commit and push.
- Reads credentials
7 other projects use a version of this.
Adopted by
Most recently taken up by
- edloidas/skillstheir own version, first seen Nov 1, 2026
- apappascs/claude-code-sessionstheir own version, first seen Nov 1, 2026
- FuDesign2008/open-skillstheir own version, first seen Nov 1, 2026
- ArcanEdge-AI/coding-agent-playbook-codextheir own version, first seen Aug 17, 2026
- Tourbillon-cpu/claude-skillstheir own version, first seen Jul 16, 2026
- ArcanEdge-AI/coding-agent-playbook-claude-codetheir own version, first seen Jul 8, 2026
Used with
Projects with it also use handoff.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- FuDesign2008/open-skills★ 6same name
- ArcanEdge-AI/coding-agent-playbook-codex★ 3same name
- apappascs/claude-code-sessions★ 2same name
- edloidas/skills★ 2same name
- ArcanEdge-AI/coding-agent-playbook-claude-code★ 0same name
- ChristopherA/claude_code_tools★ 0same name
- Tourbillon-cpu/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 repository9 other files it gives its agents.
- templates/CLAUDE.mdCLAUDE.md
- audit-instructionsSkill
- index-codebaseSkill
- meeting-notesSkill
- project-statusSkill
- red-teamSkill
- retroSkill
- session-handoffSkill
- session-startSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 10 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
10
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
Run all four phases in order.
- Very specific: line 16
All paths come from agent-os.config.json.
- Very specific: line 20
Read ~/.claude/cache/session-context.json for detectedProject and vaultProjectPath.
- Distinctive: line 21
If null, infer from conversation context (files touched, topics discussed).
- Distinctive: line 26
Update with significant changes, decisions, or new context from this session.
- Very specific: line 28
If the project's status changed (e.g., went from active to complete, or a major milestone was hit), update the status: field in the README …
- Very specific: line 50
Read MEMORY.md -- add new projects, tools, or environment facts discovered this session
- Distinctive: line 52
Keep concise (max ~200 lines, loaded into every session prompt)
- Distinctive: line 53
Don't duplicate info the project index already captures (status, summary, last session -- those come from vault READMEs automatically)
- Very specific: line 57
If errors or new patterns occurred this session, suggest running /retro for thorough capture.
- Distinctive: line 66
If no new errors, report "No new patterns" and move on.
- Distinctive: line 73
If changes exist: stage relevant files, commit with descriptive message
- Very specific: line 75
Avoid committing .env, secrets, caches, node_modules
- Distinctive: line 76
If clean, report "Already up to date"
- Very specific: line 91
All paths come from agent-os.config.json -- never hardcode user-specific paths
- Distinctive: line 92
Always ask before pushing to remote (unless user explicitly pre-authorized)
- Distinctive: line 93
Never commit .env files or secrets
“Common” is measured: kept by at least 6 in 10 of the 6 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
Session Cleanup
Run all four phases in order. Report a brief summary after each.
Phase 1: Vault Update
All paths come from agent-os.config.json.
Detect the project
Read ~/.claude/cache/session-context.json for detectedProject and vaultProjectPath.
If null, infer from conversation context (files touched, topics discussed).
Update project README
Read <vaultPath>/<vaultProjectPath>/README.md.
Update with significant changes, decisions, or new context from this session.
If the project's status changed (e.g., went from active to complete, or a major milestone was hit), update the status: field in the README frontmatter. The session-start index reads this field, so keeping it current matters.
Create session note
Create <vaultPath>/Sessions/YYYY-MM-DD-<topic>.md with:
---
date: YYYY-MM-DD
tags: [session, {project-tag}]
project: {vault-folder-name}
---The project: field MUST match the vault folder name exactly (e.g., Agent-OS, Job-Search). This feeds the session-start project index. Use "general" if no specific project applies.
Include: what was done (bullets), current state, next steps. Keep it concise -- under 30 lines of content. Only add Decisions or Blockers sections if they have content.
Phase 2: Auto Memory
Memory directory comes from agent-os.config.json.
- Read
MEMORY.md-- add new projects, tools, or environment facts discovered this session - Correct anything that turned out wrong
- Keep concise (max ~200 lines, loaded into every session prompt)
- Don't duplicate info the project index already captures (status, summary, last session -- those come from vault READMEs automatically)
Phase 3: Error Learnings
If errors or new patterns occurred this session, suggest running /retro for thorough capture.
For quick cleanup without a full retro: only add to error-patterns.md if there was a genuinely new, likely-to-recur error pattern. Follow the existing format:
### [Short descriptive title]
**What happened:** [Specific error]
**Rule:** [What to do instead]If no new errors, report "No new patterns" and move on.
Phase 4: Git Sync
For each project repo worked on:
git statusto check for uncommitted changes- If changes exist: stage relevant files, commit with descriptive message
- Push to remote
- Avoid committing
.env, secrets, caches,node_modules - If clean, report "Already up to date"
Output
Print one-line summary per phase:
Cleanup complete:
Vault: Updated <project>/README.md + created session note
Memory: Added N entries to MEMORY.md (or: No changes)
Errors: No new patterns (or: Added N patterns / Suggest /retro)
GitHub: Pushed to repo-name (or: Already up to date)Rules
- All paths come from agent-os.config.json -- never hardcode user-specific paths
- Always ask before pushing to remote (unless user explicitly pre-authorized)
- Never commit .env files or secrets
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.

