## Summary This fixes #518 by moving CodeNomad worktree execution from directory-header routing to OpenCode experimental workspace routing. OpenCode changed existing-session routing so session routes can prefer the session's stored directory over `x-opencode-directory`. That made the old CodeNomad worktree proxy model unreliable for sessions that should execute in a worktree. This PR switches CodeNomad to resolve an OpenCode workspace ID for each CodeNomad worktree and pass that workspace ID on worktree-scoped OpenCode calls. ## What changed - Start OpenCode with `OPENCODE_EXPERIMENTAL_WORKSPACES=true`. - Change the OpenCode server base URL from `/workspaces/:id/worktrees/root/instance` to `/workspaces/:id/instance`. - Add a root OpenCode client helper in `packages/ui/src/stores/opencode-client.ts`. - Add OpenCode workspace sync/cache helpers in `packages/ui/src/stores/opencode-workspaces.ts`. - Sync OpenCode workspaces after CodeNomad worktree hydration and after worktree create/delete flows. - Map CodeNomad worktree slugs/directories to OpenCode `workspace.id` values discovered by `experimental.workspace.syncList` and `experimental.workspace.list`. - Replace all OpenCode worktree clients with the root client plus explicit `workspace` payloads where the active session/worktree requires it. - Route session, permission/question, file browser reads, SDK git status, and prompt/action calls through root OpenCode client + workspace ID. - Keep CodeNomad local git worktree server APIs intact; those still need filesystem directories for local git operations. ## Review fix - Fixed right-panel file saves so they no longer write to the root workspace after reading from a selected worktree. - The existing CodeNomad file-content API now accepts an optional `worktree` query parameter. - Right-panel saves pass `worktreeSlugForViewer()`, and the server resolves that slug to the same worktree directory used by local git worktree APIs before writing. - Root saves continue to use the original root workspace path. ## Removed old routing - Removed `/workspaces/:id/worktrees/:slug/instance` OpenCode proxy routes. - Removed directory override proxy support using `/__dir/<encoded>`. - Removed proxy injection of `x-opencode-directory`. - Removed the remaining background-process completion prompt `x-opencode-directory` header. - Removed `getOrCreateWorktreeClient`, `getOrCreateWorktreeClientWithDirectoryOverride`, and worktree proxy path helpers from the UI worktree store. - Simplified `sdkManager.createClient` because clients are no longer keyed by worktree slug. ## Why this fixes #518 Worktree sessions can now stay visible under the root project session listing while worktree execution is selected through OpenCode's workspace routing model. CodeNomad no longer depends on `x-opencode-directory` to override existing session directories, so sessions should not disappear from the root-directory list or execute in the wrong directory because of stale session directory fallback behavior. Fixes #518 ## Validation - `npm run typecheck --workspace @codenomad/ui` - `npm run typecheck --workspace @neuralnomads/codenomad` - `git diff --check` ## Notes Some touched files are already oversized and were not refactored as part of this migration: `packages/server/src/server/http-server.ts`, `packages/ui/src/stores/instances.ts`, `packages/ui/src/stores/session-api.ts`, `packages/ui/src/stores/session-state.ts`, `packages/ui/src/components/instance/shell/right-panel/RightPanel.tsx`, `packages/ui/src/stores/session-events.ts`, and `packages/server/src/background-processes/manager.ts`. |
||
|---|---|---|
| .github | ||
| .opencode | ||
| dev-docs | ||
| docs | ||
| images | ||
| packages | ||
| scripts | ||
| tasks | ||
| temp | ||
| .gitignore | ||
| AGENTS.md | ||
| BUILD.md | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| PROGRESS.md | ||
| README.md | ||
CodeNomad
The AI Coding Cockpit for OpenCode
CodeNomad transforms OpenCode from a terminal tool into a premium desktop workspace — built for developers who live inside AI coding sessions for hours and need control, speed, and clarity.
OpenCode gives you the engine. CodeNomad gives you the cockpit.
Features
- 🚀 Multi-Instance Workspace
- 🌐 Remote Access
- 🧠 Session Management
- 🎙️ Voice Input & Speech
- 🌳 Git Worktrees
- 💬 Rich Message Experience
- 🧩 SideCars
- ⌨️ Command Palette
- 📁 File System Browser
- 🔐 Authentication & Security
- 🔔 Notifications
- 🎨 Theming
- 🌍 Internationalization
Getting Started
🖥️ Desktop App
Available as both Electron and Tauri builds — choose based on your preference.
Download the latest installer for your platform from Releases.
| Platform | Formats |
|---|---|
| macOS | DMG, ZIP (Universal: Intel + Apple Silicon) |
| Windows | NSIS Installer, ZIP (x64, ARM64) |
| Linux | AppImage, deb, tar.gz (x64, ARM64) |
💻 CodeNomad Server
Run as a local server and access via browser. Perfect for remote development.
npx @neuralnomads/codenomad --password <your-password> --launch
Authentication required: The server requires a password on first run. You can pass it via
--password, theCODENOMAD_SERVER_PASSWORDenvironment variable, or create anauth.jsonfile (see Server Documentation).
Self-signed certificate: On first launch with HTTPS enabled (the default), your browser will show a "Your connection is not private" warning. This is expected — the server generates a local self-signed certificate automatically. Click Advanced → Proceed to localhost to continue. For local-only use without the warning, run with
--https=false --http=true.
See Server Documentation for flags, TLS, auth, and remote access.
🧪 Dev Releases
Bleeding-edge builds from the dev branch:
npx @neuralnomads/codenomad-dev --password <your-password> --launch
SideCars
SideCars let you open local web tools inside CodeNomad as tabs.
Configuration
- Name: Display name used in CodeNomad
- Port: Local HTTP or HTTPS service running on
127.0.0.1:<port> - Base path: Mounted under
/sidecars/:id - Prefix mode:
- Preserve prefix forwards the full
/sidecars/:id/...path upstream - Strip prefix removes
/sidecars/:idbefore forwarding the request upstream
- Preserve prefix forwards the full
VSCode (OpenVSCode Server)
Run with Docker:
docker run -it --init -p 8000:3000 -v "${HOME}:${HOME}:cached" -e HOME=${HOME} gitpod/openvscode-server --server-base-path /sidecars/vscode
Add SideCar as:
- Name:
VSCode - Port:
http://127.0.0.1:8000 - Base path:
/sidecars/vscode - Prefix mode:
Preserve prefix
Terminal (ttyd)
Run with:
ttyd --writable zsh
Add SideCar as:
- Name:
Terminal - Port:
http://127.0.0.1:7681 - Base path:
/sidecars/terminal - Prefix mode:
Strip prefix
Requirements
- OpenCode CLI — must be installed and in your
PATH - Node.js 18+ — for server mode or building from source
Development
CodeNomad is a monorepo built with:
| Package | Description |
|---|---|
| packages/server | Core logic & CLI — workspaces, OpenCode proxy, API, auth, speech |
| packages/ui | SolidJS frontend — reactive, fast, beautiful |
| packages/electron-app | Desktop shell — process management, IPC, native dialogs |
| packages/tauri-app | Tauri desktop shell (experimental) |
Quick Start
git clone https://github.com/NeuralNomadsAI/CodeNomad.git
cd CodeNomad
npm install
npm run dev
Troubleshooting
macOS: "CodeNomad.app is damaged and can't be opened"
Gatekeeper flag due to missing notarization. Clear the quarantine attribute:
xattr -dr com.apple.quarantine /Applications/CodeNomad.app
On Intel Macs, also check System Settings → Privacy & Security on first launch.
Linux (Wayland + NVIDIA): Tauri App closes immediately
WebKitGTK DMA-BUF/GBM issue. Run with:
WEBKIT_DISABLE_DMABUF_RENDERER=1 codenomad
See full workaround in the original README.
Community
Built with ♥ by Neural Nomads · MIT License
