> ## Documentation Index
> Fetch the complete documentation index at: https://cogno.studio/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Take over a task in your own terminal

> Resume a task's saved agent session in your terminal, or stop a live run to take it over.

A task's **session** is the thing Cogno actually moves around: the agent runs it on
a machine, and you can pick that same session up in your own terminal — history,
plan, and working directory intact. This page shows how to take a task over, and how
to stop a live run to take it over.

Everything here lives on one line at the **foot of the right rail** of the task
detail, labelled **Session**: the machine holding the task on the left, the way
into it on the right. It never hides — picking the work up is always available.

## Prerequisites

* A task whose work is bound to an execution environment — that's the machine and
  directory the CLI runs in. Without one, the terminal controls don't appear.
* The engine the task ran in — **Claude Code** or **Codex** — installed on that
  machine. Cogno offers only the engine the task actually ran in.
* The Cogno desktop app to open a terminal directly. On the web you copy the
  command and run it yourself.

## Read the session line

The **Session** line names who is driving right now.

| What it says                  | What it means                           |
| ----------------------------- | --------------------------------------- |
| **Cogno is driving**          | An agent run is in flight on this task. |
| **You have the session**      | The task is assigned to you.            |
| `<name>` **has the session**  | The task is assigned to that member.    |
| **No one has picked this up** | The task has no assignee.               |

## Open the session in your terminal

<Steps>
  <Step title="Open the task">
    Open the task and find the **Session** line in the right rail.
  </Step>

  <Step title="Select the CLI button">
    In the desktop app, select **Resume in Claude CLI** or **Resume in Codex CLI**.
    When the task has no saved session to resume yet, the same button reads **Open
    in Claude CLI** / **Open in Codex CLI**. Cogno opens your own Terminal — never
    an in-app one — in the task's working directory.
  </Step>

  <Step title="Or copy the command">
    Select **Copy command** to put the command on your clipboard instead, then
    paste it into any terminal. On the web this is the only option. The button
    confirms with **Copied**; if the browser blocks the clipboard you'll see
    **Could not copy to clipboard**.
  </Step>
</Steps>

The command is never printed in the app — it only lands on your clipboard. It
changes directory into the task's bound directory and starts the engine, resuming
the saved session when there is one:

```bash theme={"system"}
cd <task directory> && claude --resume <session id>
cd <task directory> && codex resume <session id>
```

## Cogno tracks the session, so the task stays honest

Opening the terminal — or copying the command — first registers the session with
Cogno. That registration is what keeps the board truthful: **In Progress** holds
only queued or running work, and an open terminal you're driving *is* running work.

Registering the session:

* Moves the task to **In Progress**.
* Records a run with no worker on it — you're the one running it, so no machine
  claims it and no automatic executor picks it up.
* Blocks a second run from starting on the same task while yours is open.

<Note>
  Terminals you open outside Cogno are deliberately not tracked. Only the buttons
  on this line — and **Open in terminal** in the **How should this move forward?**
  dialog — register a session. A task that is already **Done** or **Archived**
  registers nothing; the terminal still opens.
</Note>

## Finish or discard a tracked session

While a tracked session is open, the task rail shows **In progress in a manual
session** with the hint *This task is being driven from a terminal session. Finish
to deliver, or discard to stop tracking it.*

| Button                 | What it does                                                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **Finish and deliver** | Closes the session and delivers it the same way an agent run delivers — the task gets its delivery card and a suggested landing spot. |
| **Discard**            | Stops tracking the session without delivering. Select it twice — the button arms itself with **Click again to discard**.              |

After **Finish and deliver**, when the session can still be resumed, Cogno asks
**Reflect what happened in this session into the description?** — choose **Reflect
it** to have an agent write the session back into the task description, or **Not
now**.

## Take over a run that's already going

Resuming a session that an agent is actively writing would put two agents on the
same task. So while a run is in flight the terminal buttons are replaced by a
single one:

<Steps>
  <Step title="Select Stop & take over in CLI">
    The button arms itself and reads **Click again to stop the run and take over**.
    It disarms on its own after five seconds if you don't confirm.
  </Step>

  <Step title="Confirm">
    Select it again. Cogno stops the running agent — the button reads **Stopping the
    run…** — and waits for the run to actually finish.
  </Step>

  <Step title="Keep working">
    As soon as the run reaches its end, your terminal opens on the same session,
    with its context intact, and the takeover is registered as your session.
  </Step>
</Steps>

<Note>
  Stop-and-take-over needs the desktop app, because it ends by opening your native
  terminal. On the web, the terminal controls reappear once the run finishes.
</Note>

## Pass the session to a teammate

There's no separate hand-off button — reassign the task to them from the assignee
picker on the task. They pick the session up from their own terminal exactly as
described above, and if a run is still in flight they stop and take it over.

## Reference

### Where the terminal controls appear

| Place                                    | Controls                                                                                                                           |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Task rail, **Session** line              | **Resume / Open in Claude CLI** or **… in Codex CLI**, **Copy command**, and **Stop & take over in CLI** while a run is in flight. |
| **How should this move forward?** dialog | **Open in terminal**, shown when the task has a session to resume — the same tracked launch. See [Work with Tasks](/docs/tasks).        |

### When each button shows

| Button                                             | Shows when                                                                                    |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **Resume in Claude CLI** / **Resume in Codex CLI** | No run in flight, and the task has a saved session to resume.                                 |
| **Open in Claude CLI** / **Open in Codex CLI**     | No run in flight, and there's no saved session yet.                                           |
| **Copy command**                                   | No run in flight. On the desktop it's a compact icon button; on the web it carries the label. |
| **Stop & take over in CLI**                        | A run is in flight, in the desktop app.                                                       |

## Troubleshooting

| Symptom                                      | Likely cause                                                        | Fix                                                                                                             |
| -------------------------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| No terminal buttons on the **Session** line. | The task has no bound execution environment or no known engine yet. | Run the task once with a worker so it binds to a machine and an engine — see [Run an agent on a task](/docs/agents). |
| Only **Copy command** appears.               | You're in the browser, not the desktop app.                         | Paste the command into your own terminal, or open the task in the Cogno desktop app.                            |
| Nothing appears while an agent is running.   | Stop-and-take-over is desktop-only.                                 | Open the task in the desktop app, or wait for the run to finish.                                                |
| The command fails with a missing directory.  | The bound directory doesn't exist on this machine.                  | Check the task's execution environment, or run the task once so it rebinds.                                     |

For anything not listed here, see [Troubleshooting](/docs/troubleshooting).

## Related docs

* [Work with Tasks](/docs/tasks) — statuses, the Suggested lane, and moving a task into In Progress.
* [Run an agent on a task](/docs/agents) — hand a task to an agent instead of driving it yourself.
* [Concepts](/docs/concepts) — how the execution layer fits the loop.
