{"version":"2.1.210","anchor":"claude-code-sync-session-refs-environment-variable","canonical_anchor":"claude-code-sync-session-refs-environment-variable","heading":"CLAUDE_CODE_SYNC_SESSION_REFS Environment Variable","tier":null,"area":null,"scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.210\/e\/claude-code-sync-session-refs-environment-variable","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.210","markdown":"### `CLAUDE_CODE_SYNC_SESSION_REFS` Environment Variable\n\n**What**\n\nA new environment variable `CLAUDE_CODE_SYNC_SESSION_REFS` enables session-reference syncing when set alongside a `CLAUDE_CODE_SESSION_ID` that passes validation.\n\n**Details**\n\n- Session-reference syncing is activated only when `CLAUDE_CODE_SYNC_SESSION_REFS` is truthy AND `CLAUDE_CODE_SESSION_ID` passes the format validator (`Kae(e) !== e` \u2014 the session ID must produce a different canonical form when normalized).\n- When active, both skills sync and plugin sync bypass the regular account-based sync APIs (`oto()` \/ `nto()`) and instead fetch a pre-assigned manifest from `GET \/worker\/skill-manifest` on the `ccr-session` host. That host resolves to the CCR Remote session URL supplied via `--sdk-url`; if no `--sdk-url` is provided the request throws `\"ccr-session host requires --sdk-url\"`.\n- The manifest response is a JSON object `{ skills: [...], plugins: [...] }` where each entry carries `{id, name, description, version, directory}`. Only entries with a non-empty `id` are used.\n- A single manifest fetch is shared across both skills and plugins via a lazy singleton (`YKb()`), so only one HTTP round-trip is made per sync cycle; the request carries a 30-second timeout.\n- If the manifest fetch fails (no auth, HTTP \u2265 300, 503 unavailable, or malformed body), sync silently returns `{success: false}` and emits `tengu_skills_sync_manifest_failed` or `tengu_plugins_sync_manifest_failed` telemetry rather than raising an error.\n- The `jot()` helper \u2014 which gates whether skill invocation waits for skill materialization \u2014 returns `true` when either `CLAUDE_CODE_SYNC_SKILLS` is set OR session-refs mode is active, so skill-wait logic applies to session-ref sessions as well.\n- `CLAUDE_CODE_SYNC_SESSION_REFS` is also forwarded to spawned worker processes by the CCR preload layer alongside `CLAUDE_CODE_SESSION_ID`, so child sessions inherit the same sync path.\n\n**Evidence**\n\nNew constant check (search for `\"CLAUDE_CODE_SYNC_SESSION_REFS\"`); manifest fetch (search for `\"\/worker\/skill-manifest\"`); sync branch (search for `\"sync_session_refs_skills\"`)"}