Run workspaces
The reused folder every session of a task or bot runs in.
Paths in crates/axe-core/src/, crates/axe-telegram/src/, crates/axe-node/src/, crates/axe-server/src/ or crates/axe/src/ (a file is in one) unless noted.
Run workspaces. Every session of a task runs in one reused folder,
<run_root>/task-<id> ([worktrees] run_root, default
<workspace_root>/.runs; $AXE_WORKTREE), generated by the node
(run_workspace.rs). Nothing needs a project checkout. It holds one worktree
per repo the task names (--repo; none when omitted) under repos/<name>,
all on the task branch <branch_prefix>task-<id>--work, plus a generated
AGENTS.md (the task contract and an index), skills/ linked from each
repo's .agents/skills and a docs/index.md, plus attached docs (see Run
context). A repo's canonical clone is
[repos.<name>] path, default <workspace_root>/<name> (run_workspace.rs).
When that clone is missing, the node clones it there on first use from
its clone URL, with the host's own Git credentials (never a token in config
or on the server), before building the worktree; concurrent first uses clone
once, and the run's run_start event lists it in repos_cloned
(worktree::ensure_clone_from). The URL is [repos.<name>] url when this
machine's config sets one, else the server's repo registry
(worktree::clone_url, repo.rs): axe repo set <name> <url> [--default-branch B], axe repo list, axe repo show <name>, axe repo rm <name> (writes need the token; a URL with embedded credentials or a leading
- is refused, as in config). path stays local. A missing clone with no URL
stops the run with that reason, pointing at axe repo set; when the registry
cannot be read, the reason says so.
Worktrees are never reset. A task an older node started in
<workspace_root>/.worktrees/<project>/task-<id>--work (no repos) resumes
there while that folder exists; nothing creates one any more. A bot runs in
<run_root>/bot-<name> the same way, with its repo list
(axe bot set <name> --repo <r>, --no-repos clears it), on branch
bot-<name>--work. axe bot set <name> --project <p>
moves a bot to another project (its subscriptions keep the projects they
name), and axe goal set <name> --project <p> moves a goal. A bot run
fetches nothing before it starts (a new worktree is fetched once, when it is
created); the run folder's AGENTS.md shows how long ago each repo was synced
(repos/axe: synced 2h ago), and the bot protocol has the bot run axe repo sync <repo> before reading or changing a repo's code. That fetches and
fast-forwards $AXE_WORKTREE/repos/<repo> to the base branch's origin commit
when it is clean and has no local commits, and records the time in the
worktree's Git directory; otherwise it changes nothing and fails with why.
axe workspace <bot> still refreshes each worktree that way. Housekeeping removes a task's run
folder after the task is done for the retention: each repo worktree is
removed with git worktree remove and pruned, and only when the folder holds
nothing but what axe generates (housekeeping.rs; axe housekeeping --dry-run prints each decision). Bot run folders stay. Run logs and the
runtimes' session transcripts go past [housekeeping.logs] max_age
(default 30 days) or max_size, even with housekeeping off (retention.rs).