| name | entity-shutdown |
| description | Run the sleep cycle for an entity — extract memories and consolidate |
Tips
- The ve command is an installed CLI tool, not a file in the repository. Do not
search for it - run it directly via Bash.
Instructions
Run the sleep cycle for a named entity. This consolidates what was learned this
session into the entity's persistent memory tiers.
The exact steps depend on whether this is a wiki-based entity (has a wiki/
directory) or a legacy entity (memory-only, no wiki).
Step 1: Identify the entity
Ask the operator which entity to shut down, or accept the entity name as an
argument to this command (e.g., /entity-shutdown mysteward).
Verify the entity exists by running:
ve entity list --project-dir .
Check whether the entity is wiki-based:
ls .entities/<entity_name>/wiki 2>/dev/null && echo "wiki entity" || echo "legacy entity"
Wiki-based entities (have wiki/ directory)
For wiki entities, the shutdown pipeline uses Agent SDK to automatically diff
the wiki and consolidate new knowledge. No manual memory extraction is needed.
Step 2 (wiki): Update the wiki
During the session, you should have updated the wiki pages in
.entities/<entity_name>/wiki/ to reflect what was learned. If you haven't done
so yet, update the relevant wiki pages now.
Use git to check what changed:
git -C .entities/<entity_name> status
Step 3 (wiki): Run the shutdown
ve entity shutdown <entity_name>
This command will:
- Diff the wiki/ changes since last commit
- Launch an Agent SDK session that reads existing memories and integrates new learning
- The agent writes updated memory files and commits them
- Report a summary of journals, consolidated, and core memory counts
Step 4 (wiki): Report results
After the command completes, tell the operator:
- How many wiki diff lines were processed (journals_added)
- How many consolidated memories exist
- How many core memories exist
- Any notable changes to identity-level memories
Legacy entities (no wiki/ directory)
For legacy entities, you extract memories manually from the session, then run
the consolidation via the Anthropic API.
Step 2 (legacy): Extract memories from this session
Review your entire conversation in this session. Identify moments worth
REMEMBERING across session boundaries.
Categories of memory-worthy events (in priority order):
- correction: The operator corrected your behavior or approach.
- skill: You learned a workflow, procedure, or pattern.
- domain: The operator taught you something about the problem domain.
- confirmation: The operator validated your approach.
- coordination: You learned something about coordinating with other agents.
- autonomy: The operator calibrated when you should act vs ask.
For each memory, provide:
- title: 3-8 word summary
- content: 1-3 sentences (frame as knowledge/skill, not narrative)
- valence: "positive" / "negative" / "neutral"
- category: one of the categories above
- salience: 1-5 (5 = critical)
Step 3 (legacy): Write memories to a temp file
[
{
"title": "Check PR state before acting",
"content": "Before taking action on a PR, always verify its current state.",
"valence": "negative",
"category": "correction",
"salience": 4
}
]
Write this JSON to /tmp/entity_memories.json.
Step 4 (legacy): Run the consolidation
ve entity shutdown <entity_name> --memories-file /tmp/entity_memories.json
Step 5 (legacy): Report results
After the command completes, tell the operator:
- How many journal memories were extracted
- How many consolidated memories were created/updated
- How many core memories exist
Clean up the temporary file when done.