context

A context-management command hub for saving and restoring session state, managing persistent memory, and viewing status or preferences.

In plain words
What is it for?
Use it to compact the current work into a handoff, restore saved state, store or retrieve memory, or inspect session status and preferences.
Why use it?
It helps preserve important decisions and progress when a conversation becomes too long or work continues in a later 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/smart-ai-memory/empathy-framework/context
Clone the repo
git clone --depth 1 https://github.com/Smart-AI-Memory/empathy-framework

Made for: Claude Code.

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 861 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.00012 $0.00861
Opus 5 $0.00006 $0.00430
Sonnet 5 $0.00002 $0.00172
Haiku 4.5 $0.00001 $0.00086

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

Security

Grade A, and why

context 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/commands/context.md · 164 lines

How it starts

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

Context Management

Aliases: /ctx

Manage session context, state preservation, and memory.

Quick Examples

/context                 # Interactive menu
/context "save state"    # Compact current context
/context "check memory"  # View stored memories

Discovery

Question:
  header: "Action"
  question: "What would you like to do with context?"
  options:
    - label: "Save state (compact)"
      description: "Preserve current state before context window resets"
    - label: "Restore state"
      description: "Load previously saved state from a past session"
    - label: "Manage memory"
      description: "Store and retrieve persistent memory across sessions"
    - label: "Status & profile"
      description: "View session status, patterns, or update preferences"

Save State (Compact)

Preserve current state before context window resets.

I will:

  1. Summarize current session progress
  2. Extract key decisions and context
  3. Generate SBAR handoff format:
    • Situation: What we're working on
    • Background: Relevant history
    • Assessment: Current state
    • Recommendation: Next steps
  4. Save to .claude/compact-state.md
  5. Store in cross-session memory

When to compact:

  • Context window getting full (~80%)
  • Before a long break
  • Significant milestone reached
  • Handing off to another session

Restore State

Load previously saved state from a past session.

Tell me:

  • Session to restore (or use most recent)

I will:

  1. Load compact state from memory
  2. Restore the SBAR context
  3. Resume from where we left off
  4. Confirm understanding of current task

Stored in: .claude/compact-state.md


Manage Memory

Store and retrieve persistent memory across sessions.

Tell me:

  • What to store or retrieve
  • Memory type (fact, preference, project info)

I will:

  1. Access cross-session memory
  2. Store new memories with context
  3. Retrieve relevant memories
  4. Update or delete as needed

Read the full file on GitHub · 164 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 · 164 lines · 12 tokens per session scan A 99717a8178a4

Subscribe to this mod's changes

context is a command published in the GitHub repository Smart-AI-Memory/empathy-framework (13 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 12 tokens to every session and 861 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-30.