Agents

Git worktrees and Docker containers for AI agent isolation

Overview

Agents in Agentastic are isolated development environments where AI coding assistants work without interfering with your main workspace. Each agent gets either a git worktree (a separate checkout of your repository) or a Docker container (a fully isolated environment).

Git Worktrees

What is a Worktree?

A git worktree is a linked working copy of your repository. Unlike branches (which share a single working directory), worktrees give each branch its own complete directory with all your files.

~/projects/
├── my-app/                    # Main worktree (your workspace)
├── my-app-worktrees/
│   ├── feature-auth/          # Agent 1's worktree
│   ├── feature-api/           # Agent 2's worktree
│   └── bugfix-login/          # Agent 3's worktree

Why Worktrees?

  • No conflicts - Each agent edits its own copy of files
  • Parallel work - Multiple agents can work simultaneously
  • Easy comparison - Diff between your work and agent's work
  • Safe experimentation - Delete a worktree if you don't like the results

Worktree Storage Locations

Configure where worktrees are created in Settings > Agents:

LocationPath PatternBest For
Inside Reporepo/.worktree/branch-nameSelf-contained projects
Adjacent (Default)repo-worktrees/branch-nameClean separation
Global~/worktrees/repo/branch-nameCentralized management

Creating a Worktree

From Agent Home:

  1. Open Agent Home
  2. Enter your prompt and branch name
  3. Click Send - the worktree is created automatically

From Settings:

  1. Open Settings > Agents
  2. Click Create Agent
  3. Choose branch and options

From Terminal:

git worktree add ../my-project-worktrees/feature-x -b feature-x

Switching Between Worktrees

ActionShortcut
Next AgentCmd+Option+Down
Previous AgentCmd+Option+Up

Or use the Navigator sidebar to click on a worktree.

Removing a Worktree

  1. Settings > Agents - Right-click, select Remove
  2. Terminal: git worktree remove path/to/worktree
  3. Cleanup stale refs: git worktree prune

Docker Containers

For maximum isolation, run agents inside Docker containers. Each container has:

  • Isolated filesystem and network
  • Pre-installed AI tools
  • Your worktree mounted at /workspace
  • Configurable resource limits

Enabling Containers

  1. Install Docker Desktop
  2. Open Agent Home
  3. Toggle Mode from "Worktree" to "Container"
  4. Select a container image
  5. Launch your agent

Available Images

ImageDescription
agentastic/soupAll-in-one: Claude Code, Codex, Aider
docker/sandbox-templates:claude-codeOfficial Claude Code sandbox
paulgauthier/aider-fullAider AI assistant
node:22-bookwormNode.js environment
python:3.12-bookwormPython environment

Container Mounts

Containers automatically get these mounts:

HostContainerPurpose
Your worktree/workspaceCode editing
Container home dir/rootTool state persistence
~/.gitconfig/root/.gitconfigGit identity (optional)
~/.ssh//root/.ssh/SSH keys (optional)

Network Modes

ModeDescription
BridgeFull network access (default)
RestrictedLimited to specific endpoints
NoneNo network access

Configure in Settings > Agents > Network Mode.

Supported AI Agents

Agentastic ships with 33 built-in agent definitions and auto-discovers them when installed. Here are some of the most popular:

Claude Code (Anthropic)

npm install -g @anthropic-ai/claude-code

Codex (OpenAI)

npm install -g @openai/codex

Command Code (Langbase)

npm i -g command-code

Gemini (Google)

npm install -g @google/gemini-cli

Hermes Agent (Nous Research)

curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

Official docsGitHub

Cursor

curl https://cursor.com/install -fsSL | bash

Cursor's terminal coding agent. Supports auto-approve (--yolo), resume (--continue), initial prompt, and sandbox control (--sandbox enabled|disabled). See the official docs.

GitHub Copilot

npm install -g @github/copilot

Junie (JetBrains)

curl -fsSL https://junie.jetbrains.com/install.sh | bash

OpenHands

pip install openhands-ai

Letta Code

npm install -g @letta-ai/letta-code

Cortex Code (Snowflake)

curl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh

Aider

pip install aider-chat

All Built-in Agents

AgentCLI CommandInstall
Agentasticagentastic execBuilt-in
Claude Codeclaudenpm install -g @anthropic-ai/claude-code
Codexcodexnpm install -g @openai/codex
Command Codecmdnpm i -g command-code
Cursoragentcurl https://cursor.com/install -fsSL | bash
Geminigemininpm install -g @google/gemini-cli
Hermes Agenthermescurl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
Qwen Codeqwennpm install -g @qwen-code/qwen-code
Droiddroidcurl -fsSL https://app.factory.ai/cli | sh
Ampampnpm install -g @sourcegraph/amp@latest
OpenCodeopencodenpm install -g opencode-ai
GitHub Copilotcopilotnpm install -g @github/copilot
Charmcrushnpm install -g @charmland/crush
Auggieauggienpm install -g @augmentcode/auggie
Goosegoosecurl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash
Kimikimiuv tool install kimi-cli
Kilocodekilocodenpm install -g @kilocode/cli
Kirokiro-clicurl -fsSL https://cli.kiro.dev/install | bash
Rovo Devacli rovodev runAtlassian CLI
Clineclinenpm install -g cline
Continuecnnpm install -g @continuedev/cli
Codebuffcodebuffnpm install -g codebuff
Mistral Vibevibecurl -LsSf https://mistral.ai/vibe/install.sh | bash
Pipinpm install -g @mariozechner/pi-coding-agent
Aideraiderpip install aider-chat
Autohand Codeautohandcurl -fsSL https://autohand.ai/install.sh | bash
Letta Codelettanpm install -g @letta-ai/letta-code
OpenHandsopenhandspip install openhands-ai
Cortex Codecortexcurl -LsS https://ai.snowflake.com/static/cc-scripts/install.sh | sh
Juniejuniecurl -fsSL https://junie.jetbrains.com/install.sh | bash
mini-SWE-agentminipip install mini-swe-agent
OB-1ob1curl -fsSL https://dashboard.openblocklabs.com/install | bash

Custom Agents

Add any TUI agent in Settings > Connections. The command should accept a prompt or work interactively.

Agent Lifecycle

1. Create
   └── Worktree created (or container started)
   └── Setup script runs
   └── Agent CLI launched

2. Work
   └── Agent receives your prompt
   └── Agent makes changes
   └── You monitor progress

3. Review
   └── View diff of changes
   └── Run code review (optional)
   └── Test in agent's environment

4. Complete
   └── Push and create PR, or
   └── Merge directly, or
   └── Discard changes

5. Cleanup
   └── Remove worktree
   └── Delete branch (optional)
   └── Container removed (if used)

Best Practices

Naming Conventions

Use descriptive branch names:

  • feature-user-auth
  • fix-login-bug
  • refactor-api-client

One Task Per Agent

Keep tasks focused. Instead of "build the whole feature," try:

  • "Add the database schema for users"
  • "Create the API endpoints"
  • "Build the frontend components"

Review Before Merging

Always:

  1. Check the diff
  2. Run AI code review
  3. Test the changes
  4. Verify no regressions

Clean Up Regularly

Remove old worktrees to:

  • Free disk space
  • Keep the agent list manageable
  • Avoid branch name conflicts

Troubleshooting

"Branch already checked out"

A branch can only exist in one worktree. Either remove the existing worktree or use a different branch name.

Container won't start

  1. Verify Docker Desktop is running
  2. Check image exists: docker images
  3. Review container logs in Settings > Agents

Agent not discovered

Ensure the agent CLI is:

  1. Installed globally
  2. In your PATH
  3. Executable (which agent-name)