session-source-recovery
Recover lost source files from pi session history when files were deleted but never committed to git.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Recover lost source files from pi session history when files were deleted but never committed to git.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Never run Docker containers as root. Enforce USER directive in Dockerfiles and user: in compose files. Database images are the only exception.
Handle packages migrating between pnpm workspaces. Clean stale root copies, update workspace configs, fix broken workspace:* references.
Improve the Hormuz clock model through new signal classes, schema changes, uncertainty modeling, and better rendering or branch logic
Revise fork-tax protocols so they assume concurrent agents by default in shared workspaces, forbid destructive repo-wide cleanup of unrelated dirt, and require path-scoped staging plus explicit blocker recording.
Persist the full working state into git (commit + tag + push + manifest artifacts) as a deterministic handoff snapshot. Use when the user requests Π / fork tax / full dump.
Standardize human login, service identity, and inter-service auth around AT Protocol DIDs and Bluesky-backed one-time sign-in, while removing host-local static secrets and bespoke per-service auth flows.
| name | session-source-recovery |
| description | Recover lost source files from pi session history when files were deleted but never committed to git. |
| triggers | ["file was deleted","file is missing","recover from session","session history"] |
An agent deleted or lost source files that were never committed to git. The files may still exist in pi session JSONL files as tool call arguments (e.g., apply_patch calls).
Search pi session history for references to the lost files:
grep -rl "filename-or-package-name" ~/.pi/agent/sessions/ --include="*.jsonl"
Pi sessions store apply_patch tool calls as JSON with patchText fields containing *** Begin Patch / *** End Patch blocks.
Use Python to extract file contents from JSONL:
import json, re
# Read JSONL, find toolCall blocks with name="apply_patch"
# Extract patchText, split on *** Add/Modify File: directives
# Strip leading + and line numbers from patch content
tsc --noEmit if possiblesession (metadata)message with message.role and message.content (list of blocks)type: "toolCall", name: "apply_patch", arguments.patchTextmessage entries with matching tool call IDswrite tool (not apply_patch) may have different structure