Deterministic triggers for PyCharm 2024.x Local History snapshots
Based on JetBrains’ documented behavior and observable logs, the IDE creates a Local History snapshot only when certain internal events occur. It does not rely on OS‑level file‑change notifications (inotify, FSEvents, etc.) for snapshot creation.
Confirmed deterministic triggers
- Explicit save actions – Ctrl+S (Save), Ctrl+Alt+S (Save All), or the automatic save that occurs when the IDE is idle for the configured auto‑save interval.
- Version‑control operations – committing, updating, merging, or any VCS‑initiated file write that PyCharm treats as a safe point.
- Execution of external tools, scripts, or file watchers defined in
Settings → Tools → External Tools.
- Debugging or test session start/finish – launching a debugger, running unit tests, or finishing a test run.
- Closing an editor tab – the IDE treats tab closure as a point where the current file state is persisted.
How auto‑save fits in
The auto‑save feature is a timer‑based save, not an independent periodic snapshot. When the idle timeout elapses, PyCharm issues a normal save command, which then triggers a snapshot via the first item above. Therefore, snapshot frequency follows the auto‑save interval but is still save‑driven.
Verification steps for this case
- Open
Help → Diagnostic Tools → Show Log in Explorer and locate the idea.log file.
- Search for entries containing
LocalHistory and note the timestamps.
- Perform a manual save (Ctrl+S) and verify a new
.xml file appears in <project>/.local_history with a matching timestamp.
- Disable auto‑save (
Settings → Appearance & Behavior → System Settings → Synchronization uncheck “Save files automatically if application is idle for … seconds”) and repeat step 2; you should see snapshots only after manual saves or the other triggers listed.
- If you need to confirm whether OS notifications are involved, enable the debug flag
-Didea.local.history.debug=true via Help → Edit Custom VM Options, restart, and watch the log for messages like “FS event ignored” – absence of such messages confirms the IDE does not act on inotify/FSEvents.
Missing diagnostic detail
To tailor the verification, let me know whether you have the default auto‑save interval (typically 5 seconds) changed; this affects how often timer‑based saves occur and thus snapshot frequency.