All Agent Engineering

Manage persistent team tasks with the Cline SDK

Decide whether a team is warranted, configure the coordinator and task board, record the session ID and verify state after resuming.

AINavWritten / Updated
On this page

At a glance

When a long task splits into fairly independent parts and must be resumed over several days, the team feature of the Cline SDK provides a shared task board, mailbox, mission log and outcome merging. The official documentation says teams are a ClineCore feature enabled in the session config, and that team state belongs to the session, so the team and teammates come back when the session resumes. The deliverable here is a host-side plan covering task assignment, how persistent state is recorded and a checklist for after resuming. The documentation also warns that teams add overhead, and that a single agent with good tools is usually more efficient for simpler cases.

Runtime and applicability

Article type
Engineering practice
Verified
Applies to
  • Cline Manage persistent team tasks with the Cline SDK

Execution locations and responsibilities

  • Host application embedding Cline SDK Use the workflow below to distinguish responsibilities of the caller, runtime, and external actions.
Engineering workflow order
Engineering workflow order1. Decide first whether a team is really needed → 2. Enable teams in the session config → 3. Turn the assignment into task-board entries → 4. Summarise through messages and the outcome workflow → 5. Record the session ID and storage location → 6. After resuming, verify state before assigning more work. Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.1. Decide first whether a team is really needed2. Enable teams in the session config3. Turn the assignment into task-board entries4. Summarise through messages and the outcome workflow5. Record the session ID and storage location6. After resuming, verify state before assigning morework

Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.

When to use

  • Sub-agents are enabled with enableSpawnAgent: true, exist only within the session, have a parent-child relationship and share no state. Teams are enabled with enableAgentTeams: true, are restored when the session resumes, coordinate peer to peer and share a task board, mailbox and mission log. The documented conditions for using teams: the task decomposes naturally into independent subtasks, different subtasks suit different system prompts, the session will be resumed over several days, and a persistent record of delegation and completion is wanted.

When not to use

  • The supplied text does not say what happens to tasks that were running when the session was interrupted, so after resuming do not assume they are still running or finished; check with team_list_runs.
  • The SDK call for resuming a session does not appear in the text; only the command-line form cline --id <session-id> does, so a host implementation needs further documentation.
  • The documentation only states that teams add overhead and suit long tasks that split independently; when tasks are tightly coupled and must edit the same files, do not enable a team for form's sake.

Prerequisites and input

  • A long task that can be split, with a written note of whether the parts are independent of one another.
  • A host that uses ClineCore, can change the session config and can store the session ID.
  • A drafted list of team roles, for example a coordinator and teammates with different specialities, each with a defined deliverable.

Engineering checks

Selection layer: team or sub-agent — Sub-agents are enabled with enableSpawnAgent: true, exist only within the session, have a parent-child relationship and share no state. Teams are enabled with enableAgentTeams: true, are restored when the session resumes, coordinate peer to peer and share a task board, mailbox and mission log. The documented conditions for using teams: the task decomposes naturally into independent subtasks, different subtasks suit different system prompts, the session will be resumed over several days, and a persistent record of delegation and completion is wanted.

State layer: what is saved — A team's task board, mailbox, mission log, results and teammates are saved under the session's ID in ~/.cline/data/db/teams.db. Resuming restores the team of that same session, so the host has to remember the session ID itself.

Authority layer: who may do what — The coordinator has team_spawn_teammate; teammates get the same tools except that one, and only the coordinator can shut teammates down or clean up the team. The coordinator decides how to split the work, which teammates to create and how to combine results.

1. Decide first whether a team is really needed

Where: the planning notes made before the session config. Input: the long task description and a draft of roles. Action: check the four documented conditions, namely independent subtasks, different specialisations, resumption over days and a persistent record, and write down whether each is met. Completion check: at least one is clearly met and the reason is written down. Stop condition: if none is met, use a single agent, or a sub-agent with enableSpawnAgent: true when you only need one-off delegation.

