From 9d5cfb47ff6faf8f1bc7682a26b803ee0da05b25 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Wed, 21 Jan 2026 13:19:32 -0600 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20Add=20todo=20persistence=20hook?= =?UTF-8?q?s=20to=20survive=20context=20compaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Todos are now automatically saved to Claude's project directory via a PostToolUse hook. After compaction, todos can be restored by checking ~/.claude/projects/{project}/todos.md - Add PostToolUse hook that saves todos as human-readable markdown - Use transcript_path to store in Claude's existing project directory - Add restoration instructions to context.md Co-Authored-By: Claude Opus 4.5 --- plugins/core/.claude-plugin/plugin.json | 3 +- plugins/core/context.md | 8 ++++ plugins/core/hooks/hooks.json | 15 +++++++ plugins/core/hooks/todo-persist.sh | 52 +++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 plugins/core/hooks/hooks.json create mode 100755 plugins/core/hooks/todo-persist.sh diff --git a/plugins/core/.claude-plugin/plugin.json b/plugins/core/.claude-plugin/plugin.json index d885e6c..a45c650 100644 --- a/plugins/core/.claude-plugin/plugin.json +++ b/plugins/core/.claude-plugin/plugin.json @@ -9,5 +9,6 @@ "homepage": "https://github.com/TechNickAI/ai-coding-config", "repository": "https://github.com/TechNickAI/ai-coding-config", "license": "MIT", - "keywords": ["commands", "agents", "skills", "workflows", "essential"] + "keywords": ["commands", "agents", "skills", "workflows", "essential"], + "hooks": "./hooks/hooks.json" } diff --git a/plugins/core/context.md b/plugins/core/context.md index c0f4dc8..da9cc2b 100644 --- a/plugins/core/context.md +++ b/plugins/core/context.md @@ -15,3 +15,11 @@ co-creative evolution for the whole. Coding rules are available in `rules/`. Use `/load-rules` to analyze the current task and load relevant rules dynamically. + +# Todo Persistence + +Todos are automatically saved to Claude's project directory via hooks. After context +compaction, if your todo list appears empty but you were working on tasks: + +1. Check for saved todos: `cat ~/.claude/projects/$(echo $PWD | sed 's|/|-|g')/todos.md` +2. If found, restore them via TodoWrite to continue tracking progress diff --git a/plugins/core/hooks/hooks.json b/plugins/core/hooks/hooks.json new file mode 100644 index 0000000..c7f2d7c --- /dev/null +++ b/plugins/core/hooks/hooks.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "TodoWrite", + "hooks": [ + { + "type": "command", + "command": "${CLAUDE_PLUGIN_ROOT}/hooks/todo-persist.sh" + } + ] + } + ] + } +} diff --git a/plugins/core/hooks/todo-persist.sh b/plugins/core/hooks/todo-persist.sh new file mode 100755 index 0000000..ba112b0 --- /dev/null +++ b/plugins/core/hooks/todo-persist.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# PostToolUse hook for TodoWrite: Save todos in human-readable format +# Saves to Claude's existing project directory for restoration after compaction + +# Read JSON input from stdin +INPUT=$(cat) + +# Extract fields +TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty') +TRANSCRIPT_PATH=$(echo "$INPUT" | jq -r '.transcript_path // empty') + +# Only process TodoWrite calls +if [ "$TOOL_NAME" != "TodoWrite" ]; then + exit 0 +fi + +# Extract todos array from tool_input +TODOS=$(echo "$INPUT" | jq -r '.tool_input.todos // empty') + +if [ -z "$TODOS" ] || [ "$TODOS" = "null" ] || [ -z "$TRANSCRIPT_PATH" ]; then + exit 0 +fi + +# Use Claude's existing project directory (parent of transcript file) +PROJECT_DIR=$(dirname "$TRANSCRIPT_PATH") + +# Convert to readable markdown +{ + echo "# Saved Todos" + echo "" + echo "Updated: $(date -Iseconds)" + echo "" + + # Group by status + for status in "in_progress" "pending" "completed"; do + items=$(echo "$TODOS" | jq -r --arg s "$status" '.[] | select(.status == $s) | .content') + if [ -n "$items" ]; then + case $status in + in_progress) echo "## In Progress" ;; + pending) echo "## Pending" ;; + completed) echo "## Completed" ;; + esac + echo "" + echo "$items" | while read -r item; do + [ -n "$item" ] && echo "- $item" + done + echo "" + fi + done +} > "$PROJECT_DIR/todos.md" + +exit 0 From 26a2caf1a18a1502087f54bd2e9d460db1db37f5 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Wed, 21 Jan 2026 13:34:20 -0600 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20Fix=20date=20command=20porta?= =?UTF-8?q?bility=20for=20macOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use POSIX-compliant date format that works on both GNU and BSD date. Co-Authored-By: Claude Opus 4.5 --- plugins/core/hooks/todo-persist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/core/hooks/todo-persist.sh b/plugins/core/hooks/todo-persist.sh index ba112b0..2414547 100755 --- a/plugins/core/hooks/todo-persist.sh +++ b/plugins/core/hooks/todo-persist.sh @@ -28,7 +28,7 @@ PROJECT_DIR=$(dirname "$TRANSCRIPT_PATH") { echo "# Saved Todos" echo "" - echo "Updated: $(date -Iseconds)" + echo "Updated: $(date -u +"%Y-%m-%dT%H:%M:%SZ")" echo "" # Group by status From 20a2acd31d08d0d0b59031f705b587ed56d17ff7 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Wed, 21 Jan 2026 13:54:36 -0600 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=93=9D=20Document=20todo=20persistenc?= =?UTF-8?q?e=20feature=20in=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Highlights the solution to todos being lost during context compaction - a common pain point for Claude Code users. Co-Authored-By: Claude Opus 4.5 --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3641120..915f314 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,22 @@ Then run the interactive setup: This detects your stack and installs relevant configurations. +## Todo Persistence Across Compaction + +**The problem**: Claude Code's context compaction summarizes conversation history to stay +within token limits. When this happens, your todo list vanishes - you lose track of +what you were working on. + +**The solution**: This plugin automatically saves todos to disk via hooks. After +compaction, restore them: + +```bash +cat ~/.claude/projects/$(echo $PWD | sed 's|/|-|g')/todos.md +``` + +Then use TodoWrite to restore your progress. Your todos survive compaction, session +restarts, and even `--resume` across days. + ## Example Usage ```bash @@ -272,7 +288,8 @@ ai-coding-config/ │ ├── core/ # Main plugin │ │ ├── commands/ # 18 workflow commands │ │ ├── agents/ # 24 specialized agents -│ │ └── skills/ # 6 autonomous capabilities +│ │ ├── skills/ # 6 autonomous capabilities +│ │ └── hooks/ # Todo persistence hooks │ └── personalities/ # 7 personality variants ├── .cursor/rules/ # 33 coding standards (.mdc) ├── docs/ # Guides From f71d02f3f59fcab23900995895ad5d07520dac02 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Wed, 21 Jan 2026 13:56:37 -0600 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=96=20Bump=20version=20to=209.15.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New feature: Todo persistence hooks survive context compaction. Co-Authored-By: Claude Opus 4.5 --- .claude-plugin/marketplace.json | 4 ++-- plugins/core/.claude-plugin/plugin.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ffa718e..ac00a3c 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -6,7 +6,7 @@ }, "metadata": { "description": "Professional AI coding configurations, agents, skills, and context for Claude Code and Cursor", - "version": "9.14.0", + "version": "9.15.0", "license": "MIT", "repository": "https://github.com/TechNickAI/ai-coding-config" }, @@ -15,7 +15,7 @@ "name": "ai-coding-config", "source": "./plugins/core", "description": "Commands, agents, skills, and context for AI-assisted development workflows", - "version": "9.14.0", + "version": "9.15.0", "tags": ["commands", "agents", "skills", "workflows", "essential"] } ] diff --git a/plugins/core/.claude-plugin/plugin.json b/plugins/core/.claude-plugin/plugin.json index a45c650..a04389c 100644 --- a/plugins/core/.claude-plugin/plugin.json +++ b/plugins/core/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "ai-coding-config", - "version": "9.14.0", + "version": "9.15.0", "description": "Commands, agents, skills, and context for AI-assisted development workflows", "author": { "name": "TechNickAI",