Working with tasks
Sessions and agents
Stage agents in tmux, the Sessions panel and your own Terminal in a task, conversations, permission prompts and taking over a terminal.
The stage agents that work in a terminal (the implementer, the UI implementer and the E2E runner) and the app a task runs live in tmux sessions in the task’s worktree. The sessions belong to tmux, not to the window, so they keep working when you close Lonca and are where they were when you open it again. A task has no agent session of its own: orchestration carries every task, and you reach its agents from the Sessions panel. The panel also holds the task’s Terminal, your own shell in its worktree.
Lonca’s own tmux server
The app brings its own tmux, so you install none, and runs every session on a server of its own, named lonca. It never touches the tmux sessions you run yourself, and yours never show up in Lonca.
tmux -L lonca ls- A session starts in the task’s worktree directory, so the agent works on that task’s branch and nothing else.
- Sessions do not depend on Lonca. Quit the app, or let it crash, and the agents carry on. When Lonca starts again it finds the sessions on its server and shows them in their tasks.
- Terminal output reaches the window through tmux control mode, with flow control.
The Sessions panel
The Sessions panel sits under the task’s tabs, closed until you open it. ⌘J shows and hides it; drag its edge to resize it, or maximise it over the tabs. It stays open or closed as you left it. What runs in it keeps running while it is hidden. Open its session, on a stage agent’s question or on a stage of the Flow tab’s rail, opens it on that agent, and so does picking one in the picker.
A picker across the top of the panel chooses what it shows:
- Terminal
- Your own login shell in the task’s worktree (see below). Every task with a worktree has it, handed off or not; until the worktree is set up it cannot be picked.
- Task Lead
- The task’s conversation with its lead, offered while the leads are set up and ready (see The leads).
- The stage agents
- Planner, UI implementer (only for a task with Figma designs), Implementer, Test scenarios, E2E runner, Final check, Reviewer. Each is marked done, at work or not run yet. A stage agent shows its log on the left and its terminal or conversation on the right.
- Gate, Publish, PR
- The stages Lonca runs itself, with no agent: each shows its log and a summary (what the gate found, what was pushed, the PR as it stands).
The stage agents and the stages show for a handed-off task. Until you pick one, the panel follows the pipeline: it shows the stage agent that started last, or the gate, publish or PR stage while the pipeline is in it, so you watch the work move from the planner to the PR. Before the first stage agent runs, and for a task not handed off, it says No session yet until you pick Terminal. A task whose Terminal you picked shows it again when you come back to the task.
The task’s Terminal
Terminal is your own login shell ($SHELL -l), started in the task’s worktree, so you can run a command on the task’s branch without leaving Lonca. It is a tmux session on Lonca’s server, named <key>-shell.
- It keeps running when Lonca closes. When you come back, it opens again with what it printed. If its shell has exited, Lonca says The terminal closed, and opening it again starts a new shell in the worktree.
- It closes when you archive, delete or remove the task, before the worktree goes.
- It is yours, not an agent's: no list counts it as an agent, and Lonca never types into it.
- It is always a terminal, whatever Agent sessions show as says. Search and the font size buttons work as in any terminal here.
Copy and Run on a suggested command
A task lead or the Workspace Lead that wants you to run a command writes it alone in a bash block. The block has two buttons beside it:
- Copy copies it, exactly as shown.
- Run (its tooltip says, for example, Run in PROJ-123's terminal) types it into that task’s Terminal exactly as shown and presses Enter. The shell runs every line it gets, so a command of more than one line is shown whole first, under Run these lines in the terminal?, and runs only when you press Run there.
A task lead’s command runs in its own task’s Terminal; the Workspace Lead’s in the selected task’s, and in the Orchestration view in the task the view was opened on, which then comes back on screen with its Terminal picked. Where there is no such task, or it has no worktree yet, the block offers Copy only. A command with a hidden character is not run: copy it to look at it.
Neither lead sees what the command prints. When it needs the result, it asks you to paste the output into the conversation.
A question card offers the same Run on a shell block in the question's own words and under Technical details, in the card's task Terminal. A block in the evidence the card keeps in view, and any block in a stage agent's terminal prompt, quotes what an agent ran or asks leave to run: it has Copy only, so a click never stands in for your answer.
Terminal and conversation
A session can be read in two ways:
- Terminal: the agent’s own screen.
- Conversation: its transcript, drawn as messages and tool calls, with a message box.
Settings → Appearance → Agent sessions show as sets the view for every session that has both. Such a session also shows the same Terminal / Conversation switch above it, and changing it there changes the setting.
| Session | Shows as |
|---|---|
| A stage agent with a terminal (implementer, UI implementer, E2E runner) | Either, as you choose |
| A stage agent without a terminal (planner, test scenarios, final check, reviewer) | Always a conversation |
| The task lead and the Workspace Lead | Always a conversation: they have no terminal |
| The task’s Terminal (your shell) | Always a terminal |
A Codex stage agent's conversation, its activity and its line in the stage log are read from Codex's own session record (its rollout, under $CODEX_HOME/sessions or ~/.codex/sessions), read and never written; a headless Codex run's come from its codex exec --json output. What Codex adds itself (its instructions, AGENTS.md, its environment) and its reasoning are left out.
In the terminal
- ⌘F opens Search in the terminal. Enter finds the next match, ⇧Enter the previous, Esc closes the bar. Ctrl F is left to the program in the terminal.
- The A− and A+ buttons change the font size; Settings → Appearance → Terminal font size is the same setting.
Message boxes
Every box where you write to an agent works the same way: a lead's conversation, a stage agent's, a question card's answer, every Configurator box (its message box, its answers to questions, and the forms of Set up a repository and Set up authentication), and a new local story's description and Draft with AI idea.
- Paste an image (PNG, JPEG, GIF or WebP, up to 10 MB): the box shows
[Image #1]and a thumbnail, and the agent gets the image's path and opens it. Deleting[Image #1]from the text takes its thumbnail away too, and an image no longer named in the text is not sent. - Attach files with the paperclip beside the box, or drop them on it. An image is kept as a pasted one is. Any other file shows under the box by its name, with a button to take it out, and the box shows
[File #1]: Lonca copies it, up to 10 MB, where the agent can read it. - Images and files are kept owner-only beside the task's documents (or the lead's, or the Configurator's folder), and only the newest 200 there. A story's description and idea copy nothing: they take the file's own path.
Working, idle, awaiting action
A badge above a stage agent’s terminal says what it is doing:
- working
- The agent is in a turn.
- idle
- The turn is over.
- awaiting action
- Claude Code waits for a permission or an answer. The badge turns yellow.
- unknown
- Lonca cannot tell.
With status: hook, the agent reports its own state through the hooks Lonca gives it ({{hooks}}). Without hooks, Lonca estimates from the screen, and the badge adds (a guess). A screen cannot tell thinking from waiting for permission, so awaiting action comes from Claude Code’s hooks only. For Codex, Lonca shows working and idle.
A stage agent that waits for input in its terminal becomes the pipeline’s question. The task lead may settle it first; when it comes to you, the row sits under Needs you with ›_ in an orange stage ring, and the question card on Flow relays your answer, or opens the terminal for you (see Autonomy and decisions).
Attaching from another terminal
The sessions are ordinary tmux sessions on the lonca server, so you can attach to one from iTerm or any terminal. While another client is attached, the status row shows another client attached: tmux shrinks the window to the smallest client, so the view in Lonca may be cropped. Lonca never closes a stage agent’s terminal that is attached from another terminal.
A stage agent’s session
While Lonca drives a stage agent’s terminal, you can watch and scroll it (the wheel, Page Up, Page Down) but not type. A badge says who has it: Lonca drives or You have it.
- Take over pauses the task, as Pause… does, and gives you the terminal: the task moves to Needs you with ›_ in its stage ring and Flow shows the paused card. Type to the agent as you would in a terminal of your own. While its step is still open, the terminal's status row says Paused: you have the terminal.
- Hand back resumes the task, and Lonca drives the terminal again. Under Pause all, resume with Resume all first. While either one is under way, the button and the badge say Taking over… or Handing back….
- A stage agent without a terminal shows its run as a conversation with a message box; what you write there reaches its next run. See The hand-off brief.
- The implementer's terminal stays open through the task's rounds, so work sent back from testing or review continues the same conversation. Every other run starts fresh from the brief, the hand-off between stages and the logs. Either way the work is in the branch and the task's documents: stopping a terminal loses nothing, and the next step that needs the agent opens a fresh session.
While a step runs, its terminal has no stop button; the status row says Lonca is running this step instead. To hold the work, pause the task (see Pausing a task). Once the step is over, Stop the session closes the terminal.
Finished sessions are closed
So that a pipeline does not keep Claude Code, MCP and dev-server processes it no longer uses, Lonca closes them as the work moves on: a stage agent's terminal once the pipeline has passed its step (the implementer's only once the task reaches the pre-PR gate), everything once the PR is merged, and the app it started for testing once testing is over. It looks every half minute.
- It closes no terminal while a question waits or the task is paused or queued. The app it started for testing goes once testing is over even then: it holds one of the repository's ports.
- It never closes a terminal that is working, waiting for a permission, or attached from another terminal, except a stage agent the task has moved past (below). An app you started stays up.
- What a closed terminal spent still counts in the usage figures.
- Settings → Orchestration → Close finished sessions turns this off; the terminals then stay open until you close them, or the task is archived or deleted.
A stage agent moved off its step
A terminal stage agent goes on by itself until it is stopped. So when a task moves off its step, and again before it publishes, Lonca sends every open terminal stage agent of the task Escape, checks that it stopped, and sends a second one if not. One still at work after that is closed, whatever Close finished sessions says, and the task's decisions record it. Before publishing, one that cannot be closed either stops the publish with an environment question.
An agent session from before 11.0.0
Before 11.0.0 a task could have an agent session of your own. One still running at the update is not killed, since you may be in the middle of something: it keeps running in tmux, but no list shows it. While it is open, its task carries one notification that names it:
tmux -L lonca attach -t <name>It closes when you archive or delete the task, or with tmux -L lonca kill-session -t <name>, and the notification goes with it. Close finished sessions does not close it. While it is working, a hand-off of the task is refused; while it is open and idle, the hand-off goes ahead and says to leave it idle.
Folder trust
A stage agent cannot answer a CLI's “trust this folder?” question, so trust each repository once yourself; its worktrees then inherit the trust:
- Claude Code:
cdinto the repository, runclaude, choose “Yes, I trust this folder” and quit with/exit. - Codex:
cdinto the repository, runcodex, choose “Trust and continue”.
When a repository is not trusted yet, the hand-off goes ahead and the task's notice says what to run; the stage agent's terminal then refuses to open, saying the same, until you have (see Stage agents).
The extra folders a stage agent reads, such as the task's own folder under ~/.lonca/issues, need nothing from you. Claude Code asks about each of them too, so Lonca trusts them along with the worktree of a repository you trust; it never trusts your home folder or a folder above it. Codex does not ask about them.