StateSense

Git Integration

How StateSense works alongside git.

StateSense uses VS Code's built-in git extension to detect commits and branch switches, then uses these events to automatically clean up snapshots that are no longer needed.

Auto-clear after commit

When you make a git commit, StateSense clears all snapshots including any pinned one. The reasoning: your commit is now your checkpoint — snapshots before it are redundant because git already preserves that state.

Auto-clear after branch switch

When you switch git branches, StateSense clears all snapshots including any pinned one. Snapshots from branch A have no meaning on branch B — preserving them would pollute your snapshot history with irrelevant state.

Always-on cleanup

Git-aware cleanup is always active and not configurable. Pins only survive the manual Clear Snapshots command — not git events. Commit your code before switching branches if you need a permanent record.

No impact on git

StateSense never writes to your git repository. Snapshots are stored in VS Code's global storage folder, completely separate from your repo. Nothing is added to your working tree, .gitignore, or commit history.

Working without git

StateSense is designed to be used alongside git. Without a git repository, the core snapshot and restore cycle technically still works — but the extension is severely limited:

  • No auto-cleanup ever fires. Snapshots accumulate until you manually clear them or the free-tier cap (7) is reached. On the free tier this happens very quickly — auto-cleanup is the main mechanism that keeps the cap from feeling restrictive.
  • Some restore behaviour depends on git. When restoring, files created after the target snapshot are reverted to their git HEAD state rather than deleted. Without git, that fallback path is unavailable and edge-case file states may not resolve cleanly.
  • No contextual cleanup. Snapshots are never automatically scoped to a task, branch, or commit — your history has no natural reset points and will grow stale.

If you are not using git, you will need to clear snapshots manually and will get noticeably less value from the extension. For the intended experience, StateSense assumes your project is a git repository.