Watcher performance

How pcr start stays cheap on your machine

pcr start is designed to run in the background indefinitely without you noticing it. On a typical multi-project setup it uses a few percent of one CPU core in steady state and writes a few KB / second to the local SQLite store.

Polling intervals

WatcherIntervalWork per tick
Cursor scan20sWalk the agent-transcripts tree, plus an fsnotify fast-path for changes between scans
Diff tracker3s per registered projectgit status -z + content fingerprint of each dirty file
Session-state watcher2sCheap SQLite read against Cursor's session store
Claude CodefsnotifyEvent-driven, debounced 500ms
VS Code CopilotfsnotifyEvent-driven, debounced 500ms

Bounded work

  • Project list is cached per-process and only re-read when ~/.pcr-dev/projects.json's mtime changes — turns ~30 disk reads/min into one metadata() syscall per call
  • Dirty file fingerprints are bounded — files larger than 50 MB are tracked by (size, mtime) only; everything else SHA-256s the first 256 KB plus the file size. A stray .log file in the working tree can't peg a CPU core.
  • Diff-tracker state file is only re-written to disk when at least one project's hashes actually moved — idle projects produce zero disk writes
  • Cursor session JSON (often 50–500 KB) is parsed once per session per minute and reused across save_completed_turn calls
  • TUI rendering clears only what it touches and pre-sanitizes prompt / response text before wrap so long lines never overflow the pane

What you can do if it ever feels heavy

  • Run pcr gc --drafts-older-than 30d to keep the local store small
  • Use pcr start --plain if you don't want the full-screen TUI in the watcher terminal
  • If a specific repo is producing huge dirty files (build artifacts, logs), add them to .gitignore so git status stops tracking them

If you observe sustained high CPU or memory growth, please file an issue with a pcr status --json snapshot and roughly what you were doing — the watcher is small enough that any regression is easy to track down.