session

A session-management tool for preserving selected work across a context reset. It writes a handover document containing the goal, decisions, lessons, files changed, open items, and next step, then restores that information later.

In plain words
What is it for?
Use it to dump a session, recall a saved handover, list stored handovers, or remove one when its work is finished.
Why use it?
It prevents important decisions and unfinished work from being lost when a conversation is cleared or its context is reset. Temporary exploration details are intentionally left out.

Skill for Claude CodeCodex

Part of the foundry plugin — 10 skills, 10 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/borda/ai-rig/session
Any agent
npx skills add Borda/AI-Rig --skill session
Clone the repo
git clone --depth 1 https://github.com/Borda/AI-Rig

Made for: Claude Code, Codex.

Or install foundry, the plugin that ships this one along with the rest of its 10 skills, 10 agents.

Per session 209 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,029 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00209 $0.05029
Opus 5 $0.00105 $0.02514
Sonnet 5 $0.00042 $0.01006
Haiku 4.5 $0.00021 $0.00503

Measured 3d ago against content hash ef11cbb9599e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

session scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find .claude/state/session -maxdepth 1 -name '*.md' ! -name 'PARKED.md' -mtime +30 -delete 2>/dev/null; echo "sweep done" # timeout: 5000
plugins/cc_foundry/skills/session/SKILL.md · 337 lines

How it starts

The opening of the file, as written. The whole thing — 337 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Carry the durable part of a session across /clear, and hold open loops until they land. dump composes a small handover doc from the live conversation, writes it to .claude/state/session/<slug>.md, and 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 — is dropped on purpose; only the decision that settled an approach survives.

Runs inline, never context: fork. The conversation history is the authoritative source for what changed, what was decided, and 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.

  • $ARGUMENTS: required. Six modes:
    • dump [name] — sweep, compose and write the handover doc, set the LATEST pointer, print the /clear next step. name optional; unnamed dumps derive a slug from branch + UTC timestamp.
    • recall [name] — print a stored handover into context and mark it consumed. Named, or LATEST when omitted. Manual path for the dumps the hook skips.
    • list — table of stored handovers (slug, age, consumed) plus the open parked items.
    • park <idea> — append one open-loop item to .claude/state/session/PARKED.md. No dump needed; works any time.
    • sweep — read the conversation for unlanded ideas, unanswered questions and pending tasks; report them and offer to park.
    • drop <item> — fuzzy-match a parked item and remove it, logging the closure.
  • Store dir: .claude/state/session/ (project-local; .claude/state/ is 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, the slug of the 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 the 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 — handover docs only, swept during list. Parked items are never auto-deleted; only drop removes one.
  • Files-table row cap: 25 (over that, group by directory and state the elided count)

Task hygiene: load and follow the protocol below.

# audit-skip: resilience-replication
python "${CLAUDE_PLUGIN_ROOT:-plugins/cc_foundry}/bin/load_shared_doc.py" foundry skills/_shared task-hygiene.md  # timeout: 5000

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
  • listMode: list
  • parkMode: park
  • sweepMode: sweep
  • drop (alias: archive) → Mode: drop

Unsupported flag check — after extracting the mode token, scan $ARGUMENTS for remaining --<token> patterns. If found: print ! Unknown flag(s): `--<token>`. Supported modes: dump, recall, list, park, sweep, drop. then invoke AskUserQuestion — (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

Read the full file on GitHub · 337 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 337 lines · 209 tokens per session scan B ef11cbb9599e

Subscribe to this mod's changes

session is a skill published in the GitHub repository Borda/AI-Rig (25 stars, last pushed 9d ago), licensed Apache-2.0. It adds 209 tokens to every session and 5,029 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

apm-usage

Activate when the user asks about APM (Agent Package Manager): installing, configuring, authoring, or troubleshooting AI-agent packages, dependencies, compilation, MCP servers, policy, or any apm CLI command.

microsoft/apm · 49 tokens

clean-user-facing-text

Audit and finalize authorized natural-language text meant for readers: strip suspicious invisible Unicode, then rewrite prose while keeping facts, meaning, and the writer's voice. Use when the user asks to clean, humanize, polish, or finalize articles, manuscripts, reports, documentation, emails, product copy, UI…

ShadowAqueduct/watermark-remover · 121 tokens

sessions

Search and ask questions about coding agent session history across Claude Code, Codex, and Cursor. Use when asking what was worked on, what was tried before, how a problem was investigated across sessions, what happened recently, or any question about past agent sessions. Also use when the user references prior…

slopus/happy · 78 tokens

codex-autoresearch

Run autonomous, measurable experiments in a Git repository: change one hypothesis, verify a numeric metric, keep improvements, and revert failures. Use when the user wants Codex to keep iterating toward a numeric target in the foreground or as a detached background run. Do not use for ordinary one-shot coding…

leo-lilinxiao/codex-autoresearch · 80 tokens

daily-budget-check

Run a daily spend check-in against a daily budget on the Agent Monitor dashboard — today's spend vs the daily target, pace through the day, and the projected overage if the current pace holds. Uses /api/pricing/cost and /api/sessions (grouped by startedat = today). Use for a quick daily spend check-in or a…

hoangsonww/Claude-Code-Agent-Monitor · 81 tokens

ship-feature

Implement a feature safely end-to-end in this repository. Use when adding or changing functionality across backend, frontend, or MCP with required verification and documentation updates.

hoangsonww/Claude-Code-Agent-Monitor · 34 tokens