/recover — Context Recovery After Compaction Purpose: Help you get back up to speed after context compaction. Automatically detects in-progress work (RPI runs, evolve cycles), loads relevant knowledge, summarizes what you were doing and what's next. Codex v0.115.0+ uses native hooks automatically; for older Codex versions, prefers the explicit hookless fallback path ( / ). YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it. CLI dependencies: gt, ao, bd — all optional. Shows what's available, skips what isn't. --- Quick Start --- Execution Steps Step 1: Detect In-Progress Sessions (Parall…

\"\ncheck \"SKILL.md has name: recover\" \"grep -q '^name: recover' '$SKILL_DIR/SKILL.md'\"\ncheck \"SKILL.md mentions compaction\" \"grep -qi 'compaction' '$SKILL_DIR/SKILL.md'\"\ncheck \"SKILL.md mentions context recovery\" \"grep -qi 'context.*recovery\\|recovery.*context\\|recover.*context' '$SKILL_DIR/SKILL.md'\"\ncheck \"SKILL.md has tier: session when metadata is present\" \"! grep -q '^metadata:' '$SKILL_DIR/SKILL.md' || grep -q '^[[:space:]]*tier:[[:space:]]*session' '$SKILL_DIR/SKILL.md'\"\n\necho \"\"; echo \"Results: $PASS passed, $FAIL failed\"\n[ $FAIL -eq 0 ] && exit 0 || exit 1\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":930,"content_sha256":"3938067cfdf48d9cfdd24696e7ff9a1dba2a1aa42fd540699a56851f8ff0307c"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"/recover — Context Recovery After Compaction","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Purpose:","type":"text","marks":[{"type":"strong"}]},{"text":" Help you get back up to speed after context compaction. Automatically detects in-progress work (RPI runs, evolve cycles), loads relevant knowledge, summarizes what you were doing and what's next. Codex v0.115.0+ uses native hooks automatically; for older Codex versions, prefers the explicit hookless fallback path (","type":"text"},{"text":"ao codex start","type":"text","marks":[{"type":"code_inline"}]},{"text":"/","type":"text"},{"text":"ao codex stop","type":"text","marks":[{"type":"code_inline"}]},{"text":").","type":"text"}]}]},{"type":"paragraph","content":[{"text":"YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it.","type":"text","marks":[{"type":"strong"}]}]},{"type":"paragraph","content":[{"text":"CLI dependencies:","type":"text","marks":[{"type":"strong"}]},{"text":" gt, ao, bd — all optional. Shows what's available, skips what isn't.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"/recover # Full recovery dashboard\n/recover --json # Machine-readable JSON output\nao codex status # Codex hookless lifecycle health\nao codex start # Rebuild startup context explicitly in Codex","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Execution Steps","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 1: Detect In-Progress Sessions (Parallel)","type":"text"}]},{"type":"paragraph","content":[{"text":"Run ALL of the following in parallel bash calls:","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 1 — RPI Phased State:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if [ -f .agents/rpi/phased-state.json ]; then\n echo \"=== RPI_STATE ===\"\n cat .agents/rpi/phased-state.json\nelse\n echo \"RPI_STATE=NONE\"\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 2 — Evolve Cycle History:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if [ -f .agents/evolve/cycle-history.jsonl ]; then\n echo \"=== EVOLVE_STATE ===\"\n tail -3 .agents/evolve/cycle-history.jsonl\nelse\n echo \"EVOLVE_STATE=NONE\"\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 3 — Git Recent Changes:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"echo \"=== GIT_STATUS ===\"\ngit status --short\n\necho \"=== GIT_LOG ===\"\ngit log --oneline -5\n\necho \"=== GIT_BRANCH ===\"\ngit branch --show-current","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 4 — Work Queue State:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if command -v bd &>/dev/null; then\n echo \"=== IN_PROGRESS ===\"\n bd list --status in_progress 2>/dev/null | head -3\n echo \"=== READY ===\"\n bd ready 2>/dev/null | head -3\nelse\n echo \"BD_UNAVAILABLE\"\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 5 — Knowledge and Messages:","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Knowledge artifacts\necho \"=== KNOWLEDGE_COUNT ===\"\necho \"Learnings=$(ls .agents/learnings/ 2>/dev/null | wc -l | tr -d ' ')\"\necho \"Patterns=$(ls .agents/patterns/ 2>/dev/null | wc -l | tr -d ' ')\"\n\n# Inbox if gt available\nif command -v gt &>/dev/null; then\n echo \"=== MESSAGES ===\"\n gt mail inbox 2>/dev/null | head -3\nelse\n echo \"GT_UNAVAILABLE\"\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"Call 6 — Codex Lifecycle (if available):","type":"text","marks":[{"type":"strong"}]}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if command -v ao &>/dev/null; then\n echo \"=== CODEX_STATUS ===\"\n ao codex status --json 2>/dev/null || echo \"CODEX_STATUS=UNAVAILABLE\"\nelse\n echo \"AO_UNAVAILABLE\"\nfi","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 2: Load Context from Knowledge Base","type":"text"}]},{"type":"paragraph","content":[{"text":"If RPI state detected, run:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if command -v ao &>/dev/null; then\n ao lookup --query \"rpi recovery context\" --limit 5 2>/dev/null || true\nfi","type":"text"}]},{"type":"paragraph","content":[{"text":"Apply retrieved knowledge:","type":"text","marks":[{"type":"strong"}]},{"text":" If learnings are returned, check each for applicability to the recovery context. Cite applicable learnings by filename and record: ","type":"text"},{"text":"ao metrics cite \"\u003cpath>\" --type applied 2>/dev/null || true","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"If Codex hookless fallback mode is detected (pre-v0.115.0, no native hooks), also run:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"if command -v ao &>/dev/null && { [ -n \"${CODEX_THREAD_ID:-}\" ] || [ \"${CODEX_INTERNAL_ORIGINATOR_OVERRIDE:-}\" = \"Codex Desktop\" ]; }; then\n ao codex start --no-maintenance 2>/dev/null || true\nfi","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 3: Parse and Summarize Session State","type":"text"}]},{"type":"paragraph","content":[{"text":"Extract from collected data:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"RPI Detection:","type":"text","marks":[{"type":"strong"}]},{"text":" If ","type":"text"},{"text":".agents/rpi/phased-state.json","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract ","type":"text"},{"text":"goal","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"epic_id","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"phase","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"cycle","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"started_at","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Map phase number to phase name (1=research, 2=plan, 3=implement, 4=validate)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Show elapsed time since started_at","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Evolve Detection:","type":"text","marks":[{"type":"strong"}]},{"text":" If ","type":"text"},{"text":".agents/evolve/cycle-history.jsonl","type":"text","marks":[{"type":"code_inline"}]},{"text":" exists:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read last entry for most recent cycle","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Extract ","type":"text"},{"text":"goals_fixed","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"result","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"timestamp","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Show latest cycle summary","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Recent Work:","type":"text","marks":[{"type":"strong"}]},{"text":" From git log:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Last 3 commits (extracted in Call 3)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Uncommitted changes count","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Pending Work:","type":"text","marks":[{"type":"strong"}]},{"text":" From beads:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"In-progress issues (up to 3)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ready issues count","type":"text"}]}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Knowledge State:","type":"text","marks":[{"type":"strong"}]}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Total learnings and patterns available","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Unread messages count if gt available","type":"text"}]}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 4: Render Recovery Dashboard","type":"text"}]},{"type":"paragraph","content":[{"text":"Assemble gathered data into this format:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":""},"content":[{"text":"══════════════════════════════════════════════════════════════\n Context Recovery Dashboard\n══════════════════════════════════════════════════════════════\n\nIN-PROGRESS RPI RUN\n Epic: \u003cepic_id>\n Goal: \u003cfirst 80 chars of goal>\n Phase: \u003cphase name: research | plan | implement | validate>\n Cycle: \u003ccycle #>\n Started: \u003ctime ago (e.g., \"2 hours ago\")>\n Status: \u003cPHASE_START | IN_PROGRESS | READY_FOR_GATE | ...>\n\n ─ Next Step: \u003cstate-aware suggestion from Step 5>\n\nOR\n\nRECENT EVOLVE CYCLE (IF NO RPI)\n Cycle: \u003ccycle #>\n Latest Goal: \u003cgoal_id or summary>\n Result: \u003cresult>\n Items Completed: \u003ccount or \"—\">\n Timestamp: \u003ctime ago>\n\n ─ Next Step: \u003cstate-aware suggestion from Step 5>\n\nOR\n\n[NO ACTIVE SESSION]\n No RPI run or evolve cycle in progress.\n Last activity: \u003ctime of last commit or \"unknown\">\n\nIN-PROGRESS WORK\n \u003clist up to 3 in-progress issues with IDs>\n \u003cor \"No in-progress work\">\n\nREADY TO WORK\n \u003ccount of ready issues>\n \u003cor \"No ready issues\">\n\nRECENT COMMITS\n \u003clast 3 commits>\n\nPENDING CHANGES\n \u003cuncommitted file count or \"clean\">\n\nKNOWLEDGE AVAILABLE\n Learnings: \u003ccount> Patterns: \u003ccount>\n\nINBOX\n \u003cmessage count or \"No messages\" or \"gt not installed\">\n\n──────────────────────────────────────────────────────────────\nSUGGESTED NEXT ACTION\n \u003cstate-aware command from Step 5>\n──────────────────────────────────────────────────────────────\n\nQUICK COMMANDS\n /status Current workflow dashboard\n /research Deep codebase exploration\n /plan Decompose work into issues\n /implement Execute a single issue\n /crank Autonomous epic execution\n /validation Full close-out and learnings\n══════════════════════════════════════════════════════════════","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 5: Suggest Next Action (State-Aware)","type":"text"}]},{"type":"paragraph","content":[{"text":"Evaluate context top-to-bottom. Use the FIRST matching condition:","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Priority","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Condition","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Suggestion","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"1","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RPI run in-progress + phase=research","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Continue research: ","type":"text"},{"text":"/research","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"/plan","type":"text","marks":[{"type":"code_inline"}]},{"text":" if ready\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"2","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RPI run in-progress + phase=plan","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Review plan: ","type":"text"},{"text":"/pre-mortem","type":"text","marks":[{"type":"code_inline"}]},{"text":" to validate before coding\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"3","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RPI run in-progress + phase=implement","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Resume implementation: ","type":"text"},{"text":"/implement \u003cnext-issue-id>","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"4","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RPI run in-progress + phase=validate","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Complete cycle: ","type":"text"},{"text":"/validation","type":"text","marks":[{"type":"code_inline"}]},{"text":" to extract learnings and close out\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"5","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Evolve cycle in-progress","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Continue autonomous improvements: ","type":"text"},{"text":"/evolve --resume","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"6","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"In-progress issues exist","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Continue work: ","type":"text"},{"text":"/implement \u003cissue-id>","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"8","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Ready issues available","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Pick next issue: ","type":"text"},{"text":"/implement \u003cfirst-ready-id>","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"9","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Uncommitted changes","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Review recent work: ","type":"text"},{"text":"/validation","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"10","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Clean state, nothing pending","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"\"Session recovered. Start with ","type":"text"},{"text":"/status","type":"text","marks":[{"type":"code_inline"}]},{"text":" to plan next work\"","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Step 6: JSON Output (--json flag)","type":"text"}]},{"type":"paragraph","content":[{"text":"If the user passed ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":", output all recovery data as structured JSON:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"session_type\": \"rpi|evolve|none\",\n \"rpi\": {\n \"epic_id\": \"ag-l2pu\",\n \"goal\": \"Implement...\",\n \"phase\": 2,\n \"phase_name\": \"plan\",\n \"cycle\": 1,\n \"started_at\": \"2026-02-15T14:33:36-05:00\",\n \"elapsed_minutes\": 120\n },\n \"evolve\": {\n \"cycle\": 3,\n \"result\": \"improved\",\n \"goals_fixed\": [\"goal1\", \"goal2\"],\n \"timestamp\": \"2026-02-15T22:00:00-05:00\"\n },\n \"work_state\": {\n \"in_progress_count\": 3,\n \"in_progress_issues\": [\"ag-042.1\", \"ag-042.2\"],\n \"ready_count\": 5,\n \"uncommitted_changes\": 2\n },\n \"git\": {\n \"branch\": \"main\",\n \"recent_commits\": [\n \"7de51c8 feat: wave 2 — structural assertions\",\n \"25004f8 fix: replace per-wave vibe gate\"\n ]\n },\n \"knowledge\": {\n \"learnings_count\": 12,\n \"patterns_count\": 5\n },\n \"inbox\": {\n \"unread_count\": 0\n },\n \"suggestion\": {\n \"priority\": 4,\n \"message\": \"Resume implementation: /implement ag-042.1\"\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"Render this with a single code block. No visual dashboard when ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":" is active.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Examples","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Recovery After Compaction Mid-RPI","type":"text"}]},{"type":"paragraph","content":[{"text":"User says:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/recover","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"What happens:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent runs 5 parallel bash calls to gather state","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent detects RPI run in phased-state.json (phase=2, epic ag-l2pu)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent runs ","type":"text"},{"text":"ao lookup --query \"rpi recovery context\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" to load relevant knowledge","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent shows goal, current phase (plan), cycle 1, started 2 hours ago","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent lists 2 in-progress issues and 3 ready issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent shows clean git state, recent commit","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent suggests: \"Review plan: ","type":"text"},{"text":"/pre-mortem","type":"text","marks":[{"type":"code_inline"}]},{"text":" to validate before coding\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Result:","type":"text","marks":[{"type":"strong"}]},{"text":" Dashboard confirms in-progress RPI session, loads context, suggests next step.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Recovery After Compaction With Evolve Cycle","type":"text"}]},{"type":"paragraph","content":[{"text":"User says:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/recover","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"What happens:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent gathers state in parallel","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent finds no RPI run","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent detects evolve cycle (most recent: cycle 3, result \"improved\", goals_fixed=[\"goal1\", \"goal2\"])","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent shows timestamp (1 hour ago), items_completed (8)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent loads knowledge with ","type":"text"},{"text":"ao lookup --query \"evolve cycle recovery\"","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent suggests: \"Continue autonomous improvements: ","type":"text"},{"text":"/evolve --resume","type":"text","marks":[{"type":"code_inline"}]},{"text":"\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Result:","type":"text","marks":[{"type":"strong"}]},{"text":" Dashboard confirms evolve cycle, shows progress, offers resume command.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Recovery in Clean State (No Active Session)","type":"text"}]},{"type":"paragraph","content":[{"text":"User says:","type":"text","marks":[{"type":"strong"}]},{"text":" ","type":"text"},{"text":"/recover","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"What happens:","type":"text","marks":[{"type":"strong"}]}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent gathers state in parallel","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent finds no RPI run, no evolve cycle","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent shows last 3 commits only","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent finds no in-progress work, no ready issues","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent shows 12 learnings available from knowledge base","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Agent suggests: \"Session recovered. Start with ","type":"text"},{"text":"/status","type":"text","marks":[{"type":"code_inline"}]},{"text":" to plan next work\"","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Result:","type":"text","marks":[{"type":"strong"}]},{"text":" Dashboard confirms clean state, points user to entry points.","type":"text"}]},{"type":"hr","attrs":{"markup":"---"}},{"type":"heading","attrs":{"level":2},"content":[{"text":"Troubleshooting","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Problem","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cause","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Solution","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Shows \"BD_UNAVAILABLE\" or \"GT_UNAVAILABLE\"","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"CLI tools not installed or not in PATH","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Install missing tools: ","type":"text"},{"text":"brew install bd","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"brew install gt","type":"text","marks":[{"type":"code_inline"}]},{"text":". Skill gracefully degrades by showing available state only.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RPI state shows wrong phase","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Stale phased-state.json not updated","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check timestamp of ","type":"text"},{"text":".agents/rpi/phased-state.json","type":"text","marks":[{"type":"code_inline"}]},{"text":". If stale, it may be from a previous run. Run ","type":"text"},{"text":"/status","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify current phase.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Evolve history shows wrong cycle","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Old cycle-history.jsonl entries not pruned","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Tail -3 shows most recent entries. Check all entries with ","type":"text"},{"text":"tail -20 .agents/evolve/cycle-history.jsonl","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Knowledge injection fails silently","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"ao CLI not installed or no knowledge artifacts","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Ensure ao installed: ","type":"text"},{"text":"brew install ao","type":"text","marks":[{"type":"code_inline"}]},{"text":". If no learnings exist, run ","type":"text"},{"text":"/validation","type":"text","marks":[{"type":"code_inline"}]},{"text":" to seed the knowledge base.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Suggested action doesn't match context","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"State-aware rules didn't capture edge case","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":" to inspect raw state and verify which condition matched. Review priority table in Step 5.","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"JSON output malformed","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parallel bash calls returned unexpected format","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check each bash call individually. Ensure jq parsing works on actual data. Validate JSON structure before returning to user.","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Documents","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"references/recover.feature","type":"text","marks":[{"type":"link","attrs":{"href":"references/recover.feature","title":null}}]},{"text":" — Executable spec: detect rpi phase from phased-state, surface claimed/ready bd work, recent git, --json dashboard (soc-qk4b)","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"recover","author":"@skillopedia","source":{"stars":375,"repo_name":"agentops","origin_url":"https://github.com/boshu2/agentops/blob/HEAD/skills/recover/SKILL.md","repo_owner":"boshu2","body_sha256":"a0492c27f3a976663bbd71ddc0c43713cf90fb2c10efa4e91c50c23bc15b848a","cluster_key":"b43e0ad70eaf429ec9a25feadbcec81591accb77fe20949cac22d2434e83fed1","clean_bundle":{"format":"clean-skill-bundle-v1","source":"boshu2/agentops/skills/recover/SKILL.md","attachments":[{"id":"5a76c69f-7b9c-5949-81f7-a215f59db40c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5a76c69f-7b9c-5949-81f7-a215f59db40c/attachment","path":"references/.gitkeep","size":0,"sha256":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","contentType":"text/plain; charset=utf-8"},{"id":"c27aa6c7-4ef6-5951-b790-98485462b78d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c27aa6c7-4ef6-5951-b790-98485462b78d/attachment.feature","path":"references/recover.feature","size":1210,"sha256":"d4779d6acfab367e5a10867ab2712fcd082a9f0ad68327bd275e03a12886ac7f","contentType":"text/plain; charset=utf-8"},{"id":"e787602e-fac5-5359-a226-cf54f9af0ec6","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/e787602e-fac5-5359-a226-cf54f9af0ec6/attachment.sh","path":"scripts/validate.sh","size":930,"sha256":"3938067cfdf48d9cfdd24696e7ff9a1dba2a1aa42fd540699a56851f8ff0307c","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"b2eee975a677302d74c83854bb00bb200f18f4b436ddf47cfeb65ceb7a3d4811","attachment_count":3,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":2,"excluded_attachments":[]},"cluster_size":2,"skill_md_path":"skills/recover/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"general","category_label":"General"},"exact_dupes_collapsed_into_this":1},"context":{"intent":{"mode":"none"},"window":"inherit","intel_scope":"none"},"version":"v1","category":"general","consumes":["bd","rpi"],"metadata":{"tier":"session","dependencies":[]},"produces":[".agents/rpi/*.md"],"practices":["sre","legacy-code-seams","pragmatic-programmer"],"import_tag":"clean-skills-v1","context_rel":[],"description":"Recover session context.","hexagonal_role":"driving-adapter","output_contract":"stdout: recovered context summary","skill_api_version":1}},"renderedAt":1782981045458}

/recover — Context Recovery After Compaction Purpose: Help you get back up to speed after context compaction. Automatically detects in-progress work (RPI runs, evolve cycles), loads relevant knowledge, summarizes what you were doing and what's next. Codex v0.115.0+ uses native hooks automatically; for older Codex versions, prefers the explicit hookless fallback path ( / ). YOU MUST EXECUTE THIS WORKFLOW. Do not just describe it. CLI dependencies: gt, ao, bd — all optional. Shows what's available, skips what isn't. --- Quick Start --- Execution Steps Step 1: Detect In-Progress Sessions (Parall…