{"version":"2.1.242","anchor":"git-aware-directory-sync-for-cloud-sessions-off-unless-an-en","canonical_anchor":"git-aware-directory-sync-for-cloud-sessions-off-unless-an-en","heading":"Git-aware directory sync for cloud sessions, off unless an env var is set","tier":"soon","area":"Cloud Sessions","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242\/e\/git-aware-directory-sync-for-cloud-sessions-off-unless-an-en","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.242","markdown":"### Git-aware directory sync for cloud sessions, off unless an env var is set\n\nA git sync engine keeps a cloud container's checkout in step with yours, off unless an env var is set.\n\n**What**\n\nThe 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.\n\n**Details**\n\n- Merging uses `git merge-tree --write-tree`; staging is mirrored across as well as commits.\n- 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.\n- The factory returns null immediately when the env var is absent.\n- Scale of the change: telemetry names beginning `dir_sync_git` go from 1 occurrence in v2.1.241 to 79 here, roughly 4,000 lines of new code.\n\n**Evidence**\n\n`Directory sync: this checkout was RECREATED from the session's starting state (the cloud container was replaced).`\n\n- Area: Cloud Sessions\n- Names: `CLAUDE_CODE_DIR_SYNC_GIT`, `--write-tree`\n- Tier: Nothing to try yet\n- Useful: 3\/5\n- Signal: 5\/5\n- Present in the build but not switched on"}