A git sync engine keeps a cloud container's checkout in step with yours, off unless an env var is set.
Snapshotting, bundle merging and commit replay with conflict parking are all built, gated on CLAUDE_CODE_DIR_SYNC_GIT.
What's wrong with this entry?
The cloud worker gains a large git sync engine that keeps the container's checkout in step with yours: it snapshots the working tree, merges your bundle, replays the agent's unpublished commits onto your HEAD, and parks them under session refs when the replay conflicts. None of it runs unless CLAUDE_CODE_DIR_SYNC_GIT is set, and even then it checks that directory sync itself is enabled before arming.
- Merging uses
git merge-tree --write-tree; staging is mirrored across as well as commits. - It writes long explanatory notices to the agent for branch name collisions, oversized files, nested repositories inside the checkout, and containers that were recreated from the session's starting state.
- The factory returns null immediately when the env var is absent.
- Scale of the change: telemetry names beginning
dir_sync_gitgo from 1 occurrence in v2.1.241 to 79 here, roughly 4,000 lines of new code.
Directory sync: this checkout was RECREATED from the session's starting state (the cloud container was replaced).
Strings lifted out of the shipped bundle, so the claim above can be checked against them.