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
| Watcher | Interval | Work per tick |
|---|---|---|
| Cursor scan | 20s | Walk the agent-transcripts tree, plus an fsnotify fast-path for changes between scans |
| Diff tracker | 3s per registered project | git status -z + content fingerprint of each dirty file |
| Session-state watcher | 2s | Cheap SQLite read against Cursor's session store |
| Claude Code | fsnotify | Event-driven, debounced 500ms |
| VS Code Copilot | fsnotify | Event-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 onemetadata()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.logfile 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 30dto keep the local store small - –Use
pcr start --plainif 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
.gitignoresogit statusstops 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.