session-cleanup
Skill6 starsChanged 6 days agoMITView on GitHub
End a finished conversation by inventorying temp files, background services, and browser pages this session opened, keeping unique uncommitted work, stopping those services, closing unused pages, and deleting disposable temps. Use for 「清理临时文件」「关闭后台服务」「关闭网页」「清理不用的网页」「会话收尾」「结束前清理」「会话清理」 / session cleanup, clean temp files, stop background services, close unused pages, including when the agent is about to finish and those resources are still around. Do NOT use for merge (merge-discipline), the branch closeout menu or worktree removal (feature-branch-closeout), or a retrospective (learn-and-improve).
7 other projects use a version of this.
Adopted by
Most recently taken up by
- desertcache/agent-ostheir own version, first seen Nov 1, 2026
- edloidas/skillstheir own version, first seen Nov 1, 2026
- apappascs/claude-code-sessionstheir 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
- 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
- desertcache/agent-os★ 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 repository79 other files it gives its agents.
- AGENTS.mdAGENTS.md
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- ai-proxy-disciplineSkill
- analysis-coreSkill
- android-webview-debugSkill
- article-writerSkill
- astrill-controlSkill
- brainstorm-workflowSkill
- browser-debug-toolkitSkill
- clarifying-question-disciplineSkill
- code-design-reviewSkill
- competitive-researchSkill
- completion-evidence-disciplineSkill
- context-budget-disciplineSkill
- decision-fog-disciplineSkill
- delivery-disciplineSkill
- design-approval-gateSkill
- domain-language-disciplineSkill
- effective-web-researchSkill
- essence-diagnosisSkill
- evolution-reviewSkill
- explain-clearlySkill
- feature-branch-closeoutSkill
- figma-pixel-implementSkill
- figma-pixel-verifySkill
- git-branch-protectSkill
- git-commitSkill
- git-conflict-resolveSkill
- git-release-finishSkill
- git-release-startSkill
- git-worktree-disciplineSkill
- goal-driven-queueSkill
- goal-driven-workflowSkill
- go-deploySkill
- hybrid-debugSkill
- intake-interview-disciplineSkill
- jira-fix-queueSkill
- jira-fix-workflowSkill
- jira-readSkill
- jira-status-lifecycleSkill
- jira-status-writebackSkill
- jira-wiki-markupSkill
- known-issue-researchSkill
- learn-and-improveSkill
- merge-disciplineSkill
- multi-agent-debateSkill
- node-version-disciplineSkill
- opsx-jira-fix-queueSkill
- opsx-jira-fix-workflowSkill
- opsx-solve-workflowSkill
- opsx-workspace-gateSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 4 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Run this skill before saying a conversation is finished when this session created temp files, started background services, or opened …
- Distinctive: line 49
Search text that also appears on the check command line identifies the checker.
- Distinctive: line 53
After the stop pass, close browser pages this session opened once the finished task no longer needs them.
- Distinctive: line 59
When several pages were opened for one task, list the session-opened pages to keep and close the other session-opened pages together.
“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 this skill before saying a conversation is finished when this session created temp files, started background services, or opened browser pages, and whenever the user asks to clean those up. Finish the report before the closing message.
Resolve <integration> once and reuse it. Take the remote default branch (git symbolic-ref --short refs/remotes/origin/HEAD, drop the remote prefix). If that ref is missing, use the branch the current checkout tracks. Comparisons below use that name.
Inventory
List what this session actually did, in five groups:
- Paths this session created.
- Background processes and services this session started, with the process id and any port that process bound.
- Browser pages this session opened.
- Uncommitted and untracked paths in the workspace.
- Paths, processes, and pages whose origin is unclear.
Classify each item as unique uncommitted content, a session-started background service, a session-opened browser page, a disposable temp file, or pre-existing user state. Unclear origin is unique uncommitted content.
Show the classified list before stopping anything, closing a page, or deleting anything.
Preserve
For each uncommitted path, compare it with the integration branch:
git diff <integration> -- <path>git show <integration>:<path>
The working-tree file, and any copy already loaded in the conversation, are not that comparison. A section that appears in the conversation and in the working tree, and is absent from the integration ref, is unique uncommitted content.
An empty diff loses nothing if that path is restored, and restoring it needs no discard confirmation. A non-empty diff stays until the user explicitly confirms discard. Before any discard, copy the unique content to a directory outside the delete set and put that directory in the report. The later delete pass does not enter it.
A file the user asked to keep is a deliverable. It stays in the workspace.
Stop
After preserve, stop each background process or service this session started for a task that is now finished. Stop that recorded process id. The port that process bound only checks that same process. A different process now bound to the port stays running. Confirm the recorded process id is gone. The browser that holds the pages stays running. Its unused pages are closed in the next step.
A service the user asked to keep stays running. The report names it and a stop method.
A process that was already running before this session stays running.
Search text that also appears on the check command line identifies the checker. That hit is not the target.
Pages
After the stop pass, close browser pages this session opened once the finished task no longer needs them. Confirm each closed page is gone. Closing those pages leaves the browser running.
A page the user asked to keep stays open. The report names it and how to close it.
A page that was already open before this session, that the user opened, or whose origin is unclear stays open.
When several pages were opened for one task, list the session-opened pages to keep and close the other session-opened pages together. A page only visited on the way to the result is not kept. Pages named in the previous paragraph stay open.
Delete
After pages are closed, list every file proposed for deletion, grouped by class. The delete pass waits for the user to confirm the classified delete list. After that confirmation, delete temp files and directories this session created that are not the deliverable. A one-shot download used as a working input goes away once the task no longer needs it and the user has confirmed. A file the user declines to delete stays and is reported as left in place. Pre-existing user files stay. Unique uncommitted content stays.
The preserve copy sits outside the delete set.
Report
Report fields are in reference.md.
Claim a clean resource closeout only when no session-started service, no session-opened page the finished task no longer needs, and no disposable temp file remain. A kept service or page is a "Left in place" line, not a clean closeout.
Name the owner when that work is still open, and leave the work to that skill:
- A requested merge goes to
merge-discipline. - A branch that is still unmerged, the branch menu, or worktree removal goes to
feature-branch-closeout. - A retrospective goes to
learn-and-improve.
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.

