Nested workspaces
Workspaces are ordinary clones, so Workler also works inside them. Running workler add inside a managed workspace creates the new workspace under that workspace's own .worktrees/ — useful when you work on multiple features and each feature workspace needs more checkouts, e.g. one per subagent:
project/
.worktrees/
feature-a/
.worktrees/
agent-1/
agent-2/cd "$(workler path feature-a)"
workler add agent-1
workler add agent-2How the nested level behaves
- Every command operates on the nearest enclosing workler project.
list,path,remove,apply, andaddrun insidefeature-aonly seefeature-a's own workspaces — the root's other workspaces don't leak in. - Rules come from the checked-out
.workler. A nested workspace applies the.worklerfile as checked out in its parent workspace — commit.worklerif nested workspaces should inherit the rules. linktargets resolve to the immediate parent.agent-1/node_moduleslinks tofeature-a/node_modules, which may itself be a link back to the root — the chain resolves transparently.- Bare
workler applyrefreshes from the immediate parent. Run insideagent-1, it re-appliesfeature-a's rules toagent-1. - Nesting depth is unlimited. Each clone's
workler.rootgit config points at its immediate parent, so discovery always finds the nearest level.
Why this is useful for agents
Give each coding agent its own full checkout:
- Agents can fetch, switch branches, and commit without any shared repository state — no lock contention, no ref surprises, none of
git worktree's same-branch restrictions. - Each agent workspace starts ready to run:
node_moduleslinked,.envcopied. - From
feature-a, plainworkler statusshows what every agent's checkout is doing, andworkler branch-syncmirrors each agent's branches back asrefs/workler/agent-1/...for review — without letting an agent move any of your branches.
Cleaning up
Nested workspaces are removed like any other, from their own level:
cd "$(workler path feature-a)"
workler remove agent-1Removing feature-a itself from the root also removes everything nested under it. remove's local-changes check only sees feature-a's own files — its nested checkouts live under a git-excluded .worktrees/, so their contents don't count. Before removing, rescue any agent work you care about (e.g. run workler branch-sync inside feature-a, then again at the root).