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.
curl -O https://raw.githubusercontent.com/lifemate-ai/embodied-claude/main/.claude/commands/recover-from-compact.mdgit clone --depth 1 https://github.com/lifemate-ai/embodied-claudeWrote 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.
[](https://agentmods.dev/commands/lifemate-ai/embodied-claude/recover-from-compact)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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:
- Constitution first (
CLAUDE.md,MEMORY.md,SOUL.mdif present) — restore the agent's outline - Recent memory next — restore emotional and situational continuity
- Interpretation shifts and counterfactuals — restore lessons, avoid regressing to behaviors that were already corrected
- Open tasks — restore the current goal
- Embodied check — grounding in the current moment via camera / sensors
- 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/conversationcategories - Memories tagged
moved/excited/sadtend to carry continuity - Identify what was decided in the last 24 hours
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.
- 12d ago First seen · 117 lines · 46 tokens per session scan A 6b5f08c5afab
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.
Other commands, from other repositories
session-end
I'll summarize this coding session and update the memory system with our accomplishments.
minutes-ideas
Surface recent voice memos and ideas captured from any device. Use when the user asks "what ideas did I have?", "what were my recent memos?", "what did I record while walking?", or wants to recall a captured thought.
learn
Force claude-smart to extract learnings from this session now.
memory-store
Store an insight, decision, or pattern to memory.
cc-memory
Configure persistent memory that survives across sessions using a layered approach: split rule files for always-loaded context, auto-memory for organic learning, and optional MCP-backed long-term memory for large codebases.
analyze-context
USE WHEN you want to analyze project context before starting work on a task. Calls context + recall, then synthesizes goals, decisions, gotchas, and relevant memories into a pre-task brief.