purge — Claude Code skill: remove Nightshift state
The purge Claude Code skill deletes Nightshift state from a project. It prints the .nightshift/ path and waits for the owner to confirm before deletion.
MIT ★ 571 updated 2026-11-16
npx skills add orwa-mahmoud/nightshift --skill purge -a claude-codeWhat purge does
The skill removes a project's Nightshift punch lists, rules, receipts, archives, and history stored in .nightshift/. The Nightshift plugin stays installed. It prints the exact $NS path first, and runs the cleanup only after the owner confirms that path.
The runtime/ns helper resolves the workspace and host, then removes only the validated .nightshift/ directory and, if present, a local .nightshift-link on the opened task root. It rejects symlinks and broad targets such as home directories or /. For a linked task root, pass the opened folder with --project "$TASK_ROOT"; otherwise the host link remains.
What it helps with
- remove Nightshift punch lists and rules from a project
- delete project receipts, archives, and history
- clear the local
.nightshift-linkwhen purging a linked task root
Example prompts for the agent
- Delete this project's Nightshift state, show me the exact path, and wait for my confirmation.
- Remove
.nightshift/and the local.nightshift-linkfrom the opened task root. - Show the
$NSpath and explain what will be deleted before asking me to confirm.
How to install purge
1Skills CLI (Vercel)
npx skills add orwa-mahmoud/nightshift --skill purge -a claude-code2Manually: put the files in place
~/.claude/skills/purge/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/purge/
1Skills CLI (Vercel)
npx skills add orwa-mahmoud/nightshift --skill purge -a codex2Manually: put the files in place
.agents/skills/purge/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add orwa-mahmoud/nightshift --skill purge -a cursor2Manually: put the files in place
.cursor/skills/purge/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install orwa-mahmoud/nightshift plugins/nightshift/skills/purge2Manually: put the files in place
.github/skills/purge/SKILL.md1Skills CLI (Vercel)
npx skills add orwa-mahmoud/nightshift --skill purge -a gemini-cli2Platform CLI
gemini skills install https://github.com/orwa-mahmoud/nightshift --path plugins/nightshift/skills/purgeManually: put the files in place
.devin/skills/purge/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add orwa-mahmoud/nightshift --skill purge -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about purge
How do I install purge in Claude Code?
Run npx skills add orwa-mahmoud/nightshift --skill purge -a claude-code. The skill file is available at ~/.claude/skills/purge/SKILL.md.
What does purge do?
It deletes the current project's Nightshift state: punch lists, rules, receipts, archives, and history under .nightshift/. The plugin remains installed.
How does purge limit what it deletes?
It shows the exact $NS path and waits for the owner to confirm. The helper removes only a validated .nightshift/ directory and a local .nightshift-link when present; it rejects symlinks and broad targets.
Source text
SKILL.md · MIT
---
name: purge
description: Permanently delete this project's Nightshift state, including punch lists, rules, receipts and archives; does not uninstall the plugin.
license: MIT
metadata:
internal: true
---
Remove Nightshift from this project. This deletes punch lists, rules, receipts, archives, and
history under the project's `.nightshift/` directory. It does not uninstall the global Nightshift
plugin.
Resolve the installed plugin root to an absolute `$NIGHTSHIFT_PLUGIN_ROOT` — `${CLAUDE_PLUGIN_ROOT}`
on Claude Code, `$PLUGIN_ROOT` on Codex when set, otherwise the absolute path this skill was
attached from (`skills/purge/SKILL.md`). Run every command below through
`"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns"` — native Windows: `& "$NIGHTSHIFT_PLUGIN_ROOT\runtime\windows\ns.ps1"`
in the PowerShell tool, same verbs — which resolves the host and the workspace; `ns help` lists the
verbs, and `ns bind` prints the six resolved facts (`TASK_ROOT`, `NIGHTSHIFT_WORKSPACE`, `NS`,
`NIGHTSHIFT_PLUGIN_ROOT`, `HOST`, `SOURCE`); `$NS` below is that `NS`. Never a bare relative path: the working
directory persists between calls. Each `$NS/...` path below is where the current layout keeps that file;
`ns path <key>` prints where this workspace keeps it, and `ns path --list` names every key.
Print the exact canonical `$NS` path. Warn that punch lists, rules, receipts, archives, and history
will be lost, and that the plugin itself stays installed. Do not run the helper until the owner
confirms that exact path. Then:
```bash
"$NIGHTSHIFT_PLUGIN_ROOT/runtime/ns" purge-workspace \
--confirm-path "$NS"
```
The helper first performs Reset, then deletes only that validated `.nightshift/` directory and a
local `.nightshift-link` on the opened task root when present. It refuses symlinks, malformed
links, workspace roots, home directories, `/`, and other broad paths. It never deletes repository
files outside that Nightshift state. A second Purge with the same confirmation is safe.
If the task root is linked, pass the folder you opened as `--project "$TASK_ROOT"`. This is the
one command whose target is the task root rather than the workspace, so it is the one place the
dispatcher's answer is not the one you want: purging only the workspace path leaves the host link
in place.
© orwa-mahmoud · MIT · orwa-mahmoud/nightshift