.claude/skills/session-compact/SKILL.md
Mid-session context refresh — commit, write handoff, then compact
npx skillsauth add the-agency-ai/the-agency .claude/skills/session-compactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Mid-session context refresh. Commits all work, writes a handoff to preserve session state, then directs the user to compact. Leave a clean working tree. No asking — just do it.
Use this when context is getting heavy but you want to keep working. The handoff ensures context survives compaction. After /compact, the agent re-orients from the compacted summary which includes the fresh handoff.
$ARGUMENTS: Optional reason (e.g., "context heavy", "mid-sprint refresh"). Defaults to "session-compact".Check for any unsent dispatches. If there are pending dispatches, send them now.
Run git status --porcelain. If the tree is already clean, skip to Step 3.
If there are uncommitted changes (modified, staged, or untracked files):
/git-safe-commit with a descriptive message covering what's being committedgit status --porcelain should return emptyDo not ask. Do not warn and leave dirty. Commit everything and get clean.
Idempotent: Running /session-compact multiple times is safe. If already clean, it skips the commit. If a handoff already exists, it archives and writes a fresh one.
./claude/tools/handoff write --trigger session-compact
The tool archives the current handoff and reports the path for the new one.
Write the handoff file at the path reported by the tool. Include:
Frame the handoff for continuation, not resumption. The agent will keep working after compact, not start fresh.
./claude/tools/handoff read
Confirm the handoff was written correctly.
Report to the user:
git branch --show-currentgit log --oneline -1Then the directive:
Run
/compactnow.
OFFENDERS WILL BE FED TO THE — CUTE — ATTACK KITTENS!
business
Sync worktree with master — merge, copy settings, run sandbox-sync, report changes
tools
List all git worktrees with status info (branch, clean/dirty, deps)
tools
Remove a git worktree and optionally delete its branch
development
Create a new git worktree with dedicated branch and bootstrapped dev environment