HydraCommand an army of AI coding agents — each on its own branch, in its own terminal, all from VS Code. 🌏 Read this in other languages: English | 中文 What is Hydra?Hydra turns VS Code into a control panel for parallel AI development. Instead of running one agent at a time, spin up multiple agents — each working on a separate git branch in its own terminal session.
Every session persists in tmux (or Zellij). Close VS Code, SSH from your phone, come back tomorrow — your agents are still running. Core ConceptsCopilotA single persistent AI agent session in your current workspace. Think of it as your pair-programming partner — it sees the same code you do and works alongside you on the current branch.
WorkerA disposable AI agent that gets its own git branch, its own worktree, and its own terminal session. Give it a task and let it work independently while you focus on something else.
Supported Agents
Configure default agent and commands in settings:
Getting Started
Launch a Copilot: Click the Copilot button (robot icon) → pick an agent → it starts in your workspace. Spawn a Worker: Click the Worker button (server icon) → enter a branch name like FeaturesSidebar Tree ViewThe Hydra panel gives you a live overview of everything running:
Smart Attach
Smart Paste (Image-Aware)
Works over Remote-SSH too — clipboard images are bridged from local to remote. Dual Backend: tmux + ZellijSwitch between tmux and Zellij from the panel header. Both backends support the same features: session creation, metadata storage, pane management, and agent lifecycle. Session Management
Orphan CleanupDetect and remove tmux sessions that no longer have matching worktrees. One click to keep your environment tidy. CLI Tool (
|
| Flag | Required | Description |
|---|---|---|
--repo |
yes | Path to the git repository |
--branch |
yes | Branch name to create |
--agent |
no | Agent type: claude, codex, gemini (default: claude) |
--base |
no | Base branch override (default: auto-detect) |
--task |
no | Initial prompt to give the agent |
The CLI mirrors the full Hydra: Create Worker flow — branch validation, slug collision resolution, worktree creation under .hydra/, tmux session setup, and agent launch.
Commands
| Command | Description |
|---|---|
Hydra: Create Copilot |
Launch an AI copilot in your current workspace |
Hydra: Create Worker |
Create a new branch + worktree + agent session |
Hydra: Attach/Create Session |
Attach to or create a session for the current worktree |
Hydra: Remove Task |
Remove a worktree and its session |
Hydra: Cleanup Orphans |
Remove orphaned sessions |
Hydra: Smart Paste (Image Support) |
Smart paste: text or image |
Hydra: Paste Image from Clipboard |
Force image paste into terminal |
Real-World Workflows
Parallel AI Development
myapp/
├── main → Copilot: Claude helping you review PRs
├── feat/oauth → Worker: Claude building the OAuth flow
├── feat/dashboard → Worker: Codex generating UI components
└── fix/memory-leak → Worker: Gemini profiling and patching
Fire off workers for independent tasks. Check results in VS Code. Sessions keep running in the background.
Remote Server + Mobile Access
SSH into a dev server, manage workers with Hydra, disconnect — sessions persist. Reconnect from home, a cafe, or your phone:
ssh dev-server
tmux attach -t myapp-a1b2c3d4_feat-oauth
Review AI-written code during your commute via Termux.
Configuration
| Setting | Default | Description |
|---|---|---|
hydra.defaultAgent |
claude |
Default agent for new copilot/worker sessions |
hydra.agentCommands |
{...} |
Map of agent type → shell command |
hydra.baseBranch |
auto-detect | Override base branch for new workers |
tmuxWorktree.multiplexer |
tmux |
Backend: tmux or zellij |
tmuxWorktree.baseBranch |
auto-detect | Override base branch (legacy) |
Requirements
- tmux (or Zellij) — installed and in PATH
- git — installed and in PATH
- VS Code 1.85.0+
How It Works
Repository
├── main → session: "project-a1b2c3d4_main"
├── feat/auth → session: "project-a1b2c3d4_feat-auth" [Worker: Claude]
└── fix/bug-123 → session: "project-a1b2c3d4_fix-bug-123" [Worker: Codex]
→ session: "hydra-copilot" [Copilot: Claude]
Workers each get a dedicated git worktree + terminal session. Session names use a repo-name + path-hash namespace for collision safety across same-name repos. Worktrees are stored under <repo>/.hydra/worktrees/ by default.
Copilot gets a single global session (hydra-copilot) tied to your workspace directory — no worktree needed.
Both Copilot and Worker sessions store their role and agent type as session metadata, so Hydra can display the right status in the tree view.
Security Note
Worker agents run with auto-approved permissions (e.g., --dangerously-skip-permissions for Claude). This means workers can execute shell commands, read/write files, and make network requests without prompting. This is by design for autonomous operation, but you should:
- Only run workers in trusted repositories
- Review worker diffs before merging (
git diffin the worktree) - Use isolated environments (containers, VMs) for untrusted workloads