session-end

session-end is a command for Claude Code, OpenCode from rianvdm/product-ai-public. It costs 12 tokens per session (1,931 once invoked), scanned A, original, MIT.

A session handoff writer that records useful context from a completed work session in the appropriate project log. It skips trivial sessions and keeps information that may help later work.

In plain words
What is it for?
Use it to record decisions, investigated problems, created documents, and other durable context before stopping work.
Why use it?
Important decisions and discoveries can be lost when a work session ends. A handoff gives the next session a starting point without requiring someone to reconstruct the conversation.

Command for Claude CodeOpenCode

Written for Claude Code and OpenCode: $ARGUMENTS substitution, but also installed under .opencode/. Also seen: mentions AGENTS.md; mentions OpenCode.

Good fit Use it to record decisions, investigated problems, created documents, and other durable context before stopping work.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/rianvdm/product-ai-public/session-end
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.

Clone the repo
git clone --depth 1 https://github.com/rianvdm/product-ai-public

Made for: Claude Code, OpenCode.

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/commands/rianvdm/product-ai-public/session-end/github.svg)](https://agentmods.dev/commands/rianvdm/product-ai-public/session-end)
Your own site
<a href="https://agentmods.dev/commands/rianvdm/product-ai-public/session-end"><img src="https://agentmods.dev/badge/commands/rianvdm/product-ai-public/session-end/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for session-end

Your own site · 80×15
<a href="https://agentmods.dev/commands/rianvdm/product-ai-public/session-end"><img src="https://agentmods.dev/badge/commands/rianvdm/product-ai-public/session-end.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,931 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00012 $0.01931
Opus 5 $0.00006 $0.00966
Sonnet 5 $0.00002 $0.00386
Haiku 4.5 $0.00001 $0.00193

Measured 2d ago against content hash e6ed9a201ae4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 2d 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.

.opencode/command/session-end.md · 145 lines

How it starts

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

Session End

Write a handoff note to the appropriate session log so the next session can pick up where this one left off.

Two session logs exist:

  • 01-context/session-log-work.md — Amazon work (Data Platform, DevTools, escalations, Exponent, internal tools)
  • 01-context/session-log-personal.md — Personal/side projects (Discrobble, discogs-mcp, ListenToMore, tldl, blog posts, gaming)

Your Task

$ARGUMENTS

Instructions

1. Assess the Session

Review what happened in this conversation. Only write a handoff note if the session involved substantive work — decisions made, problems investigated, documents created, or significant context built up. Skip if the session was just a quick question or trivial task.

If the session wasn't substantive enough for a handoff note, say so and end.

Admission quality check: For each piece of information you'd include in the handoff note, ask:

  • Novel? Does this extend or contradict something already in the system (skills, commands, stable-facts)? If it's already baked in, don't re-store it.
  • Actionable? Can a future session use this? Debugging dead-ends and one-off lookups usually aren't worth recording.
  • Durable? Will this matter in 2 weeks? Open threads and decisions yes; transient investigation details usually no.

Use judgment — these are quality filters, not hard gates. The goal is to keep the session log high-signal.

2. Draft the Entry

Determine which session log this entry belongs in based on the session topic:

  • Work01-context/session-log-work.md
  • Personal01-context/session-log-personal.md

Write a new H2 entry to prepend to the chosen file (newest first). Use this exact format:

## YYYY-MM-DD — [Brief topic description]

**What happened:** [1-3 sentences summarizing what was done. Be specific — mention file paths, ticket IDs, project names.]

**Decisions:** [Any decisions made during the session. Reference where they were documented if applicable.]

**Learned:** [Anything discovered that should persist — debugging insights, preferences expressed, corrections needed, approach that worked/didn't work. If nothing notable, omit this field.]

**Open threads:** [What's unfinished or needs follow-up. If nothing, omit this field.]

Read the full file on GitHub · 145 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. 2d ago First seen · 145 lines · 12 tokens per session scan A e6ed9a201ae4

Subscribe to this mod's changes

session-end is a command published in the GitHub repository rianvdm/product-ai-public (15 stars, last pushed 2d ago), licensed MIT. It adds 12 tokens to every session and 1,931 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-09-09.