# Team cleanup

> Keeps a project's list of agent teams small enough to stay usable.

- Area: Desktop, mobile and web
- Plans: All plans
- Last checked against the product: 2026-10-02
- Web page: https://agentsroom.dev/docs/team-cleanup

## What it does

Keeps a project's list of agent teams small enough to stay usable. A project's teams are stored together and limited to 14 MB; a project whose agents create a team for every task can reach that limit in two weeks, and past it no project team can be created or edited. Three tools prevent and fix that: the Teams window shows how full the list is and warns before the limit, cleanup filters find the teams nobody runs any more so you can delete hundreds of them in one go, and a team made for one task can delete itself once its run is over. Agents get the same tools over MCP.

## Where to find it

- Inside a project, **Add Team** opens the **Agent Teams** window. The **Configure** tab starts with the size of the project's list ("1,161 project teams · 10.4 MB of 14 MB", turning orange with a warning from 80 %), then the cleanup filters: **Last run**, **Created** and **Created by an agent**.
- Under each team of the **Configure** tab, a small line says when it was created, when it last ran (or "Never run"), and whether an agent created it or it is a **Run once** team.
- **Select** (top of the **Configure** tab) turns on the checkboxes; **Select all** then picks exactly the teams the search bar and the filters left visible.
- In the team editor, **Team settings** > **One-off team** > **Delete this team after its run**.

## How to use it

1. Open the **Configure** tab and look at the size line. Below 80 % there is nothing to do.
2. Narrow the list: **Last run** > **Never run** (or **Not in the last 30 days**), and **Created** > **More than 1 day ago** to spare the teams created today. **Created by an agent** keeps only the teams an agent created over MCP.
3. **Select** > **Select all** > **Delete**: one confirmation, one request, whatever the number of teams. **Reset filters** brings the whole list back.

For teams made for a single task, tick **Delete this team after its run** in its settings. Once its run is finished (**Finish run**) or cancelled, the team removes itself. A blocked run keeps it, so you can still loop back or add cycles.

A better habit for repeated work: keep one team per kind of pipeline (build, check, review) with general step instructions, and put each task's details in the backlog ticket that starts the run. The first step receives the ticket, and every run starts from the latest saved version of the team.

## Settings

- `runOnce` (team field, Teams window > **Team settings** > **One-off team** > **Delete this team after its run**; off by default): the team deletes itself once its run is finished or cancelled, on the machine that ran it. Also settable with `teams_save({runOnce: true})`.

## Agent tools (MCP)

- `teams_list`: every team with `createdAt`, `lastRunAt` (empty when it never ran), `createdBy: "agent"` for a team an agent created, `runOnce` and its size, plus `projectList` (how much of the 14 MB the list uses, with a warning from 80 %). Filters: `neverRun`, `notRunForDays`, `olderThanDays`, `createdByAgent`, `scope`; `idsOnly: true` returns just the ids.
- `teams_delete`: one team (`teamId`) or many (`teamIds`, up to 5,000 per call, one request per scope). Ids that match no team come back in `notFound`. Refused as a whole, nothing deleted, when one of the named teams has a live run. Like every delete, an agent only calls it when you asked for the cleanup.
- `teams_save`: `runOnce: true` creates a one-off team; every save warns when the list nears its limit.
- `capabilities_get` (topic `teams`): the `teamList` entry gives the limits, the recommended pattern and the cleanup steps.

An open Teams window refreshes by itself after an agent saves or deletes teams.

## Providers

All providers, no difference: the tools are part of `AgentsRoom-MCP`, available to every agent CLI.

## Mobile

Not on the phone: teams are created, edited and deleted on the desktop. A finished run of a one-off team stays visible on the phone after its team is gone.

## Limits

- One team is limited to 1 MB, a project's whole list to 14 MB.
- **Created by an agent** only recognizes teams created from 2026-10-02 on: older teams carry no author.
- The last run of a project team is recorded on your account, so every machine sees it. For an app-wide (global) team it is read from the runs of the project you have open.
- Seeded templates are never matched by the cleanup filters.
- A one-off team that never runs stays until you delete it: filter on **Never run** to find it.

## Common questions

- **I have hundreds of teams I no longer use. How do I delete them quickly?** **Configure** > **Last run** > **Never run** (add **Created** > **More than 1 day ago** to spare today's teams) > **Select** > **Select all** > **Delete**. An agent does the same with `teams_list({ neverRun: true, idsOnly: true })` then `teams_delete({ teamIds })`.
- **Creating a team fails because the list is too large. What now?** Delete unused teams as above; the size line shows the room you get back. Since 2026-10-01 a refused save names the limit instead of failing as "INVALID_JSON".
- **My agents create a new team for every task. What should they do instead?** One reusable team per kind of pipeline, with the task in the backlog ticket. When a task really needs its own graph, `runOnce: true`.
- **Does deleting a team delete its runs?** No. Finished runs stay in the sidebar until you dismiss them. Deleting the team behind a live run closes that run, which is why agents are refused when they try.

## Related

- [Agent Teams](https://agentsroom.dev/docs/teams.md): what a team is, how runs work.
- [Backlog Task Board](https://agentsroom.dev/docs/backlog-task-board.md): assign a team to a ticket, the place for each task's brief.
- [AgentsRoom MCP](https://agentsroom.dev/docs/agentsroom-mcp.md): the MCP tools agents use to manage teams.