2. Enable teams in the session config

Where: the config of cline.start. Input: the task prompt, enableTools: true, enableSpawnAgent: true, enableAgentTeams: true, teamName, plus cwd and workspaceRoot. Action: give the coordinator a system prompt that states its coordinating role; when using the command line, start the prompt with /team. Completion check: the config contains these switches and the team name, matching the planning notes. Stop condition: if the config involves a model provider key, keep it out of planning notes and logs.

3. Turn the assignment into task-board entries

Where: team_task, used by the coordinator, which can create, list, claim, complete and block tasks. Input: each subtask's deliverable, owning role and completion condition. Action: have the coordinator create teammates with team_spawn_teammate, record entries on the board, start work with team_run_task, and watch or cancel runs with team_list_runs, team_await_runs and team_cancel_run. Completion check: every task has an owning role, a deliverable and a completion condition, and their edit scopes do not overlap. Stop condition: if two tasks need to edit the same file, make them sequential or merge them before continuing.

4. Summarise through messages and the outcome workflow

Where: the communication tools of coordinator and teammates. Input: team_send_message, team_broadcast, team_read_mailbox, team_mission_log, and the outcome workflow team_create_outcome, team_attach_outcome_fragment, team_review_outcome_fragment and team_finalize_outcome. Action: teammates attach result fragments to an outcome and the coordinator reviews them before finalising. Completion check: every fragment has a review record before finalisation. Stop condition: if a fragment is blocked or conflicts with another, do not finalise and return to the task board.

5. Record the session ID and storage location

Where: the host's task record. Input: the session ID, the team name and the documented storage location ~/.cline/data/db/teams.db. Action: save the session ID together with the team name; resume from the command line with cline --id <session-id>; the supplied text gives no SDK call for resuming, so look that up separately. Completion check: after reopening the host, the session ID can be found from the record. Stop condition: the documentation describes no procedure for editing that database file by hand, so do not do it.

6. After resuming, verify state before assigning more work

Where: the coordinator session after resuming. Input: team state and the task list you recorded. Action: use team_status to see teammates, team_list_runs for runs, team_list_outcomes for outcomes, and team_read_mailbox and team_mission_log for communication and logs, then compare each item with your own list; cancel runs that no longer make sense with team_cancel_run. Completion check: every task has a status consistent with the record. Stop condition: if state does not match the record, or a situation arises that the documentation does not cover, stop and investigate; only the coordinator calls team_cleanup, and since the documentation does not say whether it removes persisted state, do not use it until outcomes are finalised and confirmed.

Task example

This is an original synthetic walkthrough and nothing was executed. Suppose a team adds an authentication module to an internal service, and the host records the team name auth-sprint. The coordinator splits three tasks: interface design, implementation and tests. Hypothetical expected observation: the task board shows three entries with owning roles, and the implementation task is claimed only after the interface design is complete. The next day the host resumes with the saved session ID, and team_status is expected to show the same teammates while team_list_outcomes shows the fragment attached the day before. If the actual state differs from the record, the host stops assigning work, reads team_mission_log to find the reason, and then decides whether to cancel runs that are still going. All of this is expectation and none of it was performed.

Completion checks

  • Selection check: the reason for using a team meets at least one documented condition and is written down; otherwise use a single agent or a sub-agent.
  • Assignment check: every task has an owning role, deliverable and completion condition, and each outcome fragment has a review record before finalisation.
  • Resume check: the session ID is saved, and after resuming, state read through team_status, team_list_runs, team_list_outcomes and similar tools matches the task list.

Verification scope

Written from the official Cline multi-agent teams documentation, which was read. Installation, login, API execution and output were not tested, and the example above is a synthetic walkthrough that produced no real team results.

Sources

All links are official pages; verification dates are listed per source, and links point to the version checked.

  1. Cline · Cline documentation: cline-teams

Found an error? Tell us →