Skip to content
Development
Skill

/session

Session state that outlives a context reset — `dump` sweeps the live conversation and writes a compact handover doc (goal, decisions + why, lessons, standing instructions, files-touched table, outstanding items, next step), then prints `/clear`; the `session-restore.js`

From plugin
ai-rig
3148 skills16 agents2 MCP

Claude Code

$ npx -y skills add Borda/AI-Rig --skill session --agent claude-code

SKILL.md

session.SKILL.md
name: session
description: 'Session state that outlives a context reset — `dump` sweeps the live conversation and writes a compact handover doc (goal, decisions + why, lessons, standing instructions, files-touched table, outstanding items, next step), then prints `/clear`; the `session-restore.js` SessionStart hook re-injects it automatically. `park` stashes a diverging idea mid-session without derailing; `sweep` audits the conversation for unlanded work. TRIGGER when: user says "dump the session", "handover before clear", "save state before clearing", "carry this over", "I want to clear but keep the plan", "park this for later", "what did we defer", "anything unfinished before I close". SKIP: surviving auto-compact (that is the skill contract in `.temp/state/skill-contract.md` per `compaction.md`, written by the running skill); reviving a *finished* conversation (Claude Code native `/resume`).'
argument-hint: dump [name] | recall [name] | list | park <idea> | sweep | drop <item>
allowed-tools: Read, Write, Edit, Glob, Bash, TaskList, TaskUpdate, AskUserQuestion
effort: low

<objective>

Carry the *durable* part of a session across `/clear`, hold open loops until they land. `dump` composes a small handover doc from the live conversation, writes it to `.claude/state/session/<slug>.md`, ends by printing `/clear`. The `session-restore.js` hook (SessionStart, matcher `clear`) injects that doc into the fresh session, so restore is free. Implementation detail — diffs, tool output, exploration transcript, abandoned approaches — dropped on purpose; only the decision that settled an approach survives.

Runs **inline, never `context: fork`**. Conversation history *is* the authoritative source for what changed, what was decided, what never landed; a forked run would see none of it.

NOT for: auto-compact survival (`compaction.md` skill contract); reviving a finished conversation (native `/resume`). Boundary table in the notes section below.

</objective>

<inputs>

  • **$ARGUMENTS**: required. Six modes:
  • `dump [name]` — sweep, compose and write handover doc, set `LATEST` pointer, print `/clear` next step. `name` optional; unnamed dumps derive a slug from branch + UTC timestamp.
  • `recall [name]` — print a stored handover into context, mark it consumed. Named, or `LATEST` when omitted. Manual path for dumps the hook skips.
  • `list` — table of stored handovers (slug, age, consumed) plus open parked items.
  • `park <idea>` — append one open-loop item to `.claude/state/session/PARKED.md`. No dump needed; works any time.
  • `sweep` — read conversation for unlanded ideas, unanswered questions, pending tasks; report them, offer to park.
  • `drop <item>` — fuzzy-match a parked item, remove it, log the closure.

</inputs>

<constants>

  • Store dir: `.claude/state/session/` (project-local; `.claude/state/` gitignored, same as `session-context.md`)
  • Item store: `.claude/state/session/PARKED.md` — one bullet per open item; survives every dump, never auto-deleted
  • Pointer file: `.claude/state/session/LATEST` — plain text, slug of most recent unconsumed dump. Blank or missing = nothing pending.
  • Closure log: `.claude/state/session/dropped.jsonl` — one JSON line per `drop`
  • Doc size cap: ~1.5K tokens (~75 lines). Compress prose, never drop a decision.
  • Hook auto-restore window: unconsumed **and** `created` within 30 min. Outside it, `recall` is the manual path.
  • Hook truncation threshold: ~8000 chars — above it hook injects `## Goal` + files table + `## Next step` + a `→ /foundry:session recall <slug>` pointer instead of the whole doc.
  • Stale threshold: 14 days (`⚠ stale` prefix when listing) — applies to handover docs **and** parked items
  • Delete threshold: 30 days — consumed handover docs only, swept during `list`. **Unconsumed handovers and parked items never auto-deleted**; only `drop` removes a parked item.
  • Files-table row cap: 25 (over that, group by directory, state elided count)

</constants>

<workflow>

**Task hygiene** — task tools may be deferred; load before first use: `ToolSearch(query="select:TaskList,TaskCreate,TaskUpdate,TaskGet", max_results=4)`. Call `TaskList` first and triage each task it returns: `completed` if work clearly done, `deleted` if orphaned, keep `in_progress` only if genuinely continuing. Never spend a turn on bookkeeping alone — every `TaskCreate`/`TaskUpdate` ships in the same response as the next substantive tool call; one exception, `TaskUpdate(completed)` immediately before a long output block (`rules/task-lifecycle.md`).

Step 0: Validate and dispatch mode

Extract first word of `$ARGUMENTS` as `MODE`.

If `MODE` matches:

  • `dump` (alias: `save`) → **Mode: dump**
  • `recall` (aliases: `restore`, `load`) → **Mode: recall**
  • `list` → **Mode: list**
  • `park` → **Mode: park**
  • `sweep` → **Mode: sweep**
  • `drop` (alias: `archive`) → **Mode: drop**

**Unsupported flag check** — after extracting mode token, scan the tokens after it for `--<token>` patterns — except in `park` and `drop`, whose whole remainder is free-text payload (an idea or item may itself contain `--`), never flags. Found: invoke `AskUserQuestion` with question text `` ! Unknown flag(s): `--<token>`. Supported modes: dump, recall, list, park, sweep, drop. `` — (a) **Abort** (stop, re-invoke correctly) · (b) **Continue ignoring** (skip unknown flags, proceed with recognized mode).

Otherwise (empty, unrecognized, misspelled): use `AskUserQuestion`:

> "Which session mode did you want?" > > Options: (a) `dump [name]` — write the handover doc now, (b) `park <idea>` — stash one open loop without derailing, (c) `sweep` — audit the conversation for unlanded work, (d) `list` — stored handovers and open items

Step 1 / Mode: dump

Substep 1a: Derive slug and timestamp

git branch --show-current 2>/dev/null; date -u +%Y-%m-%dT%H:%M:%SZ; date -u +%Y-%m-%dT%H-%M-%SZ; echo "--- file evidence (Substep 1c) ---"; git diff --stat HEAD 2>/dev/null; echo "--- candidate commits (last
Read more
@borda
Ships withai-rig

Practical agent workflows for Python, ML, and open-source maintenance. AI-Rig turns recurring work—scoping a change, reproducing a bug, reviewing a pull request, running an experiment, or checking release readiness—into explicit workflows with specialist

3148 skills16 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
31
Star history of Borda/AI-Rig on GitHub, a chart by star-history.com

Other skills on ai-rig.

debug

debug

Investigation-first debugging — gather evidence, form confirmed root-cause hypothesis, hand off to fix mode with diagnosis file.…

@borda@bordaInstall Skill
feature

feature

TDD-first feature development — crystallise API as a demo test, drive implementation to pass it, run quality stack and a bounded…

@borda@bordaInstall Skill
fix

fix

Reproduce-first bug resolution — capture bug in failing regression test, apply minimal fix, run quality stack and a bounded…

@borda@bordaInstall Skill
plan

plan

Analysis-only planning — classify and scope a task without writing code; outputs a structured plan to .plans/active/. TRIGGER…

@borda@bordaInstall Skill
refactor

refactor

Test-first refactoring — audit coverage, add characterization tests, apply changes with safety net, run quality stack and a…

@borda@bordaInstall Skill
review

review

Multi-agent code review of local Python files, directories, or the current git diff covering architecture, tests, performance,…

@borda@bordaInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about session.

Which coding agents can use session?
session installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.