/simplicity:shift-session [--pr]from simplicity
Hands the current session's work to a fresh child session before the context window bloats. Commits and pushes all work (never to the default branch, never forced, holding back any branch with a secret), updates whichever trackers the project has, writes a self-contained handoff prompt, starts a child session titled "<topic> -> Part N", renames this one "<topic> -> Handed Off", runs /simplicity:cleanup and archives it, or leaves it open when something is pending. Opens a PR only with --pr. Invoked by the user as /simplicity:shift-session [--pr]. Use when the user names /simplicity:shift-session or asks for shift-session by name, including mid-sentence, where the command isn't expanded and reaches the model as text, or when the simplicity context hook reports that context use reached the shift threshold, in which case pass --auto and it asks the user once before acting. Never on a paraphrase of what it does: a request in other words, such as "hand this off to a new session" or "start a fresh chat", is not a request for this skill.
Ships in simplicity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Close this session out safely and hand its work to a fresh child session, so the work goes on with an empty context window. One shift runs steps 0 to 6 in order.
Keep a running pending list from step 1 on. Anything that stops a step from finishing cleanly goes on it. The pending list goes into the handoff prompt and decides step 6. Never repeat a secret's value anywhere, including the pending list and the handoff.
If the session is in plan mode, stop and say that this command commits and pushes, so it can't run in plan mode. If this session's title already ends in "-> Handed Off" (or "-> Handed Off", as the app may return it), stop and say it was handed off already: the work continues in its child.
The arguments this run was given: "$ARGUMENTS". They're empty when there were none.
Turn origin. Before anything else, look at the message that began the current turn: the latest message in the conversation that isn't a tool result. The desktop app refuses start_session and hand_off_to_session on a turn the user didn't start, so this decides whether step 4 can work. A turn the user didn't start is one that began with:
<cross-session-message from="..."> block;<side-sessions-event> message;Nothing later in the turn changes its origin. A hook's message added to the turn (the context hook's included), an AskUserQuestion answer, or a tool result is still part of the turn that message began. A /simplicity:shift-session that arrives inside another session's message is that session's request, not the user's, so it isn't a manual run. The other way round, a turn the user typed is the user's even when the context hook started this skill in it: "automatic run" below is the skill's name for the hook path, not the app's "automated event".
Never decide where the user is, or whether they can answer, from remoteControlActive, remoteControlState or anything else get_session returns. Those fields read "on" while the user sits at the desktop, and the start refusal doesn't depend on them.
On a turn the user didn't start, in the desktop app, replace the rest of step 0 with this, whatever the arguments are. Don't call AskUserQuestion: an answer inside this turn wouldn't let the start through. Write one plain line asking the user to type a short reply in this session, such as "Context is at %. To shift this work to -> Part N, type go here; the app starts a new session only from a message you type." (leave out the percent when no hook or usage tool gave one), and end the turn. Before that line, run step 1 (commit and push, with all its safety rules), so the work is safe on the remote if the reply never comes, and say in the line what was pushed. Nothing else before the reply may update a tracker, rename or start a session. When the user's next message is a yes ("go", "yes", "shift"), that typed turn is the go-ahead for the whole shift: run steps 1 to 6 on it without asking again (step 1 then finds the work already pushed, unless something changed), even if the context hook's message appears on it too. Any other reply is "Not now", handled as below. In the CLI, or any UI with no session tools, the start doesn't depend on the turn, so carry on as below.
Manual run. The user asked for the command by name: their latest message is /simplicity:shift-session, with or without arguments, or names it mid-sentence ("can you run /simplicity:shift-session --pr?"), and the arguments don't include --auto. Asking for it by name is the user's go-ahead for the whole shift: committing, pushing, updating trackers, starting the child, renaming, cleanup and archiving. Don't ask for confirmation.
Automatic run. Anything else: the arguments include --auto, or the skill was invoked because the simplicity context hook said the context reached the threshold. Before anything is committed, pushed or written anywhere, ask the user once with AskUserQuestion:
On "Shift now", run steps 1 to 6 without asking anything else. On anything else, say in one line that the session continues, and stop the skill. Then carry on with what the user had asked before the hook, as if the skill hadn't run: its go-ahead to commit and push doesn't carry over, so don't commit or push unless the user asks for that themselves. Nothing before the answer may commit, push, update a tracker, rename or start a session; reading state is fine.
--pr works the same in both modes.
Work out the repositories this session touched. For each one, read git status --short --branch, git stash list, git worktree list, the current branch, and the default branch (gh repo view --json nameWithOwner,defaultBranchRef, or git symbolic-ref refs/remotes/origin/HEAD). Run git fetch origin so origin/<default> is current.
Transport. Use gh when gh auth status succeeds, otherwise the GitHub MCP server's tools, as /simplicity:just-finish-it describes. Plain git push needs neither. If the remote isn't GitHub, push only and put the PR (when --pr was passed) on the pending list.
Scan before staging. Look at every changed and untracked file. If one holds a credential (an .env file, a key, a token, a connection string with a password, anything named like a secret), never stage it: stage the other files by name, not with git add -A or git add .. Put the held-back file on the pending list with the file and the kind of secret, never the value.
On the default branch, move the work to a new branch. If the current branch is the default branch and it has uncommitted changes or commits its remote doesn't have, run git switch -c shift/<topic-slug> (the topic from step 3, lowercase, words joined by dashes) and carry on there. The local commits on the default branch come along on the new branch. Put one item on the pending list: "the local <default> is ahead of origin/<default>. Next: reset it to origin/<default> once the shift/<topic-slug> work is merged." Never push to the default branch.
Then, on the working branch. Run each git step below as its own command, never chained with &&, so a refusal stops only that step. If a permission rule or the auto-mode classifier denies a step, don't retry it, reword it or work around it, and don't stop to ask the user what to do: a denial never ends the shift and never turns into a question. Put the step on the pending list with the next step "approve it in the conversation, or run <the command> yourself", skip the steps that depend on it, and go straight on to step 2. A denied commit leaves the work uncommitted and means nothing to push. A denied push leaves the branch committed locally. Either way the handoff says exactly what's left, and step 6 ends with the Pending finish.
git diff origin/<default>...<branch>, which now includes the handoff commit, and also git log -p origin/<default>..<branch>. The second one shows every commit's own changes: a secret added in one commit and deleted in a later one cancels out of the diff but is still in the history that a push sends. If either holds a secret, don't push the branch, and don't try to fix it during the shift: a commit that deletes the file or adds it to .gitignore leaves the secret in the history. Put the branch on the pending list with the file and the kind of secret, and the next step of rewriting its history (and rotating the secret if it was ever pushed).git push -u origin <branch>. Never force-push. If the push is rejected because the remote moved, don't pull, rebase or merge on your own: put the branch on the pending list.--pr. If the branch has no PR, open one against the default branch (gh pr create, or the MCP create_pull_request), as a draft when the work isn't finished. Without --pr, open no PR, even when the project's CLAUDE.md or your own habits would normally open one.Record each branch's pushed head SHA for the handoff. A clean tree whose branch is already pushed needs no commit and no push; say so.
Detect each tracker; never assume one. Go through every row below and do every one whose evidence is present, before moving on. Write the state of the work: what's done, what's pending, the branch or PR, and that the work continues in " -> Part N". Skip a row whose evidence is absent and say so in the report. Never @mention people, never reassign, and never close or move an item to done unless the work is actually merged.
| Tracker | Present when | Update with |
|---|---|---|
| The tracker named in the project's CLAUDE.md | CLAUDE.md names one (a file, a board, an issue tracker) and how to update it | What CLAUDE.md says. For a file, edit it with the file-editing tool, in the format it asks for |
| Jira | The Atlassian MCP tools are loaded and the session, branch or commits name a Jira key (such as ABC-123) | addCommentToJiraIssue on that key |
| GitHub issues and PRs | The branch has a PR, or the session or commits reference an issue (#123, Fixes #123) | gh issue comment <n> / gh pr comment <n>, or the MCP add_issue_comment |
| Claude task list | The session has a task list with items | TaskUpdate (or TodoWrite): mark finished items completed, leave unfinished ones open and name them in the handoff |
| Claude memory files | The session has a memory directory | Save only facts a future session needs that the repo and the handoff don't hold, per the memory rules; skip it when there are none |
A tracker update that fails goes on the pending list. It doesn't stop the shift.
Topic and part number. Read this session's title (get_session with "self" in the desktop app). The app may return -> HTML-escaped as ->, or as →; read all three as ->, and always write titles with a plain ->. If it reads <topic> -> Part N, keep that topic and use N+1. If it's a specific title someone chose or the app generated from the work, use it as the topic as it is. Only when there's no title, or a generic one such as "New session", name the topic the way /simplicity:rename-session does (2 to 5 words, sentence case, what the work is really about). Then use Part 2. The <topic> -> Part N and <topic> -> Handed Off formats are deliberate, and they override rename-session's rules for these two titles only, dashes included.
Write one prompt that a fresh session can act on without reading this transcript. Write it to the child, in plain markdown:
rename-session's helper with the exact title, as step 5 shows, because /simplicity:rename-session itself would rewrite the title to its own rules.git push origin HEAD:<branch> so the work lands on the same branch and PR. Otherwise tell it which branch to check out.<this session's id> with the session-archive tool. It has nothing pending. Check two things first, because archiving it also archives its side sessions that are idle or share its folder, and removes its folder: if your cwd (get_session with "self") is the parent's cwd, don't archive it, since that would remove the folder you work in; and if list_sessions with {"linked": true} shows sessions the parent started besides you that aren't archived, don't archive it, since they would go with it. In either case tell the user in one line why it was left open. It may still be finishing its last turn when you start. If the archive is refused because it's still working, wait about 30 seconds without blocking (run sleep 30 as a background command, which notifies you when it ends), then try again. Try up to three times in all; if it's still refused, tell the user it can be archived from the sidebar once it's idle."Wherever the prompt goes in step 4, pass its full text. Never pass a placeholder or a reference such as "the prompt above": the child sees only what it's given.
Use the first of these that works, and record each one you tried and why it failed, for the report:
Automatic start. Look for a tool that starts a new session with a prompt and no click, such as start_session or hand_off_to_session in the desktop app; they may be deferred tools to load first. Call one only on a turn the user started (step 0). If one exists, start the child with the handoff prompt in its own worktree, so step 6 can detach it: with start_session, pass initiation: "user_asked" (the user asked for the shift), background (at least 80 characters summing up the handoff's Goal and key constraints, which the app requires with the default fresh context), use_worktree: true and source_branch set to the working branch. A child that shares this session's folder can't be detached, and archiving this session would take it and remove the folder. If the tool refuses use_worktree, as it does in a session that moved into its worktree with EnterWorktree, start the child without it and let step 6's guard decide. hand_off_to_session gives the child a new worktree only when this session has its own; from a plain checkout it shares the folder, so prefer start_session. Then title it " -> Part N" with the session title tool if the start call took no title. If the user is watching, it can be opened beside this one.
If the start is refused, by either tool, look at what the refusal says. One that names a missing or invalid parameter is a call error: fix the call and send it once more. Any other refusal gets no retry and no guess at its cause: take the next option, and quote the refusal's own text, word for word, in the chip's tldr and in the report's Child session line. Never say the refusal came from Remote Control, the user being away, or anything else the refusal text doesn't say.
One-click chip. In the desktop app without such a tool, or when the start was refused, call spawn_task with the handoff prompt as prompt, " -> Part N" as title, and a tldr saying this session is handing off at its context limit. The user starts it with one click.
No session tools. In the CLI, an IDE extension, or any UI without either tool, print the handoff prompt in a fenced code block and suggest starting the child with:
claude "<the handoff prompt>"
Say that the child should be renamed " -> Part N" once it starts, which the prompt's first line asks it to do.
The handoff happens even when the pending list isn't empty. That's when the child needs it most.
Rename this session " -> Handed Off", with the same topic as the child. In the desktop app use the session title tool with "self". In the CLI run rename-session's helper directly, since its title rules don't allow this format:
python3 "${CLAUDE_SKILL_DIR}/../rename-session/scripts/rename-session.py" "<topic> -> Handed Off"
Then mark the session handed off, so the context hook stops suggesting shifts in it:
python3 "${CLAUDE_SKILL_DIR}/scripts/context-check.py" --mark-handed-off
Run /simplicity:cleanup (the command is /simplicity:cleanup, never bare /cleanup): load it with the Skill tool and follow its checklist, rather than running similar checks from memory. Follow it with these changes, since this skill decides what happens next:
Then write the report as normal markdown:
--pr opened one./simplicity:just-finish-it uses. The child has the same list in its handoff. If the child got the archive line and cleanup then added something, say here that its archive request should be declined.Archive guard. In the desktop app, archiving a session also archives its side sessions that are idle or share its worktree, and by default it removes the archived session's worktree. The archive is refused only while a side session sharing the worktree is mid-turn, so an idle lane or a child whose turn ended first goes with it. Before the archive call:
{"linked": true}. This session's side sessions are the rows whose startedBy is this session's id and that aren't archived. Leave every other row alone, including the session that started this one.detach_session with its id), the child included, so it lives on as a top-level session. A side session whose cwd is this session's folder shares its worktree, and its detach is refused.Then finish with exactly one of these:
"self" as your very last action. The run already counts as the user's agreement to archive.Encoded-preference, timelessness 6/10, last verified with evals on claude-sonnet-5-5 and Claude Code 2.1.310 (2026-11), Haiku and Opus not run; the session tools last probed in desktop app 2.9939.4 (2026-10). The order of a shift and its safety rules (never push to the default branch, never force-push, hold back secrets, archive only with nothing pending) are fixed preferences. It scores 6 because step 4 leans on whichever session tools the host exposes, which change often, and the threshold hook reads Claude Code's internal transcript format and a model-to-window table. On 2026-10-05 the desktop app listed no start_session or hand_off_to_session tool, so step 4 fell back to the chip there. On 2026-10-28, in desktop app 2.9939.4, probe children showed that start_session with use_worktree: true (or left out, from a worktree session) and a fork each get a new worktree, that use_worktree: false shares the parent's, and that detach_session refuses only the shared one. Step 6's archive guard rests on that, and on the archive tool also archiving idle and worktree-sharing side sessions. Step 0's turn-origin check rests on a measured start_session refusal whose text names those turn origins ("this turn runs an automated event, another session's message, or the task another session gave you"), on the app's start_session description, which says the same and now takes an initiation field, and on the Remote Control fields that get_session returns not reflecting where the user is. No live start was probed for this change. Re-check step 0, step 4 and the guard whenever the session tools change, and re-check the hook's measurement after each Claude Code update.
evals/evals.json (opens in a new tab)evals/files/session-auto.md (opens in a new tab)evals/files/session-clean-part2.md (opens in a new tab)evals/files/session-cli.md (opens in a new tab)evals/files/session-default-branch.md (opens in a new tab)evals/files/session-dirty-tree.md (opens in a new tab)evals/files/session-open-pr.md (opens in a new tab)evals/files/session-push-rejected.md (opens in a new tab)evals/files/session-relayed-turn.md (opens in a new tab)evals/files/session-secret.md (opens in a new tab)evals/files/session-shared-worktree.md (opens in a new tab)evals/files/session-side-event.md (opens in a new tab)evals/files/session-side-lanes.md (opens in a new tab)evals/files/session-start-refused.md (opens in a new tab)evals/files/session-trackers.md (opens in a new tab)evals/files/session-typed-go.md (opens in a new tab)evals/files/session-uncommitted-env.md (opens in a new tab)evals/trigger_eval_set.json (opens in a new tab)scripts/context-check.py (opens in a new tab)tests/test_context_check.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
12 skills in this plugin
/call-it-a-dayPuts the current session on hold when the user stops work for the day, so the same work can be picked up at a later date with nothing lost. When the session supervises agents or sessions, it first writes a shutdown task list, stops the dispatchers, lets every in-flight task finish, has each supervised session persist its work, and stops last. Commits any uncommitted work as a WIP commit and pushes it (never to the default branch, never forced, holding back any branch with a secret), updates whichever trackers the project has, saves a handoff note to the project's memory directory, records this session's title and renames it "<topic> -> On hold", and prints a self-contained handoff prompt. It leaves the session open, starts no new session, merges nothing and never marks the work finished. When the work resumes, in this session or in a new one started from the prompt, the session gets its pre-hold title back. Opens a draft PR only with --pr. Invoked by the user as /simplicity:call-it-a-day [--pr]. The everyday phrase "let's call it a day", written without hyphens, is not a request for this skill. Use when the user names /simplicity:call-it-a-day or asks for call-it-a-day by name, including mid-sentence, where the command isn't expanded and reaches the model as text; never on a paraphrase of what it does./cleanupRuns an end-of-session closing checklist, invoked as `/simplicity:cleanup`. Stops background tasks/servers and the containers this session started, flags the volumes and databases it created instead of deleting them, checks the working tree(s) for uncommitted, unpushed, or stashed changes and flags them without auto-committing or discarding anything, removes disposable scratch files, notifies other active sessions only when there's a concrete handoff reason, and reports the session as ready before offering to archive it. Use whenever the user says "wrap this session up", "run the cleanup checklist", "prepare this session for archival", or otherwise wants to close out a session responsibly before it goes idle or gets archived. Not for cleaning up or refactoring code./disk-cleanupFrees disk space safely. It sweeps read-only, lists every reclaimable item with its exact measured size, owner and safety-check results, asks the user through AskUserQuestion, and deletes only what the user picks. Candidates are git worktrees (the session's own, its helper or agent worktrees, and leftovers of finished sessions), the build output inside them (target/, node_modules/, .venv/, dist/, build caches), the session's scratch files, stopped containers, dangling images, unused volumes, the databases it created, and tool caches. By default the scope is the invoking session's own area. With --orchestrator it first orders the sessions it coordinates to run this skill on their own areas, waits for their reports without polling, then sweeps what no live session owns. A worktree or build folder is offered only when it has no uncommitted or untracked changes, its head commit is on a remote or in a live branch, no running process works inside it, and it isn't another live session's worktree; anything with an unknown owner is held. Deletes by absolute path, never with a glob, never prunes, never archives a session, and never deletes on another session's say-so. In plan mode it sweeps and asks, and deletes nothing. Invoked by the user as /simplicity:disk-cleanup [--orchestrator]. The everyday phrases "free up some disk" and "clean up disk space" are not requests for this skill. Use when the user names /simplicity:disk-cleanup or asks for disk-cleanup by name, including mid-sentence, where the command isn't expanded and reaches the model as text, or when another session's message orders this session to run it, which allows the sweep and the question but never a deletion on that message's word; never on a paraphrase of what it does./just-askSweeps the current session (the user's messages, the plan, the task list, and earlier responses) for every question that is still genuinely open, drops anything answerable without the user, and asks the rest through AskUserQuestion in rounds of up to four, each option carrying a recommendation and the reasoning behind it. Invoked by the user as /simplicity:just-ask, optionally with a focus such as "/simplicity:just-ask database". Use when the user names /simplicity:just-ask or asks for just-ask by name, including mid-sentence, where the command isn't expanded and reaches the model as text; never on a paraphrase of what it does./just-finish-itFinalizes the work of an implementation session. Pushes this session's branches, opens any missing pull requests, waits for CI, merges the PRs whose checks pass, deletes their merged branches, syncs the local repositories, runs /simplicity:cleanup, and archives the session when nothing is left pending. When something is still pending (failing CI, missing review, uncommitted work, unfinished tasks), it merges what it safely can, skips archiving, and ends with a report of what remains and the suggested next step for each item. Invoked by the user as /simplicity:just-finish-it at the end of a session or mid-session, optionally scoped to specific PRs or a repository ("/simplicity:just-finish-it 42 57")./just-movePrepares the current session to run unattended for as long as possible, including across usage-limit resets. Sweeps the session for open decisions (reusing just-ask) and for blockers that would stop the run partway, such as permission prompts, missing credentials or tools, disk, unwatched PRs, missing check-ins and context headroom, and asks every question up front through AskUserQuestion. After the user agrees, it fixes what it can: it subscribes to PRs, schedules a resume for after the usage limit resets with an hourly fallback that switches itself off, and writes a handoff note to the project's memory directory. It ends with a readiness report. It never commits, pushes, discards, bypasses a check, changes permission settings or messages a person. In plan mode it asks its questions and defers every fix. Invoked by the user as /simplicity:just-move, optionally with a focus such as "/simplicity:just-move migration". The everyday phrases "just move on" and "keep going without me" are not requests for this skill. Use when the user names /simplicity:just-move or asks for just-move by name, including mid-sentence, where the command isn't expanded and reaches the model as text; never on a paraphrase of what it does.simplicity@eonraider is listed by eonraider/claude-plugins — review the source before installing
npx claudepluginhub eonraider/claude-plugins --plugin simplicity