session-end

session-end is a skill for Claude Code, Codex from IlyaGorsky/memory-toolkit. It costs 16 tokens per session (1,010 once invoked), scanned A, original, MIT.

A session-completion skill for saving context and preparing a handoff for the next coding session. A handoff is a short record of current work, decisions, and what should happen next.

In plain words
What is it for?
It is for updating memory, classifying session activity, proposing handoff notes, and reflecting changes back into project documentation.
Why use it?
It helps preserve project knowledge between sessions and organize changes by workstream before the session ends.

Skill for Claude CodeCodex

Part of the memory-toolkit plugin — 11 skills, 5 hooks 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/ilyagorsky/memory-toolkit/session-end
Any agent
npx skills add IlyaGorsky/memory-toolkit --skill session-end
Clone the repo
git clone --depth 1 https://github.com/IlyaGorsky/memory-toolkit

Made for: Claude Code, Codex.

Or install memory-toolkit, the plugin that ships this one along with the rest of its 11 skills, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for session-end

README.md
[![agentmods](https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-end.svg)](https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-end)
Your own site
<a href="https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-end"><img src="https://agentmods.dev/badge/skills/ilyagorsky/memory-toolkit/session-end.svg" alt="Measured on agentmods" height="20"></a>
Per session 16 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,010 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00016 $0.01010
Opus 5 $0.00008 $0.00505
Sonnet 5 $0.00003 $0.00202
Haiku 4.5 $0.00002 $0.00101

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

Security

Grade A, and why

session-end scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/session-end/SKILL.md · 146 lines

How it starts

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

/session-end — Handoff for the next session

Save context before finishing. Three phases: handoff → reflect → docs-reflect.

Phase 1: Handoff

1a: Update MEMORY.md

Check what is current:

  • Profile — no changes?
  • Rules — new agreements?
  • Reference — new links?

1b: Routing analysis (preview)

Classify session activity by workstream — preview, not yet written (AP-24).

node "$MEM" --dir="$MEM_DIR" session-activity > /tmp/activity.json
node "$MEM" --dir="$MEM_DIR" session-changes > /tmp/changes.json

# Combine items + file paths + commit subjects into one array for classify
jq -s '[.[0].items[], .[1].commits[], .[1].files[]]' /tmp/activity.json /tmp/changes.json > /tmp/items.json
node "$MEM" --dir="$MEM_DIR" classify --items=/tmp/items.json

Show user a compact routing table:

Routing analysis:
  lifecycle       → 7 items
  infrastructure  → 3 items
  research        → 1 item
  _unassigned     → 2 items

(preview — handoffs per workstream will be written in step 1d)

1c: Propose handoff

MUST show the proposed handoff content to the user and wait for confirmation before writing.

Prepare workstreams/handoff.md content:

---
name: Session handoff
description: Context for starting the next session
type: project
---

## Last session: YYYY-MM-DD

### What was done
- <list>

### Where we stopped
- <current state>

### What's next
1. <task> → recommendation: <model>
2. <task> → recommendation: <model>

### Uncommitted changes
- <git status summary, or "clean tree">

### Session decisions
- <new agreements, if any>

1d: Confirm and write

Show handoff to user. Wait for "ok" / "save" before writing.

On confirm, write in two layers:

  1. Per-workstream handoffs — for each non-empty bucket from routing (excl. _unassigned):
    # Compose per-workstream slice (relevant What-was-done / What's-next / decisions).
    # Save to /tmp/<ws>-handoff.md, then:
    node "$MEM" --dir="$MEM_DIR" write-handoff --workstream=<ws> --content=/tmp/<ws>-handoff.md
    

Read the full file on GitHub · 146 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 · 146 lines · 16 tokens per session scan A baa361747dd7

Subscribe to this mod's changes

session-end is a skill published in the GitHub repository IlyaGorsky/memory-toolkit (13 stars, last pushed 4mo ago), licensed MIT. It adds 16 tokens to every session and 1,010 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.