end-session

A session-closing command that checks the codebase, writes a handoff file and journal entry, and reports unresolved work.

In plain words
What is it for?
Use it to run final checks, record what changed, note open issues, and surface loose threads before stopping work.
Why use it?
It reduces the chance of ending a coding session with unnoticed problems or missing context for the next session.

Command for Claude Code

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 commands/strale-io/strale/end-session
Clone the repo
git clone --depth 1 https://github.com/strale-io/strale

Made for: Claude Code.

Per session 25 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,547 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.00025 $0.01547
Opus 5 $0.00013 $0.00773
Sonnet 5 $0.00005 $0.00309
Haiku 4.5 $0.00003 $0.00155

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

Security

Grade A, and why

end-session 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.

.claude/commands/end-session.md · 113 lines

How it starts

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

/end-session — verify, then write session artifacts + surface loose threads

Purpose: complete the CLAUDE.md Quick Session Checklist on Petter's behalf. This command DOES write the handoff file and Journal entry — that's the standing preference (set 2026-04-27). It still does not create Decisions DB entries, To-do mutations, or other governance artifacts without explicit per-item approval.

Run these steps in order. After the checks, write the artifacts (steps 2 and 3) before producing the final report.

1. Run the codebase close-check script

cd apps/api && npx tsx --env-file=../../.env scripts/session-close-check.ts

Checks git integrity, DB↔code parity, stuck caps, open breakers, uncommitted handoff files. Exit codes: 0 clean, 1 warnings, 2 blockers. Capture findings for the final report.

2. Write the session handoff file (CLAUDE.md step 7)

Author a handoff file at handoff/_general/from-code/YYYY-MM-DD-<topic>.md covering this session's work. Convention:

  • First line is Intent: summarizing what the session set out to do.
  • Body covers what shipped, what's open, non-obvious learnings, and cost (if any).
  • Topic slug should be specific enough that future-you can grep for it (e.g. x402scan-indexing-and-pr-cleanup, not cleanup).

If a handoff file authored this session already exists for today's topic (e.g. an earlier /go invocation already wrote one), don't duplicate — report its path. Only one handoff per topic per day; if the session covered two distinct topics, write two files.

If the session was genuinely trivial (single trivial fix, nothing worth recording), still write a one-line handoff. Skipping is Petter's call, not yours.

3. Create the Journal entry in Notion (CLAUDE.md step 8)

Create a session-log entry in the Journal data source (collection://8f54383b-3227-42c2-bee4-77a091027f8f) with:

  • Title: Session log — <topic> YYYY-MM-DD (matches existing entry pattern)
  • Type: session
  • Source: code
  • Actor: claude-code
  • Action Required: no (unless the session left explicit follow-ups for Petter)
  • Content: mirror the handoff file's structure — Intent, Outcome, Open, Non-obvious learnings. Don't duplicate the entire handoff verbatim, but cover the same ground.

Read the full file on GitHub · 113 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 · 113 lines · 25 tokens per session scan A 28ece17cd8b8

Subscribe to this mod's changes

end-session is a command published in the GitHub repository strale-io/strale (4 stars, last pushed 2d ago), licensed MIT. It adds 25 tokens to every session and 1,547 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-31.