Contents

Linux workspaces

On Linux, gitta can let many Claude Code worktrees share one checkout on disk. It can also run agents in a sandbox. Both are optional.

Shared checkout

A normal worktree is a full copy of the repository's files. Five agents on a large repository need five copies. With a shared checkout, every agent sees a full repository, but only the files it changes are stored separately.

Three agent views on top of one shared read-only checkout. Each agent's changes go to its own thin layer. Agent 1 sees a full repository Agent 2 sees a full repository Agent 3 sees a full repository Layer: only files agent 1 changedLayer: only files agent 2 changedLayer: only files agent 3 changed Read-only git checkout (shared)the base commit's files, including node_modules and other ignored folders

gitta init sets this up for new Claude Code worktrees in the repository. gitta uses the best method that is available:

MethodUsed when
Kernel overlaygitta runs as root.
fuse-overlayfsIt is installed and gitta runs as a normal user.
gitta's own FUSE layerFUSE is available.
Ordinary worktreeNone of the above is available.

Each agent still gets a real git worktree, with its own branch, HEAD and index. The agents share only the files, never their git state, so one agent's staged or committed work never shows up in another agent's worktree.

To make several workspaces at once, run gitta up -n 3 --backend overlay as root, or --backend fuse as a normal user. Each agent gets its own branch, gitta/a1, gitta/a2 and so on. In a repository where you already ran gitta init, the new agents join that setup and branch off your main branch, so you merge their work with git merge as usual. gitta down removes them again.

When the last worktree on a base commit goes away, gitta also removes the shared checkout of that commit, so old checkouts do not pile up.

Cost on compile-heavy workReading through a layer is slower than reading a normal folder, and a compile-heavy test job shows it most. Use the shared checkout when disk space matters more than build time. Turn it off with gitta init --no-cow.

Sandbox

The sandbox uses Linux Landlock. The kernel enforces it for the agent and every process the agent starts. The agent can read and write its own worktree and read system folders. It cannot reach your home folder, SSH keys, cloud credentials, the main checkout or other agents' worktrees.

Start agents in the sandbox with gitta run --sandbox, or run any command in it directly:

 Terminal
$ gitta-sandbox --workspace ../translate-api --no-net -- claude
$ gitta-sandbox --workspace ../translate-api --net-port 443 --write ~/.cache/pip -- claude
OptionEffect
--read PATHAlso allow reading this path.
--write PATHAlso allow writing this path, for example a cache folder.
--no-netNo TCP connections and no TCP listening.
--net-port NAllow TCP connections only to these ports.

Without --no-net or --net-port, the network stays open. Landlock's network rules cover TCP only. UDP, DNS lookups and raw sockets stay possible. For a complete network ban, run the agent in a network namespace as well, for example a container without a network or unshare -n.

File rules need Linux 5.13 or later. Network rules need Linux 6.7 or later. On an older kernel, --no-net and --net-port refuse to start instead of running with the network open. Nothing sits between the agent and its files.

Keep secrets out of reach of agents in any case.

To give each agent its own worktree, see Agents. For what gitta checks in agent changes, see Security and data.