session
Skill0 starsChanged 2 months agoMITView on GitHub
Windows session tools for Claude Code, three jobs in one skill. (1) LAUNCH: open a NEW Claude Code session in a Windows Terminal tab — a fresh scratch folder or a registered workspace alias — only when the user gives an explicit launch verb together with "Claude"/"session" or a workspace (클로드 켜줘, 새 임시 작업 켜줘, 세션 열어줘, <별칭> 폴더 켜줘, open a new claude session). (2) RESUME: reopen an EARLIER session in a new tab (아까 그 세션 다시 켜줘, <별칭> 폴더 이어서 켜줘, reopen my last session). (3) REBOOT-AND-CONTINUE: carry the CURRENT session across a Windows restart — save the next-step prompt, register a one-shot resume, restart, and pick up after logon — for work that needs a restart (Windows Update, driver or feature installs, WSL/Docker/Hyper-V, registry edits) when the user asks to reboot and continue (재부팅하고 이어서 해, reboot and continue); cancelling or checking a scheduled resume (재부팅 취소, 재개 예약 확인) is this skill too. Never fire on a bare mention of a project, product or folder name without a launch verb, and never treat "restart the session" as a request to restart the computer.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- kimkon1011/orgiast-claude-rulestheir own version, first seen Sep 25, 2026
- lesdo/ClaudeCode-ContextPlugintheir own version, first seen Jul 1, 2026
- Surfrrosa/claude-skillstheir own version, first seen Jun 25, 2026
- maxwell2732/claudecode-research-harness-workflowtheir own version, first seen May 29, 2026
- Tiendil/donnatheir own version, first seen May 16, 2026
- anthropics/claude-for-legaltheir own version, first seen May 15, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- anthropics/claude-for-legal★ 9.6ksame name
- xiaobei930/cc-best★ 48same name
- maxwell2732/claudecode-research-harness-workflow★ 40same name
- Tiendil/donna★ 28same name
- lesdo/ClaudeCode-ContextPlugin★ 1same name
- Surfrrosa/claude-skills★ 1same name
- J-Krush/skills★ 0same name
- kimkon1011/orgiast-claude-rules★ 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.
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 6 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Every script lives in this skill's scripts/ folder and runs under PowerShell 7 (pwsh):
- Distinctive: line 60
Gate 1 (when to fire): Run only when the message carries an explicit intent to launch ("open", "turn on", "launch", "fire up", "start a new …
- Very specific: line 75
If the user's phrase matches an alias's triggers, that is the alias.
- Very specific: line 76
If only the name brushes past without a matching trigger, follow that alias's note to the letter — if it names another alias as the …
- Distinctive: line 79
If neither settles it, do not guess.
- Very specific: line 116
If isRepo is true, add: a git repository does not inherit trust from its parent folder.
- Very specific: line 119
Never: write hasTrustDialogAccepted into ~/.claude.json to skip the prompt.
- Distinctive: line 150
When there are several to choose from ("not yesterday's, the one before") or you are not sure, show the list first and let the user pick:
- Distinctive: line 163
Never guess a session id: Use only an id a script returned or one from the list.
- Very specific: line 192
Leave the next-step note: Write the prompt that becomes the resumed session's first input to next-prompt.txt in the state folder …
- Very specific: line 209
Read the REBOOT_PLANNED result before going on:
- Very specific: line 218
If the user wants to restart by hand, add -NoReboot (registers only).
- Distinctive: line 248
If the saved folder is missing at logon (a drive that is not connected yet), nothing is launched and the state is kept.
- Very specific: line 250
If something goes wrong, the log is <home>\.claude\claude-session-kit\kit.log (the prompt body is never written to it).
- Very specific: line 266
When the user says something like "add an alias for this folder too: <name> = <path>":
- Distinctive: line 268
Check that the path really exists (if not, do not create it — ask).
- Very specific: line 269
Ask which phrases should select it (triggers), and whether the bare name can mean something else (note).
- Very specific: line 275
Run list-aliases.ps1 again.
“Common” is measured: kept by at least 6 in 10 of the 4 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 — launch a session · reopen an earlier one · reboot and continue
This skill has real side effects: it opens terminal tabs, and its heaviest branch restarts the computer. So decide which branch applies first (§0), and run a script only after that branch's gate has been passed.
Every script lives in this skill's scripts/ folder and runs under PowerShell 7 (pwsh):
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/<script>.ps1" <arguments>${CLAUDE_SKILL_DIR} is the folder this skill was loaded from. An installed plugin sits in a
versioned cache path, so never memorise or hard-code a location. Every script prints one JSON
object on stdout — branch on ok and code; message is the explanation for the user. Messages
are in English: relay them in the user's language. Any script can also return INTERNAL_ERROR
(exit code 2): relay its message and do not retry blindly.
The rules below apply to the user's words in whatever language they are spoken.
0. Pick the branch — when in doubt, ask instead of running
| The user wants to | Branch | Reversible? |
| open a new session (new scratch task, a registered alias, a path they gave) | §1 Launch | one tab — close it and it is gone |
| reopen an earlier session | §2 Resume | appends to an existing conversation |
| restart the computer and continue this session | §3 Reboot | a restart cannot be undone |
| cancel or inspect a scheduled restart/resume | §4 Cancel / Status | read and clean-up only |
- Continuation words ("continue", "again", "the one from before") do not pick a branch. Attached to an open verb ("open", "turn on", "launch" — or fused with it: "reopen", "resume my last session") they mean §2; attached to "reboot"/"restart the computer" they mean §3. With neither, run nothing and ask.
- A question or a suggestion ("should we restart the session?", "do I need to restart?") is never approval for any branch.
- "Restart the session" is not a restart of the computer. The branch that turns the machine off (§3) is a candidate only when the user spoke of rebooting/restarting the computer or Windows. It is not §2 either — ask what the user wants.
1. Launch — open a new session
Gate 1 (when to fire). Run only when the message carries an explicit intent to launch ("open", "turn on", "launch", "fire up", "start a new …") and its object is Claude / a session or a workspace folder ("open the … folder", "start a new scratch task"). A project, product or folder name that merely comes up in conversation ("I have a question about …") never fires this skill.
Gate 2 (what to open). The alias table is not in this file — it holds personal paths, so it lives
in aliases.json in the state folder. Read it once before deciding:
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/list-aliases.ps1"Each alias has path, triggers (phrases that mean this alias), note (what to do with an ambiguous
or bare mention) and confirm (true = ask before opening even when it looks right). Rules:
- If the user's phrase matches an alias's
triggers, that is the alias. - If only the name brushes past without a matching trigger, follow that alias's
noteto the letter — if it names another alias as the default, use that one; if it says not to fire or to ask, ask. - If neither settles it, do not guess. Ask which folder they mean.
- "A new scratch task / a new test folder" is not an alias — it is
new-temp-task.ps1.
Run.
# create the next scratch folder (<root>\<prefix><N>) and open a session in it
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/new-temp-task.ps1"
# a registered alias
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/open-workspace.ps1" -Alias <name>
# only when the user gave the path themselves
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/open-workspace.ps1" -Path "<absolute path>"The session opens as a new tab in the existing Windows Terminal window (a plain console window when
wt is absent). Its id and folder are recorded in the registry (sessions.jsonl), which is where §2
looks first.
Success codes are LAUNCHED here and RESUMED / PICKER_OPENED in §2. After a rerun with
-AllowUntrusted in a folder that really is untrusted, each becomes <CODE>_UNTRUSTED: the tab is
open but parked on the trust prompt — tell the user to answer it there.
UNTRUSTED_WORKSPACE — no session was started (fail closed)
Claude Code asks once per folder whether the user trusts it, and applies that folder's hooks, MCP servers and permission settings only after the answer. A tab opened by a launcher tends to sit on that prompt unseen, so an untrusted folder is not opened at all. §2 and §3 return the same code with the same meaning. When you get it:
- Say so plainly — this folder is not trusted in Claude Code yet, so no session was started.
- One line on why it matters — that folder's
.claude/settings.jsonhooks and MCP servers run as soon as a session starts there. - Offer the choices:
- Open it themselves — the user goes to the folder in a terminal, runs
claude, and answers the prompt. - Open it anyway — only if the user explicitly says so, rerun the same command with
-AllowUntrusted. The trust prompt appears in the new tab and the user has to answer it.
- Open it themselves — the user goes to the folder in a terminal, runs
- If
isRepois true, add: a git repository does not inherit trust from its parent folder. Even under a trusted parent, the repository (trustKey) has to be trusted on its own.
Never: write hasTrustDialogAccepted into ~/.claude.json to skip the prompt. That accepts trust
on the user's behalf and lets the folder's hooks and MCP settings run unreviewed. Even if the user
asks, do not write it for them — point them to step 3.
Other codes
ALIAS_NOT_FOUND (known lists the registered names), NO_ALIASES, PATH_NOT_FOUND — do not guess
a path; ask the user. CLAUDE_NOT_FOUND — the claude executable could not be located.
2. Resume — reopen an earlier session
Same condition as Gate 1 (an open verb plus a session or folder), with a continuation word attached.
# a session in a particular folder
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/resume-session.ps1" -Alias <name>
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/resume-session.ps1" -Path "<absolute path>"
# no folder mentioned — the newest session this kit opened; if there is none, the newest interactive one anywhere
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/resume-session.ps1"
# a specific session picked from the list
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/resume-session.ps1" -SessionId <uuid>Selection order: (1) the launcher registry (sessions this skill opened) → (2) a scan of
transcripts from the last 30 days (interactive sessions a person started, nothing else) → (3) the
CLI's own picker (claude --resume in that folder; only when a folder is known). chosenFrom in
the result says where the session came from and title says which conversation it is (absent when
the CLI recorded none) — tell the user what was reopened. The registry wins even over a newer
session that was started by hand, so when the user asks for their last session and no folder
narrows it down, look at the list first.
When there are several to choose from ("not yesterday's, the one before") or you are not sure, show the list first and let the user pick:
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/list-sessions.ps1" [-Alias <name> | -Path "<path>"]The list holds the newest -Top rows (default 15) from the last -Days days (default 30). When
total is larger than the number of rows returned, say so, and narrow with -Alias/-Path or rerun
with a larger -Top/-Days (resume-session.ps1 takes -Days too).
Safety rules:
- Never guess a session id. Use only an id a script returned or one from the list.
- The tab always opens in the folder recorded for that session (the script handles it).
- Transcripts left by scheduled or SDK runs are never candidates.
- Never run
claude --continue, not even as a fallback when a script fails — it reopens whatever is newest in the folder, which can append to an automation's conversation. -Fork(resume into a copy, leaving the original untouched) only when the user said to copy it or not to touch the original.PICKER_OPENED— nothing could be chosen automatically, so the CLI picker was opened. The user picks in that tab.NO_RESUMABLE_SESSION— there is nothing to reopen. Ask whether to start a new one (§1); do not silently switch to a new session.
3. Reboot — restart the computer and continue this session
How it works. Two steps. reboot-plan.ps1 works out and shows everything that would be
registered (folder, session to resume, the RunOnce command) and issues a one-time token — this step
changes nothing. Only reboot-commit.ps1 -Token freezes a copy of the resume script, writes
state.json, registers HKCU\…\RunOnce and runs shutdown /r. After logon a terminal opens and runs
claude --resume <session id> -- "<prompt>".
- Confirm with the user — a restart always needs explicit approval in the user's latest message. If the user told you in this turn, in their own words, to restart the computer ("reboot", "reboot and continue"), proceed. Otherwise — a delegation only ("do whatever is needed", "handle it"), an installer demanding a restart, or approval given in an earlier turn — ask first and wait for the answer: the computer needs to restart; restart Windows now and continue automatically after you log back in? A delegation is not standing approval. One turn of friction is cheaper than turning the machine off. A §1 or §2 request ("open", "open it again") can never be approval for this branch.
- Leave the next-step note. Write the prompt that becomes the resumed session's first input to
next-prompt.txtin the state folder (<home>\.claude\claude-session-kit\next-prompt.txt) with the Write tool (guarantees UTF-8). Give Write the expanded absolute path, not a variable. It must say: why the machine was restarted / what is done so far / what to do right after the restart, including a verification command (for example: first check the install withwsl --status). - Session id (if you can): in your own scratchpad path
…\Temp\claude\<project>\<UUID>\scratchpadthe<UUID>is the current session id. If you cannot get it, leave-SessionIdout — the script reads the running session's id from theCLAUDE_CODE_SESSION_IDenvironment variable, and failing that takes the newest interactive transcript in this folder. Never pass an id you are not sure of:SESSION_REJECTEDmeans that id has no transcript, is not an interactive session, or belongs to another folder (recordedCwdsays which). Plan (read-only):
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/reboot-plan.ps1" -WorkDir "<absolute project path>" -PromptFile "<absolute path of next-prompt.txt>" -SessionId <UUID>Read the
REBOOT_PLANNEDresult before going on:sessionMode:resumecontinues that session;freshmeans no session to continue was found and a new session carrying only the prompt will start — tell the user and confirm first.sessionSource:explicitorenvis this session.scan:interactive/scan:sidecaris the newest session found in the folder, which is a different conversation when two are open there — checksessionIdagainst your own, and confirm with the user if you cannot.promptDelivery:filemeansclaudeis an npm-style.cmdshim here, so after logon the prompt is handed over inresume-prompt.txtinstead of on the command line. Nothing to do.
If the user wants to restart by hand, add
-NoReboot(registers only).- Commit (destructive — only with the approval from step 1):
The token expires after ten minutes and works once.pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/reboot-commit.ps1" -Token <token> - Branch on
codeand tell the user.REBOOT_SCHEDULED— the computer restarts indelaySecondsseconds;shutdown /aaborts; after logon a terminal opens by itself and this session continues. Say that, then end the turn at once and make no further tool calls.RESUME_REGISTERED(-NoReboot) — nothing restarts now; the resume fires at the next logon after the user restarts by hand. Say that, then end the turn.SHUTDOWN_FAILED— Windows refused the restart, but the resume is still registered. Say so, offer to cancel it (§4), then end the turn.NO_PLAN,TOKEN_MISMATCH,PLAN_EXPIRED,PLAN_INVALID— nothing was registered. Go back to step 4 and plan again. The approval from step 1 still stands only while it is the user's latest message; otherwise ask again. Never retry with a guessed token, and never editplan.json.
Notes:
- Keep
reboot-commit.ps1out of any permission allowlist. The permission prompt on this one file is the last lock. Every other script is built so that it cannot restart the machine, and the tests check that. - The delay cannot go below 30 seconds (other apps may hold unsaved work).
- Permission prompts behave as usual in the resumed session (nothing is auto-approved).
- Scheduled and SDK sessions are never resume targets. They pile up in the same project folder and are often the newest, but only interactive transcripts are candidates — plus this session's own just-started transcript (a "sidecar"), and only while it is under ten minutes old.
- If the saved folder is missing at logon (a drive that is not connected yet), nothing is launched and the state is kept; the terminal says how to run the resume again.
- If something goes wrong, the log is
<home>\.claude\claude-session-kit\kit.log(the prompt body is never written to it).
4. Cancel / Status — read and clean-up only
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/reboot-cancel.ps1" # abort the scheduled restart + remove RunOnce and state
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/reboot-cancel.ps1" -Status # inspect onlyThis script cannot start a restart. For a "cancel" or "check" request, never run the §3 scripts.
On NOTHING_PENDING, say exactly that: nothing was scheduled. On RUNONCE_NOT_REMOVED, the resume
may still fire at the next logon — tell the user.
Adding or changing an alias
When the user says something like "add an alias for this folder too: <name> = <path>":
- Check that the path really exists (if not, do not create it — ask).
- Ask which phrases should select it (
triggers), and whether the bare name can mean something else (note). - Edit the
aliases.jsonat thefilepath reported bylist-aliases.ps1(confirm before applying); when the code wasNO_ALIASESthe file does not exist yet, so create it. The format is the one in${CLAUDE_SKILL_DIR}/../../examples/aliases.example.json. Apathis an absolute path;%VAR%references in it are expanded. - Run
list-aliases.ps1again.ALIASES_UNREADABLEmeans the JSON is broken — fix it before anything else, because every script that takes-Aliasfails until it parses.
Never write an alias or a path into this SKILL.md or any file in the skill folder. The skill folder is either a git repository or a plugin cache that is replaced on every update — no place for personal paths.
To look for new candidates (read-only):
pwsh -NoProfile -ExecutionPolicy Bypass -File "${CLAUDE_SKILL_DIR}/scripts/list-candidates.ps1"It lists the most-used folders. A row whose alias is not null is already registered — do not offer
it as a new candidate.
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.

