# Workbench, Git Worktrees & SSH Tunnels — Octopus ADE

> Canonical HTML: https://octoterm.si/docs/guides/workbench-and-worktrees (ZH) · https://octoterm.si/en/docs/guides/workbench-and-worktrees (EN)
> Docs Index: https://octoterm.si/docs/llms.txt

## TL;DR

Octopus organizes terminals, AI agents, Git Worktree branch workspaces, container sandboxes, lazy-loaded file/Git inspection, and SSH/Mosh port tunnels by project and project group—keeping large repositories fast with zero background bloat.

## Projects, Project Groups & Merge Working Directories

- Each **project** owns its own terminal tabs, agent sessions, drag-to-split layouts, and right-hand explorer/Git state; switching projects keeps background builds and agents alive.
- **Project groups** organize related repositories; enabling **Merge Working Directories** on a group automatically passes sibling local repository paths to agents that support extra directories (ideal for frontend + backend or multi-repo services).
- Powered by `MiniPty` + `TKCode.Arc.Terminal` with true color, CJK IME, full-screen TUIs (`vim`, `htop`, `btop`), and auto-detected shells (`zsh`, `bash`, `fish`, `PowerShell 7`, `WSL`).

## Git Worktree Branch Workspaces

1. Create a dedicated Worktree branch workspace (e.g., `feat/oauth-pkce`, `fix/rate-limit`) under any Git project.
2. Run multiple coding agents concurrently in isolated branches and directories with zero file or build-cache collisions.
3. Inspect diffs, stage, commit, and prune merged Worktrees cleanly from the workbench.

## Multi-Backend Sandbox Isolation

| Sandbox Backend | Best For | Highlights |
| --- | --- | --- |
| **Local Containers (Docker / Podman / Apple Container)** | Fast local workstation isolation | Mounts active Worktree directory; native Apple Container support on macOS |
| **Remote Docker Host** | Offloading heavy builds to a Linux server | Control from laptop UI while containers run remotely |
| **OpenSandbox** | Standardized team sandbox pools | Ephemeral, reproducible sandboxes via open-source OpenSandbox API |
| **Octopus Cloud Hosts** | Always-reachable cloud dev workspaces | Persistent disk, private port previews, mobile takeover |

## Lazy-Loaded File Explorer, Native Mermaid & Git Panel

- **Zero overhead when collapsed**: While the right panel is closed, Octopus reads no file tree, registers zero file watchers, and runs zero Git commands.
- **Built-in previews**: Syntax-highlighted code viewer, Markdown + **native Avalonia Mermaid** diagrams (no WebView), inline image & SVG inspection.
- **Git workflow**: View modified/untracked files, inspect line diffs, stage/unstage, discard hunks, and commit directly.

## SSH / Mosh / Telnet & Visual Port Forwarding

- Reads existing `~/.ssh/config` hosts (including `ProxyJump` bastions) automatically.
- Manages SSH, Mosh (resilient over flaky Wi-Fi/5G), and Telnet sessions alongside local projects.
- Visual `-L` (local) and `-R` (remote) port tunnel controls with live status indicators for accessing internal databases, dashboards, and preview servers.
