/echo-sleuth:extract [session-id] [--scope current|all]from echo-sleuth
Extracts durable knowledge (decisions, corrections, patterns, references) from past Claude Code sessions. Walks through session selection, item review, and writing to memory, project instructions, or knowledge files.
Ships in echo-sleuth. Installing the plugin adds it to Claude Code.
Extract durable knowledge from a past Claude Code conversation session.
Arguments: $ARGUMENTS
Step 1: Find the session
If a session-id UUID is provided, locate it directly. Otherwise, list recent sessions:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/list-sessions.sh" current --limit 7 --since "$(date -v-7d +%Y-%m-%d 2>/dev/null || date -d '7 days ago' +%Y-%m-%d)"
Present the list and ask the user which session to extract from (or default to the most recent).
Step 2: Run extraction
bash "${CLAUDE_PLUGIN_ROOT}/scripts/extract-knowledge.sh" SESSION_JSONL_PATH
This outputs a JSON array of candidate extractable items, each with:
category: value | decision | correction | pattern | lesson | referencecontent: summary texttimestamp: when it occurredsuggested_destination: memory | claude_md | knowledge_file | skipsuggested_type: value | user | feedback | project | referenceStep 3: Present items to user
For each item, present:
Step 4: Write approved items
If bureau owns reviewed knowledge in this project, offer its capture/compile/review path for durable claims. Do not promote the same claim independently to a second canon. Include session ID, timestamp and source event with every extraction; a summary is not independent evidence.
For each approved item, write to the chosen destination:
Memory file: Create ~/.claude/projects/<project>/memory/<name>.md with frontmatter:
---
name: <name>
description: <one-line summary>
type: <chosen type>
---
<content>
Then append an entry to MEMORY.md. If MEMORY.md doesn't exist, create it. If only a standalone MEMORY.md exists (no individual files), create the first individual file and convert MEMORY.md to an index.
Project instructions: Use the existing authoritative file. Prefer AGENTS.md when no CLAUDE instruction file masks it; never create CLAUDE.md in an AGENTS-only project. Inspect ancestor masking before proposing a write. If project root is unresolvable, offer memory file as fallback.
Knowledge file: Write markdown to the chosen path.
Step 5: Summary
Report what was extracted and where it was saved.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
8 commands in this plugin
/auditAudit memory staleness — heuristic scan or deep content verification/dashboardGlobal memory overview — staleness alerts, token costs, and stats across all projects/lessonsExtract accumulated wisdom from past sessions/pruneInteractive memory cleanup — review and prune stale memories/recallSearch past conversations for a topic, decision, or mistake. Pass --lite for raw, no-synthesis output (works on standard tier; cheapest API path)./recapSummarize recent sessionsnpx claudepluginhub xiaolai/echo-sleuth-for-claude --plugin echo-sleuthOther plugins' commands for the same job