diff --git a/.changeset/agent-manager-sidebar-density.md b/.changeset/agent-manager-sidebar-density.md
new file mode 100644
index 00000000000..08eb1cf9c18
--- /dev/null
+++ b/.changeset/agent-manager-sidebar-density.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Fix the Agent Manager sidebar keyboard shortcut badge so it appears on the right edge of local rows and only while hovered or holding the jump modifier, give worktree titles more room by no longer reserving space for hidden row actions, align project names and section headings with the row icons below them, and show which worktree a session belongs to in the search palette.
diff --git a/.changeset/agent-manager-terminal-focus.md b/.changeset/agent-manager-terminal-focus.md
new file mode 100644
index 00000000000..d88b418a295
--- /dev/null
+++ b/.changeset/agent-manager-terminal-focus.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": minor
+---
+
+Improve Agent Manager terminal focus and keyboard navigation. `Cmd+/` now focuses a visible embedded terminal before hiding it, `Cmd+Shift+T` creates a side terminal only while that terminal area has focus, and `Cmd+Shift+[` / `]` switch terminal tabs. `Cmd+Shift+M` focuses the Agent Manager prompt instead of opening VS Code Problems. `Cmd+W` hides the last side terminal instead of stopping its shell.
diff --git a/.changeset/align-agent-manager-project-actions.md b/.changeset/align-agent-manager-project-actions.md
new file mode 100644
index 00000000000..b2d36e56cea
--- /dev/null
+++ b/.changeset/align-agent-manager-project-actions.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Align multi-project Agent Manager header actions with the worktree controls.
diff --git a/.changeset/bright-model-search.md b/.changeset/bright-model-search.md
new file mode 100644
index 00000000000..6bdf91a54df
--- /dev/null
+++ b/.changeset/bright-model-search.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": minor
+---
+
+Improve model search relevance with provider-aware results and personalized usage suggestions.
diff --git a/.changeset/bright-project-picker.md b/.changeset/bright-project-picker.md
new file mode 100644
index 00000000000..18458aaa856
--- /dev/null
+++ b/.changeset/bright-project-picker.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": minor
+---
+
+Let Agent Manager users choose the repository when creating or importing a worktree in multi-project mode.
diff --git a/.changeset/cache-worktree-dialog-selections.md b/.changeset/cache-worktree-dialog-selections.md
new file mode 100644
index 00000000000..f13128f7b9c
--- /dev/null
+++ b/.changeset/cache-worktree-dialog-selections.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Remember Agent Manager worktree dialog model, variant, mode, and sandbox selections when reopened.
diff --git a/.changeset/calm-agent-manager-git-polling.md b/.changeset/calm-agent-manager-git-polling.md
new file mode 100644
index 00000000000..5f3314267ab
--- /dev/null
+++ b/.changeset/calm-agent-manager-git-polling.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Reduce Agent Manager background Git polling load across large worktree sets.
diff --git a/.changeset/calm-skill-examples.md b/.changeset/calm-skill-examples.md
new file mode 100644
index 00000000000..a1ac64ae30e
--- /dev/null
+++ b/.changeset/calm-skill-examples.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Prevent built-in skill documentation examples from triggering shell permission prompts.
diff --git a/.changeset/command-model-selector-sync.md b/.changeset/command-model-selector-sync.md
new file mode 100644
index 00000000000..cd64ab6f90e
--- /dev/null
+++ b/.changeset/command-model-selector-sync.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Update the active model, mode, and thinking selectors when executing a slash command with configured overrides.
diff --git a/.changeset/commands-settings-jetbrains.md b/.changeset/commands-settings-jetbrains.md
new file mode 100644
index 00000000000..0c451ea9f32
--- /dev/null
+++ b/.changeset/commands-settings-jetbrains.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": minor
+---
+
+Add kilocode command-file endpoints so clients can list editable command/workflow files, inspect model and reasoning variant metadata, and remove them.
diff --git a/.changeset/compressed-speech-to-text-audio.md b/.changeset/compressed-speech-to-text-audio.md
new file mode 100644
index 00000000000..fee2a9166d1
--- /dev/null
+++ b/.changeset/compressed-speech-to-text-audio.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Compress speech-to-text audio input to AAC format across macOS, Linux, and Windows to prevent payload size errors on long recordings.
diff --git a/.changeset/faster-agent-manager-worktrees.md b/.changeset/faster-agent-manager-worktrees.md
new file mode 100644
index 00000000000..259a5413f73
--- /dev/null
+++ b/.changeset/faster-agent-manager-worktrees.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Start Agent Manager worktree sessions faster by prefetching base branches, reducing workspace file-watcher load, and overlapping independent multi-session setup.
diff --git a/.changeset/fix-agent-manager-terminal-toggle.md b/.changeset/fix-agent-manager-terminal-toggle.md
new file mode 100644
index 00000000000..a93825d5957
--- /dev/null
+++ b/.changeset/fix-agent-manager-terminal-toggle.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Fix the Agent Manager terminal toolbar button to toggle panel visibility directly.
diff --git a/.changeset/fix-gh-windows-console.md b/.changeset/fix-gh-windows-console.md
new file mode 100644
index 00000000000..f9fc3a1e5cc
--- /dev/null
+++ b/.changeset/fix-gh-windows-console.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Prevent extension-managed GitHub CLI commands from opening transient Windows Terminal windows.
diff --git a/.changeset/fix-interactive-terminal-input.md b/.changeset/fix-interactive-terminal-input.md
new file mode 100644
index 00000000000..b9d53915489
--- /dev/null
+++ b/.changeset/fix-interactive-terminal-input.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Restore keyboard input for interactive terminal prompts when the CLI session uses a workspace.
diff --git a/.changeset/fix-multi-project-agent-manager-tool.md b/.changeset/fix-multi-project-agent-manager-tool.md
new file mode 100644
index 00000000000..bb4e6304f63
--- /dev/null
+++ b/.changeset/fix-multi-project-agent-manager-tool.md
@@ -0,0 +1,6 @@
+---
+"kilo-code": patch
+"@kilocode/cli": patch
+---
+
+Route Agent Manager tool-launched sessions to the project that owns the tool event directory, keep sandboxed worktree sessions inside their active worktree, and wait for busy managed sessions before prompting them.
diff --git a/.changeset/fix-multi-project-session-scope.md b/.changeset/fix-multi-project-session-scope.md
index d56c4c93018..0f32e3327ac 100644
--- a/.changeset/fix-multi-project-session-scope.md
+++ b/.changeset/fix-multi-project-session-scope.md
@@ -2,4 +2,4 @@
"kilo-code": patch
---
-Scope Agent Manager session events and Git status to the active project, including edits inside nested repositories.
+Speed up local VS Code snapshot installs and scope Agent Manager session events and Git status to the active project, including edits inside nested repositories.
diff --git a/.changeset/fix-secondary-sidebar-nav-bar.md b/.changeset/fix-secondary-sidebar-nav-bar.md
new file mode 100644
index 00000000000..7905945a1ee
--- /dev/null
+++ b/.changeset/fix-secondary-sidebar-nav-bar.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Fix the sidebar navigation bar (New Task, History, Agent Manager, KiloClaw, Marketplace, Profile, Settings) disappearing in Cursor when the Kilo Code view is docked in the Secondary Side Bar. Cursor now renders the navigation inside the webview itself so it stays visible regardless of dock location. VS Code is unaffected — it continues to use its native title bar toolbar, which already worked correctly everywhere.
diff --git a/.changeset/fix-session-scroll-flicker.md b/.changeset/fix-session-scroll-flicker.md
new file mode 100644
index 00000000000..7fe8232c1e5
--- /dev/null
+++ b/.changeset/fix-session-scroll-flicker.md
@@ -0,0 +1,6 @@
+---
+"@kilocode/kilo-ui": patch
+"kilo-code": patch
+---
+
+Fix flickering and sticky scrolling when scrolling up in Agent Manager and chat sessions.
diff --git a/.changeset/fix-tool-approval-source-display.md b/.changeset/fix-tool-approval-source-display.md
new file mode 100644
index 00000000000..3308ed0827d
--- /dev/null
+++ b/.changeset/fix-tool-approval-source-display.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": minor
+---
+
+Move the "why was this tool call approved" line to after the tool output instead of between the header and body, add an icon to it, and add a Display setting to hide it.
diff --git a/.changeset/forked-subagent-resume.md b/.changeset/forked-subagent-resume.md
new file mode 100644
index 00000000000..2a4f8cd4837
--- /dev/null
+++ b/.changeset/forked-subagent-resume.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Allow subagent tasks to be resumed after their parent session is forked.
diff --git a/.changeset/friendly-llamas-manage.md b/.changeset/friendly-llamas-manage.md
new file mode 100644
index 00000000000..494e5cc0658
--- /dev/null
+++ b/.changeset/friendly-llamas-manage.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Support the Agent Manager tool with llama.cpp servers that reject prefix-only JSON Schema patterns.
diff --git a/.changeset/green-greps-settle.md b/.changeset/green-greps-settle.md
new file mode 100644
index 00000000000..9f7cacabf79
--- /dev/null
+++ b/.changeset/green-greps-settle.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Add bounded, context-aware grep controls without leaving agents waiting on completed searches.
diff --git a/.changeset/jetbrains-revert-diff-card.md b/.changeset/jetbrains-revert-diff-card.md
new file mode 100644
index 00000000000..fe8f75e3d3b
--- /dev/null
+++ b/.changeset/jetbrains-revert-diff-card.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/kilo-jetbrains": patch
+---
+
+Improve JetBrains session transcript layout, icons, reverted-change summaries, and multi-hunk diff rendering.
diff --git a/.changeset/jetbrains-slash-completion.md b/.changeset/jetbrains-slash-completion.md
new file mode 100644
index 00000000000..e2ec3c49969
--- /dev/null
+++ b/.changeset/jetbrains-slash-completion.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/kilo-jetbrains": patch
+---
+
+Improve slash command completion to match separators, camel-case humps, and contained command names.
diff --git a/.changeset/narrow-agent-manager-terminal.md b/.changeset/narrow-agent-manager-terminal.md
new file mode 100644
index 00000000000..5091714bdb5
--- /dev/null
+++ b/.changeset/narrow-agent-manager-terminal.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Keep Agent Manager terminals aligned and correctly wrapped when the terminal panel is narrow.
diff --git a/.changeset/narrow-sidebar-recent.md b/.changeset/narrow-sidebar-recent.md
new file mode 100644
index 00000000000..fcd56b0f73f
--- /dev/null
+++ b/.changeset/narrow-sidebar-recent.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Keep recent sessions and the Show History action inset and usable in narrow VS Code sidebars.
diff --git a/.changeset/optimize-review-slash-commands.md b/.changeset/optimize-review-slash-commands.md
new file mode 100644
index 00000000000..8e104765c23
--- /dev/null
+++ b/.changeset/optimize-review-slash-commands.md
@@ -0,0 +1,6 @@
+---
+"kilo-code": minor
+"@kilocode/cli": minor
+---
+
+Add nested slash command suggestions for `/review` in VS Code and support `staged`, `unpushed`, and `quick` review modes.
diff --git a/.changeset/preserve-model-variants.md b/.changeset/preserve-model-variants.md
new file mode 100644
index 00000000000..10941827bb8
--- /dev/null
+++ b/.changeset/preserve-model-variants.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Preserve the selected reasoning effort when switching to a model that supports the same or nearest available variant.
diff --git a/.changeset/quick-git-launches.md b/.changeset/quick-git-launches.md
new file mode 100644
index 00000000000..6c29101ce1f
--- /dev/null
+++ b/.changeset/quick-git-launches.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Reduce Agent Manager Git polling overhead by reusing the validated Git executable and bypassing the macOS developer-tool launcher when safe.
diff --git a/.changeset/quiet-embedded-logo.md b/.changeset/quiet-embedded-logo.md
new file mode 100644
index 00000000000..7623cf0e739
--- /dev/null
+++ b/.changeset/quiet-embedded-logo.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Use a compatible Kilo wordmark in embedded Agent Manager terminals.
diff --git a/.changeset/quiet-tui-config-reloads.md b/.changeset/quiet-tui-config-reloads.md
new file mode 100644
index 00000000000..8c21c818bb9
--- /dev/null
+++ b/.changeset/quiet-tui-config-reloads.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Prevent TUI config reload logs from corrupting the interactive terminal.
diff --git a/.changeset/quiet-tui-disposal-aborts.md b/.changeset/quiet-tui-disposal-aborts.md
new file mode 100644
index 00000000000..7431897d318
--- /dev/null
+++ b/.changeset/quiet-tui-disposal-aborts.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Avoid printing an error when closing the TUI cancels in-flight startup refreshes.
diff --git a/.changeset/remove-web-command.md b/.changeset/remove-web-command.md
new file mode 100644
index 00000000000..8dd97b02feb
--- /dev/null
+++ b/.changeset/remove-web-command.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Remove unsupported `kilo web` CLI command.
diff --git a/.changeset/safe-credential-reconciliation.md b/.changeset/safe-credential-reconciliation.md
new file mode 100644
index 00000000000..abb8dd5f36a
--- /dev/null
+++ b/.changeset/safe-credential-reconciliation.md
@@ -0,0 +1,5 @@
+---
+"@kilocode/cli": patch
+---
+
+Prevent concurrent Kilo startups from rewriting unchanged credentials, retry transient database locks, and redact bound values from database errors.
diff --git a/.changeset/sandbox-live-settings.md b/.changeset/sandbox-live-settings.md
new file mode 100644
index 00000000000..f356683b997
--- /dev/null
+++ b/.changeset/sandbox-live-settings.md
@@ -0,0 +1,6 @@
+---
+"kilo-code": patch
+"@kilocode/cli": patch
+---
+
+Apply saved sandbox settings to existing sessions and use the latest settings when enabling sandboxing
diff --git a/.changeset/surface-backend-exit-diagnostics.md b/.changeset/surface-backend-exit-diagnostics.md
new file mode 100644
index 00000000000..146a00c7424
--- /dev/null
+++ b/.changeset/surface-backend-exit-diagnostics.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Surface process exit signals and structured spawn failure details in server startup diagnostics
diff --git a/.changeset/sync-inspector-width.md b/.changeset/sync-inspector-width.md
index 02eeb4e7239..9372f7ace4b 100644
--- a/.changeset/sync-inspector-width.md
+++ b/.changeset/sync-inspector-width.md
@@ -2,4 +2,4 @@
"kilo-code": patch
---
-Persist the Agent Manager inspector width and share it between the terminal and diff viewer.
+Persist the Agent Manager inspector width, share it between the terminal and diff viewer, and keep resizing responsive.
diff --git a/.changeset/terminal-shortcut-translations.md b/.changeset/terminal-shortcut-translations.md
new file mode 100644
index 00000000000..c0b45c5c4cc
--- /dev/null
+++ b/.changeset/terminal-shortcut-translations.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Translate the Agent Manager terminal focus shortcut label in all supported locales.
diff --git a/.changeset/vscode-skills-tooltip-wrap.md b/.changeset/vscode-skills-tooltip-wrap.md
new file mode 100644
index 00000000000..a4a5ecec038
--- /dev/null
+++ b/.changeset/vscode-skills-tooltip-wrap.md
@@ -0,0 +1,5 @@
+---
+"kilo-code": patch
+---
+
+Long skill folder paths and URLs shown in the tooltip on the Skills settings page now wrap inside the viewport instead of overflowing on a single line.
diff --git a/.github/workflows/check-opencode-annotations.yml b/.github/workflows/check-opencode-annotations.yml
index f494bbb4c8e..51d40efb260 100644
--- a/.github/workflows/check-opencode-annotations.yml
+++ b/.github/workflows/check-opencode-annotations.yml
@@ -41,6 +41,9 @@ jobs:
- name: Check Effect Promise facade allowlist
run: bun run script/check-opencode-promise-facades.ts
+ - name: Check domain architecture boundaries and ratchets
+ run: bun run script/check-architecture.ts
+
- name: Check model tool network boundary
run: bun run script/check-model-tool-network.ts
diff --git a/.kilo/plans/agent-manager-multi-project-implementation-handoff.md b/.kilo/plans/agent-manager-multi-project-implementation-handoff.md
deleted file mode 100644
index 510a5e1c380..00000000000
--- a/.kilo/plans/agent-manager-multi-project-implementation-handoff.md
+++ /dev/null
@@ -1,459 +0,0 @@
-# Agent Manager multi-project implementation handoff
-
-**Status:** Implementation-ready handoff from the current branch
-
-**Date:** 2026-07-22
-
-This document tells the next implementation model exactly how to continue from branch `abalone-bactrosaurus` at commit `8f48da2278` plus the uncommitted plan files. It is the execution checklist. Detailed decisions live in:
-
-- [`agent-manager-multi-project-configuration.md`](./agent-manager-multi-project-configuration.md) for configuration ownership, bindings, revisions, indexing consent, and settings tests;
-- [`agent-manager-multi-project-uniform-ui.md`](./agent-manager-multi-project-uniform-ui.md) for runtime, routing, lifecycle, uniform sidebar UI, and acceptance criteria.
-
-If this handoff conflicts with either architecture document, stop and resolve the contradiction before coding.
-
-## Goal
-
-Finish the current prototype into a safe, complete multi-project Agent Manager behind a default-off VS Code experimental flag.
-
-The feature is done only when:
-
-- multiple expanded projects show the same full Agent Manager sidebar behavior;
-- every action uses explicit project/worktree/session ownership;
-- Settings cannot write the wrong project's config;
-- indexing requires machine-local consent per canonical project;
-- project identity is canonical, Git-root-aware, common-dir-safe, and remote-authority-aware;
-- single-project behavior remains unchanged when the flag is off.
-
-## Current branch baseline
-
-### Implemented and worth keeping
-
-- persistent additional-project registry with serialized/re-read mutations;
-- separate `ProjectContext` objects and per-project Agent Manager state files;
-- project-stamped state, stats, PR, and session payloads;
-- canonical worktree presence comparison for symlink/`/tmp` aliases;
-- per-project session listing from project root and worktree directories;
-- partial production `ProjectRouteService` integration and raw-session ambiguity rejection;
-- project-qualified sidebar DOM IDs and cross-project previous/next navigation;
-- atomic selection validation and same-project activation fast path;
-- flag-off return to pinned project;
-- Experimental Settings toggle and translations;
-- focused unit tests for registry, contexts, paths, pollers, routing, sessions, selection, and navigation.
-
-### Not implemented or incomplete
-
-- immutable/revisioned Settings bindings;
-- machine-local indexing consent;
-- canonical pinned Git toplevel, `commonGitDir`, URI scheme/authority identity;
-- strict project envelopes for all Agent Manager operations;
-- complete route-service use for every session/terminal/diff/share/permission operation;
-- one full sidebar body shared by single- and multi-project modes;
-- uniform per-context poller and stale-state ownership;
-- all repository mutations through `ProjectContext.run()`;
-- complete real two-project E2E verification.
-
-### Known diff cleanup
-
-- remove unrelated `packages/opencode/package.json` ordering/dependency drift;
-- restore unrelated `bun.lock` ordering/version drift unless required by a retained change;
-- remove `experimental.multi_project` from the CLI config schema and generated SDK once the VS Code flag is the sole source of truth;
-- rewrite the changeset after final behavior is complete.
-
-Do not reset or discard unrelated user changes. Inspect every cleanup diff before applying it.
-
-## Non-negotiable invariants
-
-1. Agent Manager activation is not a Settings write target.
-2. No identified operation falls back to the active project or workspace root in multi-project mode.
-3. A project config write targets the explicitly selected registered project root, never an active worktree.
-4. Runtime config remains directory-correct: project Local uses root, worktree sessions use exact worktree directory.
-5. Repository config cannot grant indexing consent.
-6. New projects default to indexing disabled on this machine.
-7. Provider/API credentials and indexing infrastructure never enter project config through Settings.
-8. Raw session/worktree IDs are never sufficient UI/runtime identity when multiple projects are exposed.
-9. The full existing sidebar behavior is reused; do not maintain a simplified multi-project copy.
-10. Do not raise `AgentManagerProvider.ts` or `AgentManagerApp.tsx` line caps.
-
-## Work order
-
-Complete slices in order. Do not start the next slice while the current slice's tests or checks fail.
-
-## Slice 0A: consolidate the feature flag
-
-### Required result
-
-Use one source of truth: VS Code application setting `kilo-code.new.experimental.multiProject`.
-
-### Required changes
-
-1. Remove `experimental.multi_project` from:
- - `packages/core/src/v1/config/config.ts`;
- - `packages/sdk/js/src/v2/gen/types.gen.ts` by regenerating the SDK after schema removal;
- - `packages/kilo-vscode/webview-ui/src/types/messages/config.ts`.
-2. Do not hand-edit generated SDK files. Run `./script/generate.ts` from repository root after endpoint/schema changes.
-3. Change `ExperimentalTab.tsx` so the toggle reads the VS Code setting delivered in `configLoaded.settings`, not `config().experimental`.
-4. Add `multiProject` to the extension settings payload sent by `KiloProvider.fetchAndSendConfig()`.
-5. Toggling it sends only `updateSetting("experimental.multiProject", checked)`.
-6. Keep `VscodeHost.multiProject()` and its change listener reading the same VS Code setting.
-
-### Tests
-
-- toggle initial state reflects VS Code setting when CLI config disagrees;
-- toggling updates the VS Code setting and Agent Manager reacts;
-- no CLI/project config file gains `experimental.multi_project`.
-
-### Stop gate
-
-Run from `packages/kilo-vscode/`:
-
-```sh
-bun run format
-bun run format:check
-bun run typecheck
-bun run lint
-bun run test:unit
-```
-
-Do not continue if any command fails.
-
-## Slice 0B: machine-local indexing consent
-
-### Required result
-
-Indexing enablement is explicit machine-local consent keyed by canonical `ProjectId`, default false. Project config controls indexing rules but cannot enable indexing.
-
-### Required changes
-
-1. Add a versioned machine-local consent store in the extension, not repository config and not synced across machines.
-2. Use canonical project identity as the key. The pinned project and registered projects use the same identity resolver.
-3. Remove hidden routing of `indexing.enabled` to project config from `webview-ui/src/utils/config-scope.ts`.
-4. Remove project/global inheritance logic for `indexing.enabled` from `indexing-tab-state.ts`.
-5. The Indexing UI requires an explicit project selector for enablement and reads/writes consent through dedicated messages.
-6. Keep these in User config only:
- - provider;
- - model and dimension;
- - credentials/API keys/base URLs;
- - vector-store type and connection/storage settings;
- - machine/infrastructure tuning defaults.
-7. Keep these available in explicit Project scope:
- - file extensions;
- - repository include/ignore rules;
- - deliberate repository chunking/tuning overrides.
-8. Indexing startup/status must require both valid User indexing configuration and consent for the routed project.
-9. A repository containing `indexing.enabled: true` must not enable indexing.
-
-### Suggested files
-
-- new VS Code-free consent store under `src/indexing/` or `src/agent-manager/`;
-- `src/KiloProvider.ts` only as a thin protocol adapter;
-- `webview-ui/src/components/settings/IndexingTab.tsx`;
-- `webview-ui/src/components/settings/indexing-tab-state.ts`;
-- `webview-ui/src/context/config.tsx` only if necessary;
-- focused tests beside existing indexing tests.
-
-### Tests
-
-- unknown project defaults off;
-- A enabled does not enable B;
-- symlink/path alias resolves to the same consent;
-- repository config cannot grant consent;
-- removing/re-adding behavior follows the documented store policy;
-- no credentials/storage settings are emitted in a Project-scope patch.
-
-## Slice 0C: revisioned config overlay backend
-
-### Required result
-
-Config reads return authoritative target descriptors and revisions. Writes use compare-and-swap and cannot overwrite external changes or a changed target.
-
-### Required changes
-
-1. Extend Kilo-owned config overlay code:
- - `packages/opencode/src/kilocode/config/overlay.ts`;
- - a new Kilo-owned writer under `packages/opencode/src/kilocode/config/`;
- - `packages/opencode/src/kilocode/server/httpapi/groups/config-console.ts`;
- - `packages/opencode/src/kilocode/server/httpapi/handlers/config-console.ts`.
-2. Read response includes for global and project targets:
- - canonical path;
- - scope;
- - exists/writable;
- - SHA-256 revision of canonical path, existence marker, and exact bytes;
- - raw parsed target layer;
- - effective config and source metadata.
-3. Write request accepts exactly one scope, `set`, `unset`, and expected path/revision.
-4. Server re-resolves the authoritative target. Never trust client path as a destination.
-5. Lock by canonical target path, re-read inside lock, compare revision, patch raw JSONC, validate, and atomically replace.
-6. Return a fresh authoritative snapshot.
-7. Return typed 409 conflicts for target/revision changes; preserve drafts client-side.
-8. Keep Kilo logic in `packages/opencode/src/kilocode/`. Shared upstream files get minimal marked delegation only when unavoidable.
-9. Regenerate the SDK after endpoint changes.
-
-### Tests
-
-Add/extend:
-
-- `packages/opencode/test/kilocode/server/config-overlay.test.ts`;
-- `packages/opencode/test/kilocode/project-config-update.test.ts`.
-
-Cover:
-
-- exact raw target layer;
-- comment-only external edit conflict;
-- missing-file target revision;
-- newly created higher-priority target conflict;
-- concurrent writers: one success, one 409;
-- symlink escape rejection;
-- global and project writes remain separate;
-- atomic write failure never exposes partial content.
-
-### Stop gate
-
-From `packages/opencode/`:
-
-```sh
-bun run typecheck
-bun test test/kilocode/server/config-overlay.test.ts
-bun test test/kilocode/project-config-update.test.ts
-```
-
-From repository root:
-
-```sh
-./script/generate.ts
-bun run script/check-opencode-annotations.ts
-bun run script/check-opencode-promise-facades.ts
-```
-
-## Slice 0D: immutable Settings bindings
-
-### Required result
-
-Settings has explicit `User | Project` scope. Project scope requires an explicit trusted project selector. Drafts and saves never follow Agent Manager activation.
-
-### Required changes
-
-1. Split runtime-effective config from Settings editor config.
-2. Add a binding controller under `packages/kilo-vscode/src/kilo-provider/`; keep `KiloProvider.ts` as a thin adapter.
-3. Replace unqualified config protocol with:
- - read request carrying request ID, scope, and optional project ID;
- - snapshot carrying opaque binding ID and source/target metadata;
- - write request carrying request ID, binding ID, set, and unset.
-4. The extension stores authoritative bindings. The webview never supplies a writable path.
-5. Project binding resolution:
- - resolve registered `ProjectContext.root`;
- - require project existence, matching generation, and trust;
- - never use active worktree/session or `getWorkspaceDirectory()` after binding creation.
-6. Bindings expire on successful save, reconnect, project removal, generation change, or trust revocation.
-7. Separate drafts by scope/project binding.
-8. Dirty selector changes prompt Save, Discard, or Stay.
-9. Out-of-order reads/writes update only matching request/binding.
-10. External config events refresh clean drafts and mark dirty drafts stale without overwriting them.
-11. Remove `splitConfigByScope()` after all controls declare scope explicitly.
-12. Audit direct config mutators outside the save bar, including provider disconnect, imports/resets, custom providers, work styles, Permission Dock, MCP actions, and indexing.
-13. Open Project Config takes explicit `ProjectRef`, checks trust, and resolves the registered root.
-
-### UI scope policy
-
-Use the table in `agent-manager-multi-project-configuration.md`. Do not invent another policy.
-
-### Blocking tests
-
-- load A, activate B, save A: only A target changes;
-- same while selecting worktrees/sessions;
-- User save changes only user config;
-- Project save changes only selected trusted project's root config;
-- dirty draft cannot migrate to another project;
-- project removal/trust revocation expires binding;
-- external edit returns conflict and preserves draft;
-- no save-time active-directory lookup occurs.
-
-## Slice 1: canonical project identity
-
-### Required result
-
-Every project is a canonical Git repository root with URI authority and common Git directory identity.
-
-### Required changes
-
-1. Replace path-only project descriptors with:
-
-```ts
-{
- id,
- uri,
- scheme,
- authority,
- root,
- commonGitDir,
- label,
- order,
- trusted,
- addedAt
-}
-```
-
-2. Pinned and added projects use the same resolver:
- - validate URI host scope;
- - `git rev-parse --show-toplevel`;
- - `git rev-parse --path-format=absolute --git-common-dir`;
- - realpath/normalize both;
- - derive ID from scheme, authority, and canonical root.
-3. Opening VS Code in a repository subdirectory still uses the Git toplevel and root state file.
-4. Reject another exposed project sharing canonical `commonGitDir`.
-5. Key Git mutation locks by common Git directory.
-6. Preserve remote URI scheme/authority in picker, storage, and open-folder operations.
-7. Migrate or safely read the current registry version without dropping valid entries.
-
-### Tests
-
-- workspace subdirectory resolves to repository root;
-- symlink aliases dedupe;
-- linked worktree/common-dir duplicate rejected;
-- other remote authority hidden but preserved;
-- missing/non-Git entry remains removable and never falls back to pinned root.
-
-## Slice 2: strict routing and lifecycle
-
-### Required result
-
-Every repository-bound operation is explicitly project-qualified once multiple projects are exposed.
-
-### Required changes
-
-1. Introduce one project envelope at the Agent Manager boundary with project ID and generation.
-2. Compatibility adapter injects pinned identity only in single-project mode.
-3. Multi-project mode rejects missing/mismatched identity with typed errors.
-4. Wire `ProjectRouteService` into every existing-session operation:
- - transcript/messages;
- - prompt/abort;
- - share/unshare;
- - fork/continuation;
- - permission/question responses;
- - terminal;
- - file/context operations;
- - diff/apply/revert.
-5. Route global SSE events once by exact directory/session ownership.
-6. Preserve non-Agent-Manager KiloProvider behavior.
-7. Execute repository mutations through `ctx.run()` and generation-check commits.
-8. Removal waits for mutation queue, stops pollers/watchers, flushes state, detaches routes, then removes registry entry.
-9. Flag-off activates pinned Local and suspends secondaries without aborting sessions.
-
-### Tests
-
-- same raw session ID across projects is ambiguous without qualifier;
-- B Local/share/unshare/permission never routes through A;
-- unknown IDs produce no terminal/file/diff operation;
-- project switch during mutation cannot change operation ownership;
-- late completion after removal cannot mutate replacement context.
-
-## Slice 3: uniform context-owned state and polling
-
-### Required result
-
-Every initialized expanded project owns the same live-state services. Active selection changes cadence/detail only, not ownership.
-
-### Required changes
-
-1. Move stats and PR pollers into `ProjectContext`; remove active singleton/background split.
-2. Each context owns stale/presence state, cached stats, local stats, PR state, run/setup state, and generation.
-3. Background presence updates project stale state rather than emitting empty arrays.
-4. All project outputs include project ID and generation; webview discards stale generations.
-5. Session-created/deleted/updated events refresh the owning project store without active-project filtering.
-6. Panel visibility and expansion uniformly control polling.
-
-### Tests
-
-- two expanded projects both receive stats/presence/PR updates;
-- collapse stops only that project's pollers;
-- stale late poll result is dropped;
-- background session deletion updates only its project.
-
-## Slice 4: one full sidebar body
-
-### Required result
-
-Single- and multi-project modes render the same full `ProjectSidebarBody` implementation.
-
-### Required changes
-
-1. Extract the current full `renderBody()` from `AgentManagerApp.tsx` intact.
-2. Parameterize it with one project store and project-qualified actions.
-3. Preserve:
- - busy state;
- - drag/drop and grouping;
- - section actions;
- - search and keyboard hints;
- - run/setup state;
- - New Worktree dialog;
- - worktree menus and PR actions;
- - complete managed/unassigned session behavior.
-4. Delete the simplified duplicate body path.
-5. Render project rows keyed by stable project ID and keep bodies mounted across active changes.
-6. New Worktree receives explicit target project, defaulting to Settings/detail selection policy as specified.
-
-### Tests
-
-- single-project behavior unchanged with flag off;
-- two expanded projects render two full bodies;
-- active selection changes no body mount identity;
-- drag/drop, sections, worktree actions, sessions, and keyboard navigation work across projects.
-
-## Slice 5: cleanup and release validation
-
-1. Remove unrelated manifest/lockfile drift.
-2. Update changeset to final user-visible behavior.
-3. Run all extension and affected CLI checks.
-4. Build/package the extension.
-5. Use the VS Code self-test fixture with two repositories and multiple worktrees/sessions.
-6. Keep feature default off until every blocking test passes.
-
-### Required extension checks
-
-From `packages/kilo-vscode/`:
-
-```sh
-bun run format
-bun run format:check
-bun run typecheck
-bun run lint
-bun run test:unit
-bun run knip
-bun run check-kilocode-change
-bun run compile
-```
-
-From repository root:
-
-```sh
-bun run script/check-opencode-annotations.ts
-bun run script/check-opencode-promise-facades.ts
-bun run script/check-md-table-padding.ts
-```
-
-### Manual scenarios
-
-1. Flag off: current single-project Agent Manager is unchanged.
-2. Enable flag in Experimental Settings; restart; value persists without CLI/project config changes.
-3. Add/trust/expand two repositories; restart; pinned remains first.
-4. Both projects show Local, worktrees, sessions, stats, PR state, and full actions.
-5. Navigate previous/next across projects.
-6. Create/delete/rename worktrees in both projects.
-7. Send prompts and answer permission/question requests in both projects.
-8. Share/unshare B while A is active; exact B directory is used.
-9. Load Project Settings A, activate B, save A; B is unchanged.
-10. Modify A config externally while draft is dirty; conflict preserves draft.
-11. Indexing defaults off for a new project; enabling A does not enable B; repo config cannot enable either.
-12. Disable flag while B is active; pinned Local becomes active and B remains registered/suspended.
-13. Repeat key routing and identity checks in a remote VS Code window.
-
-## Rules for the implementation model
-
-- Work on one slice at a time.
-- Read the referenced architecture section before editing.
-- Add focused tests before or with behavior changes.
-- Use `apply_patch` for manual edits.
-- Do not hand-edit generated SDK files.
-- Do not raise file-size caps.
-- Do not add fallback compatibility code unless the plan explicitly requires the single-project adapter.
-- Do not claim a slice complete until its stop gate passes.
-- If a required API or ownership decision is missing, stop and update this plan instead of guessing.
diff --git a/.kilo/plans/agent-manager-multi-project-shipping-gaps.md b/.kilo/plans/agent-manager-multi-project-shipping-gaps.md
deleted file mode 100644
index 8301929bbdf..00000000000
--- a/.kilo/plans/agent-manager-multi-project-shipping-gaps.md
+++ /dev/null
@@ -1,210 +0,0 @@
-# Agent Manager Multi-Project — Shipping Gaps
-
-Status as of 2026-07-27. The multi-project sidebar renders and works end to end in the
-self-test harness (both projects list worktrees/sessions/sections, section creation
-persists, worktree delete works, project switching restores selection, live session
-upsert verified). Full unit suite green (3444 pass / 0 fail), typecheck, lint, knip,
-arch caps all pass. Everything is uncommitted in the worktree.
-
-This document lists what is still missing, ranked by whether it should block shipping.
-
-Two audiences matter for the blocking decision:
-
-- **All users**: the branch changes shared surfaces (legacy sidebar refactor, config
- write path, indexing consent, pollers). Regressions here ship to everyone, flag off
- or not.
-- **Experimental users**: multi-project mode is gated behind
- `kilo-code.new.experimental.multiProject`, default off. Rough edges here are
- acceptable if they cannot corrupt data.
-
----
-
-## 1. Blocks shipping (all-user surfaces)
-
-### 1.0 Empty-state skeleton regression (fixed, must stay fixed)
-
-`initializeState` and `onRequestState` only called `refreshSessions()` when the
-managed state contained at least one session. With zero managed sessions the
-backend listing never ran, `sessionsLoaded` never reached the webview, and both
-the WORKTREES and SESSIONS sections stayed on skeletons forever (the worktree
-gate requires `worktreesLoaded() && sessionsLoaded()`). Any user whose state file
-lost its sessions — exactly what the earlier session-persist bugs caused — hit a
-permanently empty-looking sidebar. Reproduced in the harness on a worktree-root
-workspace and fixed by making both refreshes unconditional. Root-caused via
-stage-by-stage init logging on 2026-07-27; do not reintroduce a content-based
-guard here.
-
-### 1.1 Config write path can fail or wipe drafts for existing callers — P0-6 / P1-7
-
-The config binding rework requires every `updateConfig` sender to carry a binding id,
-and `configUpdateFailed` currently wipes the draft for the failed scope. Any existing
-sender without a binding (permission dock, model picker, auto-approve, onboarding)
-now fails or loses the user's unsaved edits.
-
-- Backend half is done: `expected` is optional in the overlay schema, writer, and
- handler, so a client without a binding writes unconditionally again instead of
- getting a 400. The webview half (draft retention on `configUpdateFailed`, and the
- audit of every `updateConfig` sender) is still open.
-- Work: the code change is small; the real work is auditing every webview
- `updateConfig` sender and classifying it.
-- Also: this change is orthogonal to multi-project. Split it into its own commit
- (`feat(vscode): config write revision bindings`) so it can be reverted alone.
-
-### 1.2 Indexing status read silently revokes consent — P0-3 / P0-4
-
-Partially addressed: untrusted projects are now filtered out of the consent list
-(P0-4), and config scope switching plus project-scoped `indexing.enabled` writes
-were restored after the rework had hardcoded the tab to global scope (the earlier
-P1-8 gap). The remaining blocker is the read path below.
-
-
-`fetchAndSendIndexingStatus` issues `PUT /indexing/consent` (a write) on a plain
-status refresh, defaulting to `enabled: false` for any project not in local
-`globalState`. On a fresh machine/profile, the first status read turns indexing off
-for users who had it on. A refresh can also target the wrong project
-(`requestIndexingStatus` resolves from the current session's directory). Separately,
-the Indexing tab lists untrusted projects and would let a user enable indexing for a
-repo the trust system has not approved.
-
-- Fix: read status with a GET; PUT only from the explicit setter; seed consent from
- the effective config on first read instead of defaulting false; require an explicit
- project on refresh; filter the project list to trusted projects.
-- Dependency: needs a read-only status endpoint. If none exists, this escapes into
- `packages/opencode` (shared upstream code, needs `kilocode_change` markers) or the
- cloud repo.
-- Also orthogonal to multi-project; split into its own commit
- (`feat(vscode): per-project indexing consent`).
-
-### 1.3 Land the current work as separate, revertable commits
-
-Everything currently sits uncommitted in one worktree. The review's recommendation
-stands: `git reset --soft origin/main` and stage by path into three commits —
-multi-project, config bindings, indexing consent. The multi-project commit message
-must not promise per-project config/indexing behavior that lands in the other two.
-
----
-
-## 2. Should fix soon after (experimental surface, data-integrity relevant)
-
-### 2.1 Same repo can register twice — P0-5
-
-`projectIdFor` hashes the canonical path verbatim while `samePath` folds case, so two
-casings of one repo produce two project ids, two contexts, and two state managers
-racing to write the same `.kilo/agent-manager.json` (last write wins, worktrees and
-sessions vanish).
-
-- Fix: fold case inside `projectIdFor` on darwin/win32; reject `addProject` when
- `samePath` matches any registered root.
-- Migration: existing registry keys were built from the old hash, so re-key them on
- load or dual-lookup on read. Note `canonicalizePath` already realpaths existing
- paths; the fallback branch must fold case too.
-- Why not blocking: requires an unusual casing mismatch at registration time, and the
- feature is flag-gated.
-
-### 2.2 Route service is shared across panels but versioned per context — P0-7
-
-Two VS Code windows each have their own `ProjectContexts` with independent generation
-counters feeding one shared `ProjectRouteService`. Panel B registering a project at
-generation 0 while panel A is at 2 unregisters panel A's routes; closing one panel
-drops routes the other still needs.
-
-- Fix: panel-qualified keys (`panelId + projectId + sessionId`), generations issued
- by the service, ambiguity computed across all panels.
-- Why not blocking: needs two windows running Agent Manager against the same repos.
- The fallback already refuses ambiguous raw ids instead of resolving them wrong.
-- Note: no two-panel test harness exists today; this fix should create one.
-
-### 2.3 `gh pr` noise in repos without remotes — Bug 5
-
-`gh pr view` fails every 15s per worktree forever, logs before the dedupe, and
-`pollOnce` rejections are unhandled.
-
-- Fix: log after the `lastHash` dedupe; `void this.pollOnce().catch(log)` in
- `schedule`; per-root remote probe with a single error emission; skip PR pollers for
- remote-less projects in `ProjectPollers.sync`.
-
----
-
-## 3. UX papercuts in experimental mode (fix opportunistically)
-
-- **Legacy tabs orphaned on upgrade** (P1-1): `createLocalTabs` migrates persisted
- `localSessionIDs` into a `single` bucket that `tabKey()` never reads once the
- catalog arrives. Migrate `single` to the pinned project id on first state apply.
-- **`restoreProjectTarget` skips tab bookkeeping** (P1-3): a restored session has no
- tab. Call `selectLocal()` first, add the tab, then select.
-- **`ensurePendingTab` runs before restore** (P1-4): switch adds a "New Session"
- draft that restore may contradict. Move it after restore.
-- **Per-keystroke state saves**: `setActiveTarget` writes
- `.kilo/agent-manager.json` on every selection change. Debounce or persist on
- deactivation/dispose only.
-- **Untranslated Indexing tab strings** (P1-9), **unused-ish composite id schemes**
- (P1-12), **stats messages tagged at emit time** (P1-14), **no presence sync for
- background projects** (P1-15), **registry read cache** (P1-16/17), **realpath
- syscall churn** (P1-18), **`resolveProjectRoot` process spawning** (P1-19).
-
----
-
-## 4. Structural debt (schedule, don't block)
-
-### 4.1 Two sidebar implementations — Arch 1.1
-
-Tracked as #12685 (section parity) and #12686 (sidebar drag-and-drop).
-
-`AgentManagerApp` keeps the legacy `renderBody` (now `SidebarBody.tsx`) and
-`ProjectSidebarBody.tsx` as a reduced reimplementation. The reimplementation already
-caused one full outage of multi-project mode (missing `DragDropProvider` crashed the
-webview render). Missing versus legacy: worktree ordering, drag-and-drop reorder and
-move-to-section, grouping, busy/navHint/shortcut badges, section auto-rename, stats
-skeletons.
-
-- Direction: single-project becomes the degenerate case of multi-project (one
- implicit pinned project, header row hidden), `SidebarBody.tsx` is deleted.
-- Do this last: it churns the same message-stamping code as 2.2, needs per-project
- DnD state, and must keep legacy pixel-identical for the default-off population.
- Use the visual-regression skill to cover both modes before merging it.
-
-### 4.2 Ambient project scope via AsyncLocalStorage — Arch 1.3
-
-`ProjectScope` plus the `this.state`/`this.context` getters make the target project
-invisible at call sites; any continuation escaping ALS silently falls back to the
-active project. `provider-lifecycle.ts` shows the intended end state (explicit deps).
-Keep threading `ctx` explicitly into the remaining handler groups; add a dev-mode log
-in the `context` getter when a project-stamped message resolves without a scope.
-
-### 4.3 Per-project webview store — Arch 1.2
-
-`worktrees()`, `managedSessions()`, `selection()` etc. are single-valued with
-`memKey()`/`tabKey()` and two "current project" accessors that disagree during the
-switch window. Long-term: one `createProjectStore(projectId)` per project. For now
-the gating added to the remember effect contains the known race.
-
----
-
-## 5. Verification gaps to close before the PR
-
-- **SSE session upsert** is unit-tested (`upsertSession`, `byDirectory`, fresh-skip
- re-post) but not E2E-verified: the harness backend's basic-auth credentials could
- not be re-extracted after a window reload, so external session creation was not
- exercised live. Verify manually: `kilo` a new session in a registered repo from a
- terminal and watch it appear in that project's sidebar.
-- **Tab isolation across projects** (per-project buckets) is unit-tested but not
- E2E-verified with real sessions open in two projects.
-- **Legacy mode parity**: legacy sidebar and tab bar were smoke-tested (render,
- select, section create + inline rename), but not the full matrix (delete, DnD
- reorder, move-to-section, review tab, terminals). The extraction moved ~700 lines
- of JSX; a visual-regression pass over `SidebarBody`/`TabBar` stories is the
- cheapest safety net.
-- **Harness instability**: the isolated VS Code window crashed repeatedly during this
- work. If it keeps failing on the next pass, say so in the PR rather than claiming
- coverage that does not exist.
-
----
-
-## Proposed landing sequence
-
-1. Quick independent fixes: 2.3 (gh noise), P0-4 (trust filter), 1.1's audit + 1.2's
- fallback (config), 1.2's indexing read/write split if the GET endpoint exists.
-2. 2.1 (case-fold + registry migration).
-3. 2.2 (route service, with a two-panel test harness).
-4. 1.1's config/indexing commits split out and merged separately.
-5. Arch 1.1 (sidebar collapse) with visual-regression coverage; then the P1 batch.
diff --git a/.kilo/plans/agent-manager-multi-project-sidebar-density.md b/.kilo/plans/agent-manager-multi-project-sidebar-density.md
new file mode 100644
index 00000000000..28790c6a3bf
--- /dev/null
+++ b/.kilo/plans/agent-manager-multi-project-sidebar-density.md
@@ -0,0 +1,437 @@
+# Plan: Agent Manager sidebar — shortcut badge fix + reclaim title width
+
+Worktree: `/Users/marius/Documents/git/kilocode/.kilo/worktrees/mewing-profit`
+All paths below are relative to `packages/kilo-vscode/`.
+
+Rules:
+
+- Do exactly these edits. Do not refactor anything else.
+- Solid.js, not React: `class=`, not `className=`.
+- Do **not** add `kilocode_change` markers. This package is Kilo-owned and CI fails if you do.
+- Do **not** add new i18n strings. None are needed.
+- Out of scope: the per-project `SESSIONS` list in the tree (tracked in
+ https://github.com/Kilo-Org/kilocode/issues/12928). Do not touch `UnassignedSessionsSection.tsx`.
+
+Do task A, verify, then task B, verify, then task C.
+
+## Task A — Shortcut badge on the right, hidden until hover or ⌘ held
+
+The `⌘1` badge on "local" rows is always visible, and in multi-project mode it renders on the
+*left*, between the icon and the label. Worktree rows already behave correctly. Cause:
+`.am-shortcut-badge` has no default `opacity: 0` — worktree badges are only hidden because their
+container `.am-wt-hover-actions` is hidden, and local rows never got that container.
+
+### A1 — `webview-ui/agent-manager/ProjectSidebarBody.tsx`
+
+Replace the whole `
+```
+
+The `−` in `am-stat-deletions` is U+2212 MINUS SIGN, not a hyphen. Copy it verbatim.
+
+### A2 — `webview-ui/agent-manager/SidebarBody.tsx`
+
+Same bug in legacy single-project mode, but the badge is already last, so only the wrapper is
+missing.
+
+Insert **before** line **127** (``):
+
+```tsx
+
+```
+
+Result: one `am-wt-actions-cell` div containing the skeleton ``, the stats ``, and the
+hover-actions div, closing before ``. Prettier fixes indentation in task D.
+
+### A3 — `webview-ui/agent-manager/agent-manager.css`
+
+Delete lines **569-575** and replace with the rule that actually works:
+
+```css
+.am-local-item .am-shortcut-badge {
+ right: 8px;
+}
+
+.am-local-item:hover .am-shortcut-badge {
+ opacity: 1;
+}
+```
+
+becomes:
+
+```css
+.am-local-item:hover .am-wt-hover-actions {
+ opacity: 1;
+ visibility: visible;
+}
+```
+
+(`right: 8px` never applied — the badge is `position: static`. The `opacity: 1` never did anything
+because nothing set `opacity: 0` first.)
+
+### A4 — same file, delete lines **609-611** entirely, add nothing:
+
+```css
+.am-show-shortcuts .am-local-item .am-shortcut-badge {
+ opacity: 1;
+}
+```
+
+The rule at lines 597-600 is not scoped to worktree items, so after A1/A2 it already covers local
+rows.
+
+### A5 — same file, lines **986-989**, add `visibility: hidden` to match worktree behaviour:
+
+```css
+.am-local-item:hover .am-worktree-stats,
+.am-local-item:hover .am-worktree-stats-skeleton {
+ opacity: 0;
+ visibility: hidden;
+}
+```
+
+### Verify A
+
+```bash
+cd packages/kilo-vscode && bun run typecheck && bun run lint
+```
+
+## Task B — Stop reserving width for invisible content
+
+`.am-wt-actions-cell` is a grid whose children all stack in cell 1/1, so the cell is permanently as
+wide as its widest child. `visibility: hidden` does not remove layout, so the invisible hover
+actions (~42px) and the loading skeleton (~48px) reserve width on every row forever. That is why
+titles truncate ~40px before the right edge.
+
+All edits in `webview-ui/agent-manager/agent-manager.css`.
+
+### B1 — Take hover actions out of grid flow
+
+Lines **475-482**. Add the four `position` lines at the top, keep everything else:
+
+```css
+.am-wt-hover-actions {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ gap: 2px;
+ opacity: 0;
+ visibility: hidden;
+}
+```
+
+Absolutely positioned children never size grid tracks. `.am-wt-actions-cell` is already
+`position: relative` (line 464). Do not edit the `.am-wt-actions-cell > *` rule at lines 469-472.
+
+### B2 — Same for the loading skeleton
+
+Add immediately after the rule from B1:
+
+```css
+/* Skeleton is a placeholder, not real content — it must not reserve title width. */
+.am-wt-actions-cell > .am-worktree-stats-skeleton {
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+}
+```
+
+Do not edit the base `.am-worktree-stats-skeleton` rule (lines 744-748) or `.am-pr-badge-skeleton`.
+
+After B1+B2 the cell is sized only by `.am-worktree-stats` and `.am-worktree-delete-hint`, which
+are the only things that should reserve space.
+
+### B3 — Fade the title under the overlaying actions
+
+The actions now overlay the row instead of sitting in reserved space, so a long title would render
+behind them. Same fix the codebase already uses for the local branch at lines 577-580. Add after
+B2:
+
+```css
+.am-worktree-item:hover .am-worktree-branch {
+ mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
+ -webkit-mask-image: linear-gradient(to right, black calc(100% - 48px), transparent 100%);
+}
+```
+
+### B4 — Remove one layer of nested padding
+
+Lines **365-370**, change `padding: 0 6px;` to `padding: 0;`:
+
+```css
+.am-project-body {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ padding: 0;
+}
+```
+
+Gains 6px per side on every row in a project. Rows keep their own 10px inset
+(`.am-local-item` line 106, `.am-worktree-item` line 425) so they stay indented under the project
+header. Do not change those, and leave `.am-project-body .am-section-header` (lines 273-275) alone.
+
+### B5 — Remove the remaining outer list gutters in multi-project mode
+
+The sidebar keeps 8px horizontal padding for the header controls, but the project list should use
+the full width up to its scrollbar. In the same CSS file, extend `.am-projects-list` with:
+
+```css
+.am-projects-list {
+ display: flex;
+ flex-direction: column;
+ min-height: 0;
+ overflow-y: auto;
+ margin-inline: -8px;
+}
+```
+
+Do not remove padding from `.am-sidebar` itself. This makes project cards and rows reach the
+scrollbar without moving the `PROJECTS` header and its controls to the edge.
+
+### Verify B
+
+```bash
+cd packages/kilo-vscode && bun run typecheck && bun run lint
+```
+
+## Task C — Show where a palette session lives
+
+In the ⌘F search palette, multi-project session results show only the project name, so you cannot
+tell whether a session is in a worktree or at the project root.
+
+File: `webview-ui/agent-manager/ProjectList.tsx`. In the session loop (lines **90-106**), add the
+two `const` lines and change `meta` and `search`:
+
+```tsx
+ for (const session of props.sessions[project.id] ?? []) {
+ const wt = session.worktreeId ? state.worktrees.find((item) => item.id === session.worktreeId) : undefined
+ const where = wt ? wt.label || wt.branch : props.t("agentManager.local")
+ items.push({
+ key: `${project.id}:session:${session.id}`,
+ projectId: project.id,
+ kind: "session",
+ group: "sessions",
+ title: session.title || props.t("agentManager.session.untitled"),
+ meta: [project.label, where],
+ search: [project.label, where, wt?.branch, session.title, session.id].filter(Boolean).join(" "),
+ updatedAt: session.updatedAt,
+ state: "idle",
+ visible: project.expanded,
+ sessionId: session.id,
+ location: session.worktreeId ? "worktree" : "local",
+ worktreeId: session.worktreeId ?? undefined,
+ })
+ }
+```
+
+`state` is already in scope (line 55) and already null-checked (line 56). `meta` is joined with
+` · ` by the renderer (`SidebarSearchMenu.tsx:143`), so no separator work is needed.
+
+## Task E — Align the project heading with the row icons
+
+Every row in the projects tree used a different left inset, which made the sidebar look busy and
+indented for no reason. Measured against a full-bleed `.am-projects-list` (starting at x=0):
+
+| Element | Before | After |
+|---|---|---|
+| `PROJECTS` label | 16px | 10px |
+| Project chevron | 12px | 10px |
+| `WORKTREES` / `SESSIONS` label | 6px | 10px |
+| `.am-local-item` icon | 10px | 10px |
+| `.am-worktree-item` icon | 10px | 10px |
+
+Changes in `agent-manager.css`:
+
+- `.am-local-item` padding `8px 10px` → `8px 6px`
+- `.am-worktree-item` padding `6px 10px` → `6px 6px`
+- `.am-project-item` padding `6px 8px 6px 12px` → `6px 6px`
+- `.am-project-body .am-section-header` padding-left `6px` → unchanged at `6px`
+- `.am-projects > .am-section-header` gets `padding-left: 2px`, because that heading sits inside
+ `.am-sidebar`'s own 8px padding rather than in the pulled-out list
+
+The leading columns carry no padding of their own (`.am-sidebar-header-toggle` and
+`.am-sidebar-header-chevron` are bare 16px boxes), so row padding is the only lever.
+
+### Symmetric gutter
+
+`.am-projects-list` uses `margin-left: -4px; margin-right: -4px`, pulling out of `.am-sidebar`'s
+8px padding to an even 4px gutter. An earlier attempt used `-8px` on the left for true full bleed,
+but that is wrong twice over: the resize handle's inner half then covered every card, so card
+clicks started a resize, and a selected row's `border-radius: var(--radius-sm)` background clipped
+flat against the window edge while still being inset on the right, which read as a bar bleeding off
+the sidebar rather than a card.
+
+4px is also the most reclaimable on the right. The handle's hit area is 8px wide centered on the
+border, reaching 5px back into the content area (255-263 in a 260px sidebar). At this gutter the
+row's hover actions end at 249, leaving 6px of clearance; anything tighter puts row buttons under
+the handle and turns clicks into resize drags.
+
+### Two tab stops
+
+Reducing the insets exposed that labels sat at four different offsets: the non-collapsible
+`WORKTREES` heading at 6px (it passes no `onToggle`, so `SidebarSectionHeader` renders no chevron),
+collapsible headings at 28px, worktree card text at 30px, and local card text at 32px because
+`.am-local-icon` was 18px wide while `.am-wt-icon` held a 16px glyph.
+
+Normalized to one 16px leading column with an 8px gap, giving exactly two tab stops:
+
+- `.am-sidebar-header-main` gap `6px` → `8px`, matching the card icon gap
+- new `.am-project-body .am-sidebar-header:not(.am-sidebar-header-toggleable) .am-sidebar-header-main { padding-left: 24px }`
+ so a heading with no chevron still reserves the column
+- `.am-local-icon` `18px` → `16px`
+- `.am-wt-icon` gains `width: 16px` and `justify-content: center`
+
+Measured result at 260px:
+
+| Tab stop | Elements |
+|---|---|
+| 10px | `PROJECTS` label, project chevron, local icon, worktree icon, `SESSIONS` chevron |
+| 34px | project name, `WORKTREES` label, `SESSIONS` label, local text, worktree text |
+
+```
+cardLeftGap=4 | cardRightGap=4 | actionsRight=249 | handleZoneFrom=255
+```
+
+`PROJECTS` intentionally stays at the 10px glyph stop rather than being pushed to 34px: it is the
+root heading, so indenting it further than the projects beneath it would invert the hierarchy.
+
+### Rejected: a per-project icon in the heading
+
+Superset shows a GitHub **owner** avatar per project (`https://github.com/{owner}.png?size=64`,
+falling back to the project's initial). Our webview CSP already allows `https:` images, so it was
+feasible, but it does not fit this repo set: of the local projects, ~17 are `Kilo-Org` remotes and
+would share one identical Kilo logo, and ~20 have no git remote at all and would show nothing.
+An owner avatar answers "who owns this", which is not the question the sidebar needs answered.
+Superset's repo-file scanner (`favicon-discovery.ts`) is dead code there, so it was not an option
+worth copying either. Left out entirely as out of scope.
+
+## Task D — Final checks
+
+From `packages/kilo-vscode`:
+
+```bash
+bun run format
+bun run typecheck
+bun run lint
+bun run test:unit
+bun run check-kilocode-change
+bun run compile
+```
+
+Then create `.changeset/agent-manager-sidebar-density.md`:
+
+```md
+---
+"kilo-code": patch
+---
+
+Fix the Agent Manager sidebar keyboard shortcut badge so it appears on the right edge of local rows and only while hovered or holding the jump modifier, give worktree titles more room by no longer reserving space for hidden row actions, and show which worktree a session belongs to in the search palette.
+```
+
+## Visual regression baselines
+
+Task A and B change existing snapshots: `WorktreeItemDefault`, `WorktreeItemActive`,
+`WorktreeItemPendingDelete`, `WorktreeItemStale`, `WorktreeItemWithStats`, `WorktreeItemGrouped`,
+`SidebarSearchOpen`, `MultiProjectSidebar` in `webview-ui/src/stories/agent-manager.stories.tsx`.
+
+**Do not run or update visual regression tests.** `tests/visual-regression.spec.ts` is skipped on
+macOS, so you cannot produce valid Linux baselines locally. CI regenerates them and may push a
+baseline commit. If a push is then rejected, do **not** `git pull --rebase`; run
+`git fetch && git push --force-with-lease`.
+
+## Manual test
+
+Enable `kilo-code.new.experimental.multiProject` in Kilo Settings → Experimental, add a second
+project, open Agent Manager (`Cmd+Shift+M`).
+
+1. Nothing hovered: no `⌘N` badge visible anywhere.
+2. Hover a `local` row: badge appears at the **right** edge, git stats fade out.
+3. Hold ⌘: badges appear on all local and worktree rows, all right-aligned. Release: all gone.
+4. Worktree rows with no git changes show noticeably longer titles than before. Hover one with a
+ long title: it fades under the badge and trash button instead of colliding.
+5. ⌘F: session results read ` · `.
+6. Turn the experimental setting off: the `local` row's `⌘1` badge is hidden until hover.
+
+## Known issue, not fixed here
+
+`⌘1`–`⌘9` index the full nav order, which includes session rows that render no badge
+(`navigate.ts:214-218` + `section-helpers.ts:147-153`). So with 4 worktrees you see `⌘1`–`⌘5` and
+`⌘6`–`⌘9` silently land on unlabelled session rows. Deliberately left alone: fixing it means
+changing jump semantics and rewriting `tests/unit/navigate.test.ts:745-757`, and it becomes moot
+once #12928 moves sessions out of the tree.
diff --git a/.kilo/plans/agent-manager-new-worktree-project-selector.md b/.kilo/plans/agent-manager-new-worktree-project-selector.md
new file mode 100644
index 00000000000..5f98fd086f7
--- /dev/null
+++ b/.kilo/plans/agent-manager-new-worktree-project-selector.md
@@ -0,0 +1,834 @@
+# Agent Manager — New Worktree Project Selector
+
+Status: implemented 2026-08-06. The implementation is uncommitted.
+
+This is Slice 4 item 6 ("Add project-aware New Worktree targeting") from
+`agent-manager-multi-project-uniform-ui.md`, the last unimplemented item of that slice.
+`agent-manager-multi-project-runtime.md:29` deferred it out of the backend-first scope.
+Everything the extension side needs already exists; this is almost entirely a webview
+change.
+
+Implementation notes:
+
+- The project catalog is passed into the dialog as an accessor so the picker reflects
+ registry changes while it remains open.
+- The per-project default-base resolver returns `undefined` when the project has no
+ configured/local branch, allowing the backend-detected branch response to remain the
+ fallback instead of being replaced by a hardcoded `main`.
+- Branch, import-result, and worktree-ready messages carry `projectId` in multi-project
+ mode, which makes fast project changes and cross-project creation activation safe.
+- The slash-command hook accepts optional caller-owned commands; `/project` is scoped to
+ this dialog and is hidden when multi-project mode is unavailable.
+
+---
+
+## Problem
+
+With `kilo-code.new.experimental.multiProject` enabled, the New Worktree dialog has no
+notion of which repository it targets, and the user cannot see or change it.
+
+`Cmd+N` opens the dialog with no project at all:
+
+```tsx
+// AgentManagerApp.tsx:1870-1876
+const showNewWorktreeDialog = () => {
+ if (!loaded()) return
+ expandSidebar()
+ dialog.show(() => (
+ dialog.close()} defaultBaseBranch={repoDefaultBranch()} />
+ ))
+}
+```
+
+`projectId` is `undefined`, so every message the dialog sends omits it
+(`agentManager.requestBranches` at `NewWorktreeDialog.tsx:321`,
+`agentManager.createMultiVersion` at `:373`, `agentManager.importFromPR` at `:566`,
+`agentManager.importFromBranch` at `:575`). The extension then silently falls back to the
+active project in `messageProject()` (`AgentManagerProvider.ts:474`) before running the
+message inside `ProjectScope`.
+
+The result is correct but opaque:
+
+- The dialog never shows which repository the worktree lands in.
+- The only way to target a specific project is the per-project `+` button
+ (`ProjectList.tsx:136-146`), which does pass `projectId` explicitly.
+- `defaultBaseBranch` is resolved from the *active* project
+ (`AgentManagerApp.tsx:261,272`), so even Advanced options' base-branch list and default
+ badge are implicitly single-project.
+
+The desired behavior, per the original request: the dialog should show the assigned
+project and let the user change it. Defaulting to the last selected project is fine as a
+default; it just must be visible and overridable.
+
+---
+
+## Design decisions
+
+### Placement: inline with the tab switcher
+
+The selector renders inside the New/Import pill row (`NewWorktreeDialog.tsx:620-699`),
+right-aligned with a constrained width, so it is shared by both tabs without adding a
+full-width form row.
+
+```
+┌─ New Worktree ──────────────────────────────┐
+│ [ New ] [ Import ] [ folder kilocode ▾ ] │ ← inline, multiProject only
+│ [ Worktree name (optional) ] │
+│ [ prompt … ] Code ▾ GPT-5.6 ▾ None ▾ │
+│ › Advanced options │
+│ VERSIONS 1 2 3 4 ⧉ Compare Models │
+│ [ Create Worktree ] │
+└──────────────────────────────────────────────┘
+```
+
+Rejected alternatives and why:
+
+- **Inside Advanced options.** Wrong category. Advanced options holds refinements of a
+ known target (branch name, base branch). The project *is* the target: changing it
+ invalidates the branch list, base branch, default-branch badge, and setup scripts.
+ Hiding it also fails the stated requirement of seeing which project is assigned.
+- **A full-width row directly beneath the tabs.** It covered both tabs, but consumed
+ unnecessary vertical space and made the project control look like a primary form field.
+- **In the dialog title** (`New Worktree in [kilocode ▾]`). Reads nicely but requires
+ widening `Dialog`'s `title` prop to accept JSX, which touches kilo-ui for one caller.
+
+### Visibility
+
+Render the row only when `multiProject` is true. With the flag off (the default) the
+dialog stays byte-identical to today, so there is no regression surface for the
+all-user path. When the flag is on but only the pinned project exists, still render it:
+showing the target is informative and the requirement is explicitly about seeing the
+assignment.
+
+### Default value
+
+`props.projectId ?? activeProjectId()`. `activeProjectId()` already exists at
+`AgentManagerApp.tsx:268` (`projectList().find((p) => p.active)?.id ?? currentProjectId()`).
+
+No new persistence. The active project is already the durable "last selected" state
+(persisted per project as `activeTarget` in each repo's `.kilo/agent-manager.json`, plus
+the registry's ordering). Adding a separate "last dialog project" key would create a
+second source of truth that can disagree with the sidebar.
+
+### Reuse, no new CSS
+
+The row uses the existing `am-advanced-field` + `am-nv-config-label` +
+`am-selector-wrapper` + `am-selector-trigger` markup, i.e. exactly the structure the base
+branch selector already uses at `NewWorktreeDialog.tsx:813-905`, with `DeferredPopover`
+(already imported) instead of `BranchSelectPopover`.
+
+### Component extraction
+
+`NewWorktreeDialog.tsx` is already 1136 lines. The selector and its popover list go into a
+new `webview-ui/agent-manager/ProjectSelect.tsx` (roughly `BranchSelect.tsx`'s role):
+presentational, takes `projects`, `value`, `onSelect`, and labels, and owns nothing but
+its own list rendering. The dialog keeps only the signal, the popover trigger, and the
+effects.
+
+Note: `webview-ui/agent-manager/NewWorktreeDialog.tsx` is not under a `maxLines` cap
+(`tests/unit/agent-manager-arch.test.ts` caps `src/agent-manager/*.ts` only), but the file
+is on the arch test's watched list and the caps exist to discourage exactly this kind of
+growth.
+
+---
+
+## Changes
+
+### 1. `webview-ui/agent-manager/ProjectSelect.tsx` (new)
+
+Presentational popover body listing projects:
+
+- Row = project label + dimmed root path (tooltip on the full root, matching
+ `ProjectsSection.tsx:60`).
+- Check mark on the selected project.
+- Untrusted and missing projects are disabled and carry the same affordances the accordion
+ uses: `lock` icon + trust hint, `warning` icon + missing hint
+ (`ProjectsSection.tsx:67-75`). Selecting them is not possible; trust happens in the
+ sidebar, not in this dialog. Keeps the dialog free of trust-flow branching.
+- There is intentionally no Add project action in this picker. Project registration and
+ trust management stay in the Agent Manager Projects toolbar.
+
+### 2. `webview-ui/agent-manager/NewWorktreeDialog.tsx`
+
+Props change:
+
+```ts
+export const NewWorktreeDialog: Component<{
+ onClose: () => void
+ projectId?: string // now: initial value, not fixed target
+ projects?: AgentProjectSnapshot[] // omitted / empty => single-project, row hidden
+ activeProjectId?: string
+ defaultBase?: (projectId: string) => string // replaces defaultBaseBranch?: string
+ mode: ModeRouter
+}>
+```
+
+`defaultBaseBranch?: string` must become a per-project lookup because each project has its
+own configured default and its own local branch. `ProjectList.tsx:142` already computes
+that expression (`state?.defaultBaseBranch ?? props.local[projectId]?.branch`); hoist it
+into the callback so both call sites share it.
+
+New state and derived values:
+
+```ts
+const [project, setProject] = createSignal(props.projectId ?? props.activeProjectId)
+const [projectOpen, setProjectOpen] = createSignal(false)
+const selectable = () => (props.projects ?? []).filter((p) => p.trusted && !p.missing)
+const showProject = () => (props.projects?.length ?? 0) > 0
+```
+
+Every outbound message switches from `props.projectId` to `project()`:
+`:321` `requestBranches`, `:373` `createMultiVersion`, `:566` `importFromPR`,
+`:575` `importFromBranch`.
+
+Reload branch data on project change, replacing the one-shot `onMount` request at `:319-321`:
+
+```ts
+createEffect(
+ on(project, (id) => {
+ setBranches([])
+ setBranchSearch("")
+ setHighlightedIndex(0)
+ setBaseBranch(null) // custom base is project-specific
+ setDefaultBranch(props.defaultBase?.(id) ?? "main")
+ setBranchesLoading(true)
+ vscode.postMessage({ type: "agentManager.requestBranches", projectId: id })
+ }),
+)
+```
+
+Drop stale branch replies in the `agentManager.branches` handler (`:520-525`).
+`AgentManagerBranchesMessage` **already declares an optional `projectId`**
+(`extension-messages.ts:939-945`, `src/agent-manager/types.ts:293-298`); the field is
+simply never populated or read today. Without this guard, switching projects twice quickly
+can race a wrong branch list into the base-branch popover:
+
+```ts
+if (ev.projectId && ev.projectId !== project()) return
+```
+
+Also replace the `if (!props.defaultBaseBranch) setDefaultBranch(ev.defaultBranch)` guard
+at `:523` — with a per-project lookup, the guard must consult
+`props.defaultBase?.(project())` instead of a fixed prop.
+
+Preserved across a project change (all project-agnostic): prompt text and its
+`advancedDialogPrompt` persistence, images, name, agent, model, variant, versions, compare
+allocations, sandbox override.
+
+Keyboard: add `project` to `WORKTREE_PROMPT_COMMANDS` so `/project` opens the popover,
+consistent with mode/model/variant/sandbox already being reachable from the dialog's slash
+menu (`:302-314`). Hide it from the list when `showProject()` is false, using the same
+`hidden` set mechanism already used for `agents` / `variant` / `sandbox`.
+
+### 3. `webview-ui/agent-manager/AgentManagerApp.tsx`
+
+`showNewWorktreeDialog` (`:1870-1876`) passes the catalog and a per-project default
+resolver instead of a single branch string:
+
+```tsx
+ dialog.close()}
+ projects={multiProject() ? projectList() : undefined}
+ activeProjectId={activeProjectId()}
+ defaultBase={defaultBase}
+/>
+```
+
+where `defaultBase(id)` reads `registry.ensure(id).defaultBaseBranch() ?? registry.ensure(id).localStats()?.branch ?? repoDetectedBranch() ?? "main"`.
+`registry.ensure` and both store fields already exist
+(`project/registry.ts:39`, `project/store.ts:62,67,113,123`).
+
+### 4. `webview-ui/agent-manager/ProjectList.tsx`
+
+`newWorktree(projectId)` (`:136-146`) passes the same `projects` / `activeProjectId` /
+`defaultBase` props with `projectId` as the initial value, so the per-project `+` button
+opens the dialog pre-scoped but still switchable. Its current inline
+`state?.defaultBaseBranch ?? props.local[projectId]?.branch` expression is replaced by the
+shared resolver passed down from `AgentManagerApp`.
+
+### 5. `src/agent-manager/worktree-importer.ts`
+
+Stamp `projectId` on all three `agentManager.branches` posts (`:27`, `:48`, `:54`). The
+field is already in the type; the value is available from the ambient `ProjectScope`
+context the message runs in (`AgentManagerProvider.ts:479`). Without this the stale-reply
+guard in the webview is inert.
+
+### 6. Activate the created worktree when the project differs
+
+Creating in a non-active project currently leaves the sidebar where it is:
+`createMultiVersion` never activates (no activation call in `provider-multi-version.ts`),
+and the new worktree just appears in that project's accordion. That is right for the
+per-project `+` button, but for `Cmd+N` where the user deliberately switched projects,
+landing in the new worktree is what the flow implies.
+
+Post an `agentManager.activateSelection` for the first created worktree when the chosen
+project differs from the active one. `activateSelection` already handles readiness, trust,
+and stale-target fallback (`project/messages.ts:76-99`), so this is one message, not new
+machinery. Hook it to the existing `agentManager.worktreeSetup` / `multiVersionProgress`
+handling in `AgentManagerApp.tsx:1453-1471`, which already carries `projectId`.
+
+### 7. i18n
+
+New keys in `webview-ui/agent-manager/i18n/en.ts` (near the existing
+`agentManager.dialog.*` block at `:130`):
+
+- `agentManager.dialog.project.select` — "Select project"
+- `agentManager.dialog.project.untrusted` — "Trust this project in the sidebar first"
+- `agentManager.dialog.project.missing` — "Repository not found"
+
+Then translate the four keys into the other 20 locale files in that directory via the
+`translator` subagent.
+
+---
+
+## Implementation order
+
+1. `ProjectSelect.tsx` with the presentational list, plus i18n keys in `en.ts`.
+2. Dialog: `project` signal, prop rename to `defaultBase`, route all four outbound
+ messages through `project()`, render the row behind `showProject()`.
+3. Dialog: `createEffect(on(project, …))` branch reload, base-branch reset, stale-reply
+ guard.
+4. Call-site updates in `AgentManagerApp.tsx` and `ProjectList.tsx`, shared `defaultBase`
+ resolver.
+5. `projectId` stamp in `worktree-importer.ts`.
+6. `/project` slash command.
+7. Post-create activation when the target project differs.
+8. Locale fan-out.
+9. Changeset (`minor`, user-facing): worktree creation targets an explicit project.
+
+---
+
+## Tests
+
+Existing source-text unit tests already assert against this dialog and will need to stay
+green: `tests/unit/new-worktree-dialog-sandbox.test.ts`,
+`tests/unit/prompt-input-bidirectional.test.ts`, and the dialog entry in
+`tests/unit/agent-manager-arch.test.ts`.
+
+New coverage:
+
+- The dialog posts `createMultiVersion` / `requestBranches` / `importFromBranch` /
+ `importFromPR` with the *selected* project id, not the prop, after a project change.
+- A `agentManager.branches` reply carrying a non-current `projectId` does not mutate the
+ branch list (the race guard).
+- Changing project clears `baseBranch` and re-derives `defaultBranch` from `defaultBase`.
+- Prompt text survives a project change (no accidental reset through the shared
+ `advancedDialogPrompt` cache).
+- The row does not render when `projects` is empty, so the single-project dialog is
+ unchanged.
+- Untrusted and missing projects are not selectable.
+
+Checks to run before declaring done, from `packages/kilo-vscode/`:
+`bun run typecheck`, `bun run lint`, `bun run test:unit`, `bun run knip`.
+
+---
+
+## Manual verification
+
+In the isolated harness (`bun run extension:isolated`) with
+`kilo-code.new.experimental.multiProject` enabled and two repositories registered:
+
+1. `Cmd+N` from project A shows "Project: A". Switch to B, create, and confirm the
+ worktree lands in B's accordion and the sidebar activates it.
+2. Switch project with Advanced options open and confirm the base-branch list and default
+ badge follow the new project rather than showing A's branches.
+3. Switch project rapidly back and forth and confirm the branch list matches the selected
+ project (the race guard).
+4. Type a prompt, switch project, confirm the prompt is retained.
+5. Use the Import tab after switching project and confirm branches and PR import target
+ the selected repository.
+6. Turn the flag off and confirm the dialog is visually identical to today.
+
+---
+
+## Out of scope
+
+- Trusting or removing a project from inside the dialog. Trust stays in the sidebar; the
+ dialog only disables untrusted entries.
+- Any change to how the active project is persisted.
+- The quick-create path (`Cmd+Shift+N` → `agentManager.createWorktree`,
+ `AgentManagerApp.tsx:1863-1867`). It has no dialog, so it keeps targeting the active
+ project. Worth revisiting only if the explicit-target rule should apply there too.
+- Per-project setup-script or agent selection in the dialog.
+
+## Risks
+
+- **Stale branch data** is the only real correctness risk, and it is why the `projectId`
+ stamp plus the reply guard are mandatory rather than optional polish.
+- **Prop signature change** (`defaultBaseBranch: string` → `defaultBase: (id) => string`)
+ touches both call sites; a partial migration would silently show one project's default
+ branch while creating in another.
+- **Dialog file growth**; mitigated by extracting `ProjectSelect.tsx`.
+
+---
+
+# Appendix: exact UI and styling specification
+
+Everything below is copy-paste ready. Class names, tokens, and icon names are all verified
+against the current tree. Do not invent new tokens or new class names beyond the ones
+listed here.
+
+## A. Visual layout
+
+```
+┌─ New Worktree ─────────────────────────────────────────── X ─┐
+│ │
+│ [ New ][ Import ] [ 📁 kilocode ⌃⌄ ] │
+│ └────────────────────────────────────────────┘ │
+│ ┌──────────────────────────────────────────────────────┐ │
+│ │ Worktree name (optional) │ │
+│ └──────────────────────────────────────────────────────┘ │
+│ ┌──────────────────────────────────────────────────────┐ │
+│ │ prompt … │ │
+│ │ Code ▾ OpenAI / GPT-5.6 ▾ None ▾ ✨ 🔒 🎤 │ │
+│ └──────────────────────────────────────────────────────┘ │
+│ › Advanced options │
+│ VERSIONS [1][2][3][4] [⧉ Compare Models] │
+│ ┌──────────────────────────────────────────────────────┐ │
+│ │ Create Worktree │ │
+│ └──────────────────────────────────────────────────────┘ │
+└──────────────────────────────────────────────────────────────┘
+```
+
+Open dropdown (anchored under the trigger, same width as the trigger):
+
+```
+ ┌────────────────────────────────────────────┐
+ │ 📁 kilocode ~/Documents/git/kilocode ✓│ ← .am-project-option-active
+ │ 📁 cloud ~/Documents/git/cloud │
+ │ 🔒 sample-app ~/dev/sample-app │ ← disabled, 50% opacity
+ │ ⚠ old-repo ~/dev/old-repo │ ← disabled, 50% opacity
+ └────────────────────────────────────────────┘
+```
+
+Rules:
+
+- The selector is inline with the New/Import buttons inside the tab-switcher flex row, so
+ it applies to New and Import alike.
+- The project name and folder icon identify the scope without a separate visible label.
+- The trigger is the same control as the Advanced options base-branch trigger
+ (`.am-selector-trigger`), so the dialog has one visual language for "pick a thing".
+- The row is **not rendered at all** when `props.projects` is empty or undefined. That is
+ the single-project / flag-off case, which must stay pixel-identical to today.
+
+## B. Exact icon names
+
+Only these, from `packages/ui/src/components/icon.tsx`:
+
+| Where | `Icon name` | Notes |
+|---|---|---|
+| Trigger left | `folder` | Always, regardless of project state. |
+| Trigger right | `selector` | Same as every other `.am-selector-trigger`. |
+| Option row, normal | `folder` | |
+| Option row, untrusted | `lock` | Matches the sidebar accordion affordance. |
+| Option row, missing | `warning` | Matches the sidebar accordion affordance. |
+| Option row, selected | `check-small` | Right-aligned. |
+
+All at `size="small"`. Do not use `folder-add-left`, `check`, or `plus`.
+
+## C. New file: `webview-ui/agent-manager/ProjectSelect.tsx`
+
+```tsx
+// Project picker list for the New Worktree dialog
+
+/** @jsxImportSource solid-js */
+
+import { For, Show, type Component } from "solid-js"
+import { Icon } from "@kilocode/kilo-ui/icon"
+import type { AgentProjectSnapshot } from "../src/types/messages"
+
+interface ProjectSelectProps {
+ projects: AgentProjectSnapshot[]
+ selected?: string
+ onSelect: (id: string) => void
+ labels: { untrusted: string; missing: string }
+}
+
+export const ProjectSelect: Component = (props) => (
+