{"version":"2.1.248","anchor":"background-sessions-adopt-an-existing-worktree-at-startup","canonical_anchor":"background-sessions-adopt-an-existing-worktree-at-startup","heading":"Background sessions adopt an existing worktree at startup","tier":"internal","area":"Worktrees","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248\/e\/background-sessions-adopt-an-existing-worktree-at-startup","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.248","markdown":"### Background sessions adopt an existing worktree at startup\n\nA background session starting in its recorded worktree now adopts and locks it.\n\n**What**\n\nA background session whose recorded worktree path is the directory it starts in now adopts that worktree instead of ignoring it: it checks the git root, takes a worktree lock, retries once after 250 ms, and records the state. If any of that fails it logs a warning and carries on rather than aborting startup.\n\n**Details**\n\n- Only runs when the session has a worktree path and the worktree was not created by a hook, plus several repository checks.\n\n**Evidence**\n\n`[worktree] bg boot: adopted ${e} but no worktree lock names this process`\n\n- Area: Worktrees\n- Tier: Under the hood\n- Useful: 2\/5\n- Signal: 2\/5"}