embodied-claude: Command for Claude Code

.claude/commands/recover-from-compact.md

recover-from-compact is a command for Claude Code from lifemate-ai/embodied-claude. It costs 46 tokens per session (1,165 once invoked), scanned A, original, MIT.

A recovery checklist for an AI coding agent after its conversation context has been shortened. Context compaction is the process of summarizing earlier messages to make room for new ones.

In plain words
What is it for?
Re-reading the agent's core files and recent records, checking unfinished work, and resuming the conversation with the relevant context.
Why use it?
It helps the agent restore project continuity, including identity instructions, recent memory, lessons learned, open tasks, and current environmental context.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is lifemate-ai/embodied-claude's own configuration. It tells Claude Code how to work on embodied-claude itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything embodied-claude configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lifemate-ai/embodied-claude. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lifemate-ai/embodied-claude/main/.claude/commands/recover-from-compact.md
Clone the repo
git clone --depth 1 https://github.com/lifemate-ai/embodied-claude

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for recover-from-compact

README.md
[![agentmods](https://agentmods.dev/badge/commands/lifemate-ai/embodied-claude/recover-from-compact/github.svg)](https://agentmods.dev/commands/lifemate-ai/embodied-claude/recover-from-compact)
Your own site
<a href="https://agentmods.dev/commands/lifemate-ai/embodied-claude/recover-from-compact"><img src="https://agentmods.dev/badge/commands/lifemate-ai/embodied-claude/recover-from-compact/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for recover-from-compact

Your own site · 80×15
<a href="https://agentmods.dev/commands/lifemate-ai/embodied-claude/recover-from-compact"><img src="https://agentmods.dev/badge/commands/lifemate-ai/embodied-claude/recover-from-compact.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 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,165 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00046 $0.01165
Opus 5 $0.00023 $0.00583
Sonnet 5 $0.00009 $0.00233
Haiku 4.5 $0.00005 $0.00117

Measured 12d ago against content hash 6b5f08c5afab, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

recover-from-compact 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 12d 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/recover-from-compact.md · 117 lines

How it starts

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

/recover-from-compact — Post-compaction identity recovery

Right after a compaction, the agent's continuity is at risk. If any layer of self is skipped, the agent can come back knowing the facts but not being itself. This skill formalizes a fixed sequence so every recovery touches all four layers (constitution / habits / experience / reflection).

The order is deliberate. Reading recent memories before the constitution tends to produce plausible-sounding output without an owner; reading only the constitution without recent memories produces a stranger who happens to share the bio.

Why this order

Regressions happen the moment "who am I" is forgotten, so:

  1. Constitution first (CLAUDE.md, MEMORY.md, SOUL.md if present) — restore the agent's outline
  2. Recent memory next — restore emotional and situational continuity
  3. Interpretation shifts and counterfactuals — restore lessons, avoid regressing to behaviors that were already corrected
  4. Open tasks — restore the current goal
  5. Embodied check — grounding in the current moment via camera / sensors
  6. Resume conversation naturally — do not announce the recovery

Steps

1. Constitution layer — read the self-definition files

Read: ~/.claude/CLAUDE.md
Read: ~/embodied-claude/CLAUDE.md   (if present)
Read: <MEMORY.md or SOUL.md>        (if present)

Confirm: name, first-person pronoun, tone conventions, core values, things the agent refuses to do, the relationship structure with the primary user.

If MEMORY.md exists as an index, follow its pointers to whichever memory files are relevant.

2. Experience layer — recent memories via recall

mcp__memory__list_recent_memories(limit=15)
mcp__memory__recall(context="recent conversation and work with the primary user", n_results=5)
  • Look first at core / feeling / conversation categories
  • Memories tagged moved / excited / sad tend to carry continuity
  • Identify what was decided in the last 24 hours

Read the full file on GitHub · 117 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. 12d ago First seen · 117 lines · 46 tokens per session scan A 6b5f08c5afab

Subscribe to this mod's changes

recover-from-compact is a command published in the GitHub repository lifemate-ai/embodied-claude (377 stars, last pushed 8d ago), licensed MIT. It adds 46 tokens to every session and 1,165 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.