[Sprint 8] perf: Add cooldown to project-hygiene cleanup hook #324
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add a cooldown period to the project-hygiene cleanup hook to avoid running
findon every file edit.Implementation: Change V5.5.0 (Sprint 8)
Problem
The hook runs
findacross the entire project directory on everyWriteorEditoperation, looking for temp files. This adds overhead to every file edit, even when there are no temp files to clean.Solution
Add a 60-second cooldown using a temp file:
Using
$PPIDties the cooldown to the Claude session.Acceptance Criteria
Files to Modify
plugins/project-hygiene/hooks/cleanup.shMilestone: Sprint 8 - Hook Efficiency Quick Wins
Progress Update
Status: In Progress
Phase: Implementation
Tool Calls: 6 (budget: 100)
Completed
developmentbranch (full access)In Progress
Blockers
Next
Progress Update
Status: Complete (not committed)
Phase: Implementation Done
Tool Calls: 12 (budget: 100)
Completed
developmentbranch (full access)Implementation Summary
File Modified:
plugins/project-hygiene/hooks/cleanup.shChanges Made:
Added cooldown check after stdin consumption (lines 13-22):
/tmp/project-hygiene-${PPID}-last-runto store last run timestamp$PPIDensures different Claude sessions have independent cooldownsAdded timestamp recording at end (line 40):
Acceptance Criteria Verification:
$PPIDcreates unique temp filesFile grew from 29 to 43 lines (+14 lines)
Not Done (per instructions)