What's Fixed
Session catchup after /clear now works. (#106, reported by @tony-stark-eth)
Root Causes Found
1. Path sanitization bug (Windows)
On Windows, Claude Code hooks run via Git Bash which passes paths as /c/Users/.... But Claude Code stores sessions under C--Users-.... The session-catchup script was converting /c/Users/... → -c-Users-... which never matched any session directory. Sessions were silently not found.
Fix: Added normalize_path() that converts Git Bash paths (/c/Users/...) to Windows paths (C:\Users\...) before sanitizing. Verified against real session directories — now resolves correctly.
2. Hook output was advisory, not actionable
The UserPromptSubmit hook (added in v2.23.0 to fix this exact issue) only said:
[planning-with-files] Active plan detected. If you have not read task_plan.md...
After /clear, the agent has zero context. A text hint is not enough — the agent needs actual content. Now the hook injects the plan directly:
[planning-with-files] ACTIVE PLAN — current state:
# Task Plan
## Goal
Build a REST API with authentication...
## Current Phase
Phase 2: Database Integration - in_progress
...
--- recent progress ---
1. Created database connection module
2. Fixed docker networking issue
...
[planning-with-files] Read findings.md for research context. Continue from the current phase.
The agent now has the goal, phases, current status, and recent actions injected before it even starts processing your message.
3. UTF-8 encoding on Windows
Session JSONL files contain UTF-8 but Python on Windows defaults to cp1252. Added explicit encoding='utf-8' to prevent UnicodeDecodeError on non-ASCII content.
Testing
Added automated test suite (tests/test_clear_recovery.sh) — 11 assertions covering hook output, path sanitization, encoding, and separator handling:
bash tests/test_clear_recovery.sh
Changes
All fixes synced to every IDE variant (Cursor, Codex, CodeBuddy, Gemini, Factory, Mastra, OpenCode, Pi, Continue) via sync-ide-folders.py.
The core skill (skills/planning-with-files/SKILL.md body, templates, examples, reference) is untouched — only the hook command and session-catchup.py were changed.