[PR #33] [MERGED] feat: Add session recovery after /clear (v2.2.0) #62

Closed
opened 2026-03-03 18:50:23 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OthmanAdi/planning-with-files/pull/33
Author: @lasmarois
Created: 1/17/2026
Status: Merged
Merged: 1/17/2026
Merged by: @OthmanAdi

Base: masterHead: feature/session-catchup-recovery


📝 Commits (1)

  • 69ded71 feat: Add session recovery after /clear (v2.2.0)

📊 Changes

8 files changed (+758 additions, -39 deletions)

View changed files

📝 .claude-plugin/plugin.json (+1 -1)
📝 CHANGELOG.md (+42 -0)
📝 README.md (+43 -4)
📝 planning-with-files/SKILL.md (+24 -17)
planning-with-files/scripts/session-catchup.py (+208 -0)
scripts/session-catchup.py (+208 -0)
📝 skills/planning-with-files/SKILL.md (+24 -17)
skills/planning-with-files/scripts/session-catchup.py (+208 -0)

📄 Description

Summary

This PR adds automatic session recovery, allowing users to seamlessly continue work after running /clear when the context window fills up.

The Problem

When working on complex tasks, the context window eventually fills up. Users must run /clear to continue, but this loses all conversation context. If planning files (task_plan.md, progress.md, findings.md) weren't fully updated before context filled up, that work is lost.

The Solution

A new session-catchup.py script that:

  1. Analyzes the previous session's JSONL file (stored in ~/.claude/projects/)
  2. Finds the last time planning files were updated
  3. Extracts conversation that happened after that point (the "lost" context)
  4. Displays a catchup report so users can sync their planning files

The recovery is triggered automatically when invoking /planning-with-files - no additional setup required.

Optimal Workflow

  1. Disable auto-compact in Claude Code settings (use full context window)
  2. Start fresh session
  3. Run /planning-with-files when ready for complex task
  4. Work until context fills up
  5. Run /clear
  6. Run /planning-with-files again — automatically recovers where you left off

Changes

  • New: scripts/session-catchup.py - Core recovery script (in all 3 locations for compatibility)
  • Updated: SKILL.md - Restructured (~100 lines) with session recovery as first instruction
  • Updated: README.md - Added optimal workflow and setup instructions
  • Updated: CHANGELOG.md - v2.2.0 release notes
  • Updated: PreToolUse hook now includes Read/Glob/Grep for better attention management
  • Provides a workaround for #24 (SessionStart hook not working) by using SKILL.md instructions instead of hooks for session recovery

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OthmanAdi/planning-with-files/pull/33 **Author:** [@lasmarois](https://github.com/lasmarois) **Created:** 1/17/2026 **Status:** ✅ Merged **Merged:** 1/17/2026 **Merged by:** [@OthmanAdi](https://github.com/OthmanAdi) **Base:** `master` ← **Head:** `feature/session-catchup-recovery` --- ### 📝 Commits (1) - [`69ded71`](https://github.com/OthmanAdi/planning-with-files/commit/69ded714b7845ccd12a39bd68f4665aa4091940a) feat: Add session recovery after /clear (v2.2.0) ### 📊 Changes **8 files changed** (+758 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `.claude-plugin/plugin.json` (+1 -1) 📝 `CHANGELOG.md` (+42 -0) 📝 `README.md` (+43 -4) 📝 `planning-with-files/SKILL.md` (+24 -17) ➕ `planning-with-files/scripts/session-catchup.py` (+208 -0) ➕ `scripts/session-catchup.py` (+208 -0) 📝 `skills/planning-with-files/SKILL.md` (+24 -17) ➕ `skills/planning-with-files/scripts/session-catchup.py` (+208 -0) </details> ### 📄 Description ## Summary This PR adds automatic session recovery, allowing users to seamlessly continue work after running `/clear` when the context window fills up. ## The Problem When working on complex tasks, the context window eventually fills up. Users must run `/clear` to continue, but this loses all conversation context. If planning files (`task_plan.md`, `progress.md`, `findings.md`) weren't fully updated before context filled up, that work is lost. ## The Solution A new `session-catchup.py` script that: 1. Analyzes the previous session's JSONL file (stored in `~/.claude/projects/`) 2. Finds the last time planning files were updated 3. Extracts conversation that happened *after* that point (the "lost" context) 4. Displays a catchup report so users can sync their planning files The recovery is triggered automatically when invoking `/planning-with-files` - no additional setup required. ## Optimal Workflow 1. Disable auto-compact in Claude Code settings (use full context window) 2. Start fresh session 3. Run `/planning-with-files` when ready for complex task 4. Work until context fills up 5. Run `/clear` 6. Run `/planning-with-files` again — automatically recovers where you left off ## Changes - **New:** `scripts/session-catchup.py` - Core recovery script (in all 3 locations for compatibility) - **Updated:** `SKILL.md` - Restructured (~100 lines) with session recovery as first instruction - **Updated:** `README.md` - Added optimal workflow and setup instructions - **Updated:** `CHANGELOG.md` - v2.2.0 release notes - **Updated:** PreToolUse hook now includes Read/Glob/Grep for better attention management ## Related Issues - Provides a workaround for #24 (SessionStart hook not working) by using SKILL.md instructions instead of hooks for session recovery --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 18:50:23 +03:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/planning-with-files#62
No description provided.