Skip to content

Commit 2bd1cf4

Browse files
committed
refactor: replace TodoWrite backup system with native Task tools
Claude Code's Task tools (TaskCreate, TaskUpdate, TaskList, TaskGet) persist natively across context compaction without requiring hooks. Removes: - PreCompact hook (save-todowrite.sh) - SessionStart hook (restore-todowrite.sh) - Backup directory logic in .claude/backups/todowrite/ Updates: - inject-session-instructions.sh: Reference TaskCreate instead of TodoWrite - auto_learn_mistakes.py: Suggest TaskCreate instead of TodoWrite - v2.0 STATE.md: Mark task-tools-integration completed Task ID: v2.0-task-tools-integration
1 parent 2a16334 commit 2bd1cf4

7 files changed

Lines changed: 12 additions & 144 deletions

File tree

.claude/cat/issues/v2/v2.0/STATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ Prepare CAT for commercial release with pricing tiers, license key system, and b
7070
- work-box-hook-precomputation
7171
- research-executive-summary
7272
- license-validation-server-jetty-setup
73+
- task-tools-integration
7374

7475
## Tasks Pending
75-
- task-tools-integration
7676
- split-retrospective-files-by-time
7777
- optimize-git-squash
7878
- move-planning-to-issues-subdir
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# State
22

3-
- **Status:** pending
4-
- **Progress:** 0%
3+
- **Status:** completed
4+
- **Progress:** 100%
5+
- **Resolution:** implemented
56
- **Dependencies:** []
67
- **Last Updated:** 2026-01-24
8+
- **Completed:** 2026-01-24

plugin/hooks/hooks.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
}
2626
]
2727
},
28-
{
29-
"hooks": [
30-
{
31-
"type": "command",
32-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/restore-todowrite.sh"
33-
}
34-
]
35-
},
3628
{
3729
"hooks": [
3830
{
@@ -68,16 +60,6 @@
6860
]
6961
}
7062
],
71-
"PreCompact": [
72-
{
73-
"hooks": [
74-
{
75-
"type": "command",
76-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/save-todowrite.sh"
77-
}
78-
]
79-
}
80-
],
8163
"PreToolUse": [
8264
{
8365
"matcher": "AskUserQuestion",

plugin/hooks/inject-session-instructions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MESSAGE=$(cat << 'INSTRUCTIONS'
4444
4545
**When user input arrives mid-operation**:
4646
1. **STOP** current task analysis immediately
47-
2. Add to TodoWrite (all issues, even just 2-3 items)
47+
2. Track with TaskCreate if needed (all issues, even just 2-3 items)
4848
3. If impacts current task → address now; else → add to end
4949
4. Acknowledge before continuing
5050

plugin/hooks/posttool_handlers/auto_learn_mistakes.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ def check(self, tool_name: str, tool_result: dict, context: dict) -> dict | None
4848
return None
4949

5050
# Build suggestion
51-
todowrite_content = f"LFM: Investigate {mistake_type} from {tool_name}"
52-
todowrite_active = f"Investigating {mistake_type} mistake"
51+
task_subject = f"LFM: Investigate {mistake_type} from {tool_name}"
52+
task_active_form = f"Investigating {mistake_type} mistake"
5353

5454
return {
5555
"additionalContext": f"""📚 MISTAKE DETECTED: {mistake_type}
5656
57-
**MANDATORY**: Check TodoWrite for existing entry, add if not present:
58-
- content: "{todowrite_content}"
59-
- status: "pending"
60-
- activeForm: "{todowrite_active}"
57+
**MANDATORY**: Use TaskCreate to track this investigation:
58+
- subject: "{task_subject}"
59+
- description: "Investigate {mistake_type} detected during {tool_name} execution"
60+
- activeForm: "{task_active_form}"
6161
6262
**Context**: Detected {mistake_type} during {tool_name} execution.
6363
**Details**: {mistake_details[:500] if mistake_details else 'N/A'}"""

plugin/hooks/restore-todowrite.sh

Lines changed: 0 additions & 70 deletions
This file was deleted.

plugin/hooks/save-todowrite.sh

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)