prep

A session wrap-up procedure that records the current task, updates project memories and plans, and prepares Git-related information before ending a session or shortening its history.

In plain words
What is it for?
Use it at the end of a session or before compacting the conversation. It pins the interrupted task, reads the project identity file, updates relevant memory and todo files, and reviews the resulting state.
Why use it?
It prevents unfinished work or the active question from being lost during cleanup or context reduction. It keeps memories, plans, and repository status aligned with what actually happened.

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/aiosai/aipass/prep
Clone the repo
git clone --depth 1 https://github.com/AIOSAI/AIPass

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 1,395 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.01395
Opus 5 $0.00000 $0.00698
Sonnet 5 $0.00000 $0.00279
Haiku 4.5 $0.00000 $0.00139

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

Security

Grade A, and why

prep 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/prep.md · 88 lines

How it starts

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

Session Wrap-Up

Purpose: Button up everything at the end of a session — or before a /compact. Memories, plans, git — all tidy. Works for both closing out a chat and preparing for compaction.

Workflow: /prep → review output → close chat or /compact

Execution

  1. Pin the interrupted thread FIRST — before any wrap-up work, write one sentence naming what the conversation was doing when /prep fired (the live task, question, or build mid-flight — "nothing in flight" counts). Prep often auto-triggers mid-task and the wrap-up steps flush the thread from attention; this line is what gets it back. It becomes the Resuming line at the end.
  2. Read .trinity/passport.json — re-absorb your identity before writing anything
  3. Do ALL of the following, then confirm what was updated

1. Memories

Each memory file plays a distinct role. Update based on what actually changed this session.

  • .trinity/passport.json — IDENTITY. Who you are: role, capabilities, principles. Only update if identity genuinely evolved this session.
  • .trinity/local.json — YOUR MEMORY. Add/update session entry with a summary of work done. Add key_learnings for anything learned. Update todos[] with current in-flight items.
  • .trinity/observations.json — YOUR MEMORY OF THE USER. Collaboration insights, preferences, friction points. Skip if nothing new about the user this session.

Entry shape — one rule for all four types

key_learnings, sessions, todos (local.json) and observations (observations.json) all share ONE shape: a list of objects, newest at the top (index 0). Every entry carries:

  • number — a monotonic int per type (highest = newest, never reused). New entry's number = current max for that type + 1.
  • date — ISO date/datetime.
  • Plus its text field + extras: key_learnings {number, date, key, value} · sessions {number, date, summary, status, tags} · todos {number, date, task, priority, status} · observations {number, date, note, tags}.

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

Subscribe to this mod's changes

prep is a command published in the GitHub repository AIOSAI/AIPass (264 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,395 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.