Retire instance

From awebai/aweb · View interactive version

Retire instance is an AI agent skill from the GitHub repository awebai/aweb. Remove a teammate — delete an instance's aweb identity and workspace, then its home, worktree, and branch. Use when an instance's job is done (a developer whose branch merged, a reviewer that gave its verdict).

How to use this skill

Skill file

Retire an instance

One-shot instances are retired when their job is done, so teammates don't

pile up on the network. Standing instances (the coordinator) are

long-running and not retired this way.

Preserve first. Before removing anything, make sure useful branch work

is merged or pushed, and anything the instance learned that belongs in its

soul is committed (see self-maintenance).

Run from outside the instance (e.g. your own home):

name=<name>
REPO="$(cd "$(git rev-parse --git-common-dir)" && cd .. && pwd)"
inst="$REPO/agents/instances/$name"

( cd "$inst" && aw workspace delete "$name" )            # workspace + identity (run from ITS home)
git -C "$REPO" worktree remove "$inst/work" --force 2>/dev/null   # if it had a worktree
rm -rf "$inst"
git -C "$REPO" branch -D "$name" 2>/dev/null
git -C "$REPO" worktree prune

Use aw workspace delete, not aw id team leave — leave refuses an

identity's only team. If it answers 409 "Workspace is still active", the

service hasn't marked it stale yet: wait and retry before removing the

local directory — **never delete the home while the server still considers

the member active**, or it orphans in the roster. If the instance died

before cleanup, remove the stale member via the dashboard.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.