Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand All @@ -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"]
}
]
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation command fails for paths containing spaces

Low Severity

The todo restore command cat ~/.claude/projects/$(echo $PWD | sed 's|/|-|g')/todos.md has an unquoted command substitution. When $PWD contains spaces (e.g., /home/user/my project), the sed output -home-user-my project undergoes word splitting, causing cat to receive incorrect arguments and fail. The command substitution needs to be quoted to preserve spaces in the resulting path.

Additional Locations (1)

Fix in Cursor Fix in Web

```

Then use TodoWrite to restore your progress. Your todos survive compaction, session
restarts, and even `--resume` across days.

## Example Usage

```bash
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions plugins/core/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
}
8 changes: 8 additions & 0 deletions plugins/core/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recovery path computation differs from save path location

High Severity

The recovery command in context.md computes the path as ~/.claude/projects/$(echo $PWD | sed 's|/|-|g')/todos.md, but todo-persist.sh saves to $(dirname "$TRANSCRIPT_PATH")/todos.md. These use entirely different mechanisms—one statically derives the path from $PWD, while the other dynamically uses the parent of transcript_path. If Claude Code's project directory naming doesn't exactly match the sed-based path transformation, the recovery instructions will point to the wrong location, making saved todos unfindable after context compaction.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recovery command fails for paths containing spaces

Medium Severity

The recovery command lacks proper quoting: cat ~/.claude/projects/$(echo $PWD | sed 's|/|-|g')/todos.md. If $PWD contains spaces (common on macOS like /Users/name/My Projects/repo), the unquoted command substitution causes word splitting, making cat receive multiple invalid path arguments. The command would fail entirely rather than finding the saved todos file.

Fix in Cursor Fix in Web

2. If found, restore them via TodoWrite to continue tracking progress
15 changes: 15 additions & 0 deletions plugins/core/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"hooks": {
"PostToolUse": [
{
"matcher": "TodoWrite",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/todo-persist.sh"
}
]
}
]
}
}
52 changes: 52 additions & 0 deletions plugins/core/hooks/todo-persist.sh
Original file line number Diff line number Diff line change
@@ -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")
Comment on lines +24 to +25
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The analysis is incorrect. Claude Code stores transcript files directly in the project directory (~/.claude/projects//<session_id>.jsonl), not in a transcripts/ subdirectory. So dirname "$TRANSCRIPT_PATH" correctly points to the project directory where recovery expects to find todos.md.

Verified: The saved file at ~/.claude/projects/-Users-nick-src-ai-coding-config/todos.md matches the recovery path from context.md.


# Convert to readable markdown
{
echo "# Saved Todos"
echo ""
echo "Updated: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"
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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi-line todo content splits into separate list items

Low Severity

The while read -r item loop processes content line-by-line, so if a todo's .content field contains embedded newlines, each line becomes a separate markdown list item in the output. A single todo with content like "Fix bug\nAdd tests" would be saved as two separate items - Fix bug and - Add tests, corrupting the todo structure when restored.

Fix in Cursor Fix in Web

echo ""
fi
done
} > "$PROJECT_DIR/todos.md"

exit 0