session

A command for capturing, listing, restoring, and promoting session context, meaning the operational memory of an agent session.

In plain words
What is it for?
Use it to configure automatic capture, check session status, create a manual digest, restore context, or promote selected learnings into wiki notes.
Why use it?
It keeps temporary session information separate from lasting topic knowledge and lets you choose what to preserve.

Command

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/nvk/llm-wiki/session
Clone the repo
git clone --depth 1 https://github.com/nvk/llm-wiki
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 881 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.00032 $0.00881
Opus 5 $0.00016 $0.00441
Sonnet 5 $0.00006 $0.00176
Haiku 4.5 $0.00003 $0.00088

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

Security

Grade A, and why

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 yesterday.

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-plugin/commands/session.md · 79 lines

How it starts

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

Your task

Manage llm-wiki session context. Session context is operational memory for agent sessions, not canonical topic knowledge. Use HUB/.sessions/ as the canonical store and promote only explicit distilled learnings into topic raw/notes/.

First read references/sessions.md, then resolve HUB by the standard hub resolution protocol from references/hub-resolution.md. If a deterministic helper is available, prefer it:

scripts/llm-wiki-session --hub "$HUB" <subcommand>

If the helper is not available, perform the equivalent file operations described in references/sessions.md.

Parse $ARGUMENTS

  • enable [--mode capture-only|balanced|aggressive] [--tool-events N]: re-enable or reconfigure automated capture by writing HUB/.sessions/config.json. Default mode is balanced; default threshold is 50 observed tool events.
  • disable: opt out by setting enabled: false in HUB/.sessions/config.json.
  • status: report whether capture is enabled, where .sessions/ lives, and how many sessions are indexed.
  • capture: force a manual digest checkpoint for the current or specified session. Accept optional --harness, --session-id, --cwd, --topic, and --summary hints.
  • list: list sessions by recency, optionally filtered by --harness, --cwd, or --topic.
  • show <session-id>: show the latest digest for a session.
  • rehydrate [--session-id <id>|--cwd <path>|--topic <slug>]: print a compact context block that the harness should read before continuing.
  • promote <session-id> --topic <slug>: create a topic raw/notes/ promotion note from the distilled digest. Do not copy raw transcripts.

Policy

  1. Automated capture is default-on when trusted hooks are installed. Users can opt out with session disable, which writes enabled: false and causes hooks using --if-enabled to no-op.
  2. Hooks should be fast and deterministic: append redacted JSONL event metadata, update state, and write markdown digests at checkpoints. Do not call an LLM from every tool hook.
  3. Raw transcript archiving is off by default. Store transcript pointers/hashes, not transcript bodies.
  4. Auto-promotion is forbidden. Sessions can be untagged or topic-tagged, but canonical wiki knowledge requires explicit promotion.
  5. Rehydration may inject a short context block in balanced/aggressive modes; strict forced continuation remains opt-in and must have loop guards.

Read the full file on GitHub · 79 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. yesterday First seen · 79 lines · 32 tokens per session scan A e931c3f83b75

Subscribe to this mod's changes

session is a command published in the GitHub repository nvk/llm-wiki (1,163 stars, last pushed 4d ago), licensed MIT. It adds 32 tokens to every session and 881 once invoked, about $0.0002 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.