You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(watcher): cursor table grows without bound — no pruning of stale entries #740
The live_cursor table stores one row per unique JSONL file path ever encountered. No pruning or eviction occurs. After 6 months of Claude Code sessions (each creating a new UUID.jsonl), the table accumulates hundreds of thousands of rows.
On daemon restart, _catch_up iterates ALL files and calls _fingerprint_file which reads every file into memory for SHA-256 hashing. With 487,000 cursor rows and no mtime-based fast path, restart catch-up takes hours. With mtime-based fast path (see #736), the cursor table size determines the O(n) scan cost.
Additionally, there's no cleanup for files that no longer exist on disk — they remain in the cursor table forever.
Acceptance criteria
Add retention policy: prune cursor entries for files not modified in N days (e.g., 90 days)
OR automatically remove cursor entries when the corresponding file no longer exists on disk
OR add a manual polylogue status --prune-cursors command
Test: insert 10,000 cursor rows, run prune, verify stale entries removed
Found by
2026-05-03 pre-mortem analysis (wave 7). Related to #736 (catch-up performance) and #733 (file exclusion).
Activity
Sinity commentedon May 3, 2026
Scope absorbed into #620 (live cursor/freshness). File exclusion, pending dict eviction, and cursor table pruning are all watcher robustness concerns.