rotate-session
Skill0 starsChanged 5 months agoMITView on GitHub
Refresh (rotate) the CURRENT Claude session in place — hand off, wrap, then drop and relaunch a fresh same-name successor with an empty context window. Only rotates the session you are inside, and only in a repo that has opted in with a committed .claude/rotate.conf.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- dfrysinger/skillstheir own version, first seen Aug 2, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- dfrysinger/skills★ 3same 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 repository57 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ask-mattSkill
- cast-memberSkill
- check-feedbackSkill
- codebase-designSkill
- content-pipeline-initSkill
- content-pipelineSkill
- data-analystSkill
- decision-mappingSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- draft-asset-promptsSkill
- edit-articleSkill
- fableSkill
- game-concept-interviewSkill
- git-guardrails-claude-codeSkill
- global-guidelinesSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- improve-codebase-architectureSkill
- karpathy-guidelinesSkill
- launch-sessionSkill
- lesson-reviewSkill
- link-claude-skillsSkill
- loop-meSkill
- migrate-to-shoehornSkill
- obsidian-vaultSkill
- opusSkill
- prototypeSkill
- publish-metadataSkill
- resolving-merge-conflictsSkill
- retrieve-lessonsSkill
- reviewSkill
- run-buildSkill
- run-clipsSkill
- scaffold-exercisesSkill
- session-sandboxSkill
- setup-matt-pocock-skillsSkill
- setup-pre-commitSkill
- setup-status-lineSkill
- showrunner-shortSkill
- sonnetSkill
- tddSkill
- teachSkill
- to-issuesSkill
- to-prdSkill
- triageSkill
- verify-outputsSkill
- wrap-allSkill
- wrapSkill
- writing-beatsSkill
- writing-fragmentsSkill
- writing-great-skillsSkill
- writing-shapeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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
- Distinctive: line 40
Run from inside the session you want to refresh.
- Very specific: line 42
Preflight — refuse early if not permitted: Run assets/rotate.sh --preflight.
- Very specific: line 46
Handoff note (inlined): Write the deliberate ## Next Session note (from the focus argument) into the repo's committed handoff file …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
rotate-session — refresh the current session in place
Rotate the current Claude session: preserve continuity to disk, then replace this session with a fresh same-name successor (empty context window). Continuity is reconstructed from committed, pushed files — not from the discarded conversation.
This is the promoted, every-repo version of the sandbox session-sandbox mechanism. The
sandbox is safe because only sbx-* names are targetable; here the guard is self-rotation
only — the sole session this skill can ever kill is the one it is running inside
(target == tmux display-message -p '#S'). A typo or bad config cannot reach another repo's
session.
Activation (why it may refuse)
A repo rotates only if it contains a committed .claude/rotate.conf whose SESSION
equals the live session name. Absent that file, the skill hard-refuses. This is the gate:
the skill is installed in every repo but active only where a config has been added. Until the
mechanism is verified in the sandbox, only the sandbox repo carries a rotate.conf.
.claude/rotate.conf fields:
SESSION=ebiz # REQUIRED: the tmux session name this repo runs under
MODEL=opus # optional: --model for the successor
EFFORT=high # optional: --effort for the successor
RC_NAME=Factory-$(hostname) # optional: --remote-control name (default: SESSION)
PERMISSION_MODE=acceptEdits # optional: --permission-mode for the successor
DELAY=60 # optional: seconds until the successor launches (default 60)Steps (run in this order)
Run from inside the session you want to refresh.
- Preflight — refuse early if not permitted. Run
assets/rotate.sh --preflight. It verifies: inside tmux;.claude/rotate.confpresent; itsSESSIONequals the current session (the self-target guard);systemd-runavailable. OnPREFLIGHT FAIL, print the reason and STOP — change nothing. - Handoff note (inlined). Write the deliberate
## Next Sessionnote (from the focus argument) into the repo's committed handoff file (CONTEXT.md / HANDOFF.md / TODO.md) and commit + push just that file. This is the/handoffaction performed inline:handoffis a user-invoked skill and, per this repo'sdocs/invocation.md, a user-invoked skill (this one) can never invoke another user-invoked skill — so do the note yourself rather than calling/handoff. /wrap— invoke the/wrapskill (it is model-invoked, so this user-invoked skill may call it). It summarises, updates project logs, and commits and pushes everything. Capture the resulting commit SHA (the successor verifies it). If/wrapdoes not push cleanly, ABORT: do not schedule a successor, do not kill. The session stays alive with work intact./wrap's successful push is the hard gate on the irreversible kill.- Rotate — run
assets/rotate.sh <pushed_sha>. It schedules the same-name successor (detached viasystemd-run --user, so it survives this session dying) then does the guarded self-kill. Scheduling happens before the kill, so a scheduling failure leaves the predecessor alive — never a coverage gap. - Report — the session drops now and reappears fresh under the same name in ~
DELAYs; the successor reads the committed handoff and confirms the predecessor SHA before acting.
Assets
assets/rotate-env.sh— the self-target guard (rotate_assert_self,rotate_kill). Source first.assets/rotate.sh—--preflightchecks; else schedule-before-kill (the mechanical half).assets/rotate-launch.sh— launch a same-name successor on a real TTY (tmux pipe-panelogging).assets/rotate-status.sh— read-only: is a session on a TTY and relay-connected?assets/selftest-guard.sh— proves the guard accepts only the current session; run it anywhere.
Notes
- Adding this skill is a global
~/.claudechange → file the FYI issue your project requires. - v1 is manual only. Auto-firing at a context ceiling (~30%) is a separate, later change.
- The sandbox
sbx-*scripts are NOT modified — they remain the isolated dev harness.
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.

