Weekly graph maintenance: backup → analyze → prune → report#29
Merged
Conversation
3 tasks
stevepridemore
added a commit
that referenced
this pull request
May 10, 2026
Adds prompts/weekly-maintenance.md as the source-controlled prompt for a new weekly scheduled task. Combines three bodies of work that were each partially in place: - The graph_export backup (previously in a dormant ~/.claude/scheduled- tasks/weekly-graph-backup/SKILL.md folder that was never registered as a scheduled task) - The dream-weekly.md health analysis (in the repo since the early bootstrap, never scheduled) - A new graph_prune step (no prior implementation) The shape: backup → analyze → prune → report, with safety gates: 1. Backup MUST succeed before any subsequent step runs (prune-with-no- backup is the failure mode the design avoids). 2. Prune sanity check: if preview shows >50 nodes to remove, abort and log a warning rather than executing. A sudden large prune count usually indicates a config change or bug, not legitimate cleanup. 3. Contradictions and duplicates are surfaced for human review only — never auto-resolved or auto-merged. scripts/sync-dream-skill.py extended to handle multiple tasks via a TASKS table. New --task flag syncs only one; without it, syncs all. Keeps the existing CRLF→LF discipline for SKILL.md parser compatibility. The scheduled task itself is registered separately via the scheduled- tasks MCP create_scheduled_task call (not source-controlled — that's local Claude Code state per machine). Cron: "0 6 * * 0" — Sunday 6 AM local time. Next run ~5 hours from this commit. Stale ~/.claude/scheduled-tasks/weekly-graph-backup/ folder removed locally as part of this change. The new task ID is weekly-graph- maintenance, replacing the never-registered weekly-graph-backup name. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a weekly scheduled task that runs every Sunday at 6 AM local time. The task does three things in sequence — backup, health analysis, and pruning — with safety gates between each.
This fills a real gap: the project has been running the nightly dream for weeks but no graph backups have actually been happening since 2026-05-06. A folder existed at `~/.claude/scheduled-tasks/weekly-graph-backup/` but was never registered as a routine in Claude Code's scheduled-tasks system, so it sat dormant. Same fate as `prompts/dream-weekly.md` (analysis prompt that's been in the repo since bootstrap, never scheduled).
This PR consolidates both into one weekly task with prune wrapped in.
What's in the PR
Safety design
Schedule
Registered via the scheduled-tasks MCP (`create_scheduled_task`):
```
taskId: weekly-graph-maintenance
cronExpression: 0 6 * * 0 (Sunday 6:00 AM, local time)
nextRunAt: 2026-05-10T10:00:05Z (= Sunday 6:00 AM ET)
```
Schedule registration is local Claude Code state per machine — not in source control. The prompt body that runs IS in source control via this PR.
Cleanup
Deleted local stale `~/.claude/scheduled-tasks/weekly-graph-backup/` folder. The new task ID (`weekly-graph-maintenance`) replaces the never-registered `weekly-graph-backup` name and reflects the broader scope.
Test plan
🤖 Generated with Claude Code