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.
npx agentmods add skills/ilyagorsky/memory-toolkit/session-endnpx skills add IlyaGorsky/memory-toolkit --skill session-endgit clone --depth 1 https://github.com/IlyaGorsky/memory-toolkitWrote 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.
[](https://agentmods.dev/skills/ilyagorsky/memory-toolkit/session-end)<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>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.
| Model | Per session | Once 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 |
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.
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:
- 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
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.
- 3d ago First seen · 146 lines · 16 tokens per session scan A baa361747dd7
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.
Other skills, from other repositories
token-optimizer
Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings. Use when context feels tight.
token-coach
Plan a token-efficient Claude Code or Codex setup, or get a quick health check. Coaching, not the full audit (use token-optimizer for that).
fleet-auditor
Cross-system agent token/cost audit (Claude Code, Codex, OpenClaw, Hermes, OpenCode): idle burns, model misrouting, config bloat, with dollar savings.
resume-checkpoint
Pull a prior session's checkpoint on demand when the user is continuing prior work. Returns fenced, source-labeled, scrubbed recovery context. Do NOT call on a fresh, unrelated task.
token-dashboard
Open the Token Optimizer dashboard in your browser (context usage, quality, savings). Use to view the dashboard.
acontext-installer
Install Acontext, Login & Init Acontext Project, Add Skill Memory to Agent.