session-end

A session-closing command that records a summary of the current coding-agent session in the project’s session log and related tracking files.

In plain words
What is it for?
Use it at the end of a session to submit a summary for completed, ongoing, or blocked tasks and let the session tool update its records and commit.
Why use it?
It preserves what was done, what remains, blockers, decisions, and session details so later work can resume with context.

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

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 535 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.00000 $0.00535
Opus 5 $0.00000 $0.00267
Sonnet 5 $0.00000 $0.00107
Haiku 4.5 $0.00000 $0.00053

Measured 2d ago against content hash f03bfd614c14, 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 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/session-end.md · 39 lines

How it starts

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

Session End Protocol

Automatic (hook-fired): runs unattended at session end. Must never block — file repair is /selfheal's job, not this command's.

Thin wrapper (GETSITREP-10) over getsitrep session-end — the CLI owns the Session Log entry, header updates, .sitrep-data.json, the history record, and the commit. This file's only remaining job is the one step no CLI can do on its own: building the session-summary JSON from this conversation, since a CLI has no way to know what happened in it.

Step 1: Build the session summary

From your own knowledge of this session, construct:

{
  "focus": "one-line summary",
  "tasksCompleted": ["3.1"], "tasksInProgress": [], "tasksBlocked": [],
  "blockers": [], "decisions": [],
  "tokens": {"input": N, "output": N, "cacheCreation": N, "cacheRead": N, "total": N},
  "costUsd": N.NN, "costLabel": "actual"|"estimate", "costSource": "ccusage"|"manual_estimate",
  "model": "...", "durationMinutes": N, "user": "...", "notes": "..."
}

Every field is optional — omit what you don't know rather than guessing a placeholder that looks precise but isn't.

Tokens/cost — always label actual or estimate, never write a bare number:

  • If a configured meter (ccusage/CCUM) or the platform itself reports exact counts → use those, label actual.
  • Otherwise, estimate from the work actually done this session, label estimate:
    • Light (reading, planning, small edits): ~20,000 tokens
    • Medium (1-2 features, some debugging): ~60,000 tokens
    • Heavy (large refactor, many files, extensive debugging): ~150,000 tokens
  • Calculate cost from sitrep/MANIFEST.md's pricing table.
  • Subagent-cost awareness: if this session spawned subagents (Task tool calls), count their token usage too — don't undercount by tracking only the main thread.
  • /compact hygiene: if auto-compact fired this session, note it in notes — a post-compact estimate is a lower bound, not exact.

Step 2: Call the CLI

getsitrep session-end --data '<the JSON from Step 1>'

Read the full file on GitHub · 39 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 · 39 lines · 0 tokens per session scan A f03bfd614c14

Subscribe to this mod's changes

session-end is a command published in the GitHub repository viitorohit/sitrep (19 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 535 tokens. 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.