Skip to content

Scripts and agents

Besides opening the window, the cornercase command drives the server that is already running. A script can open a tab and run the tests in it, a git hook can leave a note, and a coding agent in one tab can start others in their own worktrees, wait until they finish or need an answer, read what they wrote and send them the next step, or follow all of them at once as things happen.

Terminal window
pane=$(cornercase new-tab --name tests -- cargo test)
cornercase wait --pane "$pane" --until shell --timeout 900
cornercase read --pane "$pane" --lines 40

These commands never start a server, except start-server. Without one, they say no cornercase server is running and exit with status 1.

A server waits for its first window before it restores your session, and until then commands that open terminals refuse. A script, a cron job or another UI that never opens a window starts the server with start-server first:

Terminal window
cornercase start-server
pane=$(cornercase start claude --prompt "fix the failing test" --worktree fix/test)

It starts the server if none runs, restores the saved session once (or opens the folder you ran it from), and returns once its terminals exist; run again, it does nothing and says the server is already running. Until a window attaches, terminals are 160×48, or --cols and --rows. A window that attaches later finds the same tabs, with the same ids, takes over the size and gives the terminals its colours, unless you gave them with --theme FILE. See Command line for its output.

--remote DESTINATION, or CORNERCASE_REMOTE=DESTINATION, sends any of these commands to the server of another machine through your own ssh, as cornercase remote attaches the window:

Terminal window
cornercase --remote devbox status --json
cornercase --remote devbox events --notices --host --json

Arguments and standard input arrive as they are, a stream ends there when the command ends here, and only start-server starts a server. See Commands for scripts and agents for what it needs and which commands refuse it. When that machine’s cornercase is older than yours, every command that sends a request refuses with status 5 (update, restart, kill-server, logs and the plugin commands that work on its files run there without checking) and says how to update it from here; with --json it also prints that as JSON.

cornercase status lists every project, workspace, tab and pane with its id:

project 1 web-shop ~/code/web-shop (shown)
workspace 2 main ~/code/web-shop branch main (shown)
tab 3 claude working (shown)
pane 4 claude working Opus 5.5 · 23% ~/code/web-shop (shown)
tab 6 zsh
pane 5 zsh ~/code/web-shop (you)
tab 14 claude working
pane 13 claude working Opus 5.5 · 4% ~/code/web-shop (parent 5)
workspace 7 fix/login ~/.cornercase/worktrees/web-shop/fix-login branch fix/login worktree
group 9 personal collapsed
project 10 blog ~/code/blog
  • Ids come from one counter and last as long as the server runs: after a restart, the same tabs get new ids. Take them from status, or from what a command printed. Every command that takes an id, such as close, send, read or events, can say which run of the server the id is from, with --boot, which lists them.
  • Every pane’s shell has CORNERCASE_PANE set to its id. Inside a pane, commands act on that pane, its tab, workspace and project unless you name another one; (you) marks it in status. Run from anywhere else, they act on what the window shows, marked (shown).
  • A pane opened by start, new-tab, split or setup run inside another pane remembers that pane as its parent, marked (parent 5) in status (and (collapsed) while the agent in it has its children collapsed in the agents section): an agent that starts others finds them as its children, and the agents section lists them under it. A flow’s members have its orchestrator as parent, and (role coder) in status says which role each plays. Run from anywhere else, the new pane has none. The mark goes once the parent pane closes or the agent that ran the command is no longer there; for a pane started from a plain shell, it holds while no agent runs in that shell, and until the server restarts. A flow’s members keep their orchestrator’s pane.
  • Where a command takes --workspace ID, --worktree BRANCH names the workspace on that branch instead, looked up in the same project: the one the command runs in, else the shown one. cornercase start claude --worktree fix/login made it, so cornercase close --worktree fix/login --remove-worktree can take it down without reading its id from status. A branch that no workspace there is on, or that several are on (a workspace without a worktree of its own shares its project’s branch), exits with status 2 and lists the workspaces to pick from.
  • The pane is what send, keys, read and wait work on. Where they take --tab ID, it stands for the tab’s agent pane, or its active pane when no agent runs in it.
  • Nothing changes what the window shows except focus, go and the --focus option. Whoever is looking at the window keeps seeing what they were looking at while a script opens tabs next to them. With --view ID they move that view instead, and the window stays where it is.
  • With --view ID, the defaults are what that view shows: its project, workspace, tab and that tab’s active pane, even inside a pane.
Command What it does
status Lists groups, projects, workspaces, tabs and panes with their ids, or one line per pane with --panes; --follow keeps printing the whole state as it changes.
open PATH Opens a folder as a project, or finds the open one. Prints the project’s id. A path starting with ~/ is in the server’s home folder. A .code-workspace file is imported as a group, and it prints the group’s id.
clone URL [FOLDER] Clones a git repository into a new folder inside FOLDER and opens it as a project: see Clone a repository. Prints the clone’s path. --file copies files of the repository here into it.
new-workspace NAME Adds a workspace to a project, or a git worktree with --worktree. Prints its id.
new-tab Opens a tab, optionally typing a command into it. Prints the pane’s id.
split Splits a pane right, or down, optionally typing a command. Prints the new pane’s id.
setup Runs a worktree’s setup again in a new tab, as run setup in its menu does. Prints the pane’s id once it is done.
start [AGENT] Starts a coding agent in a new tab and gives it a prompt, or with --issue the issue’s, followed by your own --prompt when you give one. Prints the pane’s id.
issue sources, issue list, issue read KEY, issue people SOURCE Read the issue trackers through the server: which are connected, their lists with the Issues dialog’s filters (searched, a page at a time, or every project at once), an issue with its comments, and whom the filters can name.
flow list, flow run NAME, flow export NAME, flow import SOURCE, flow save FILE, flow delete NAME, flow hide NAME, flow restore NAME, flow default NAME, flow order NAME…, flow close-when-merged, flow account, flow sync Lists the flows, starts one (a team of agents in a worktree, run by an orchestrator agent), prints one as text to share, adds one someone shared, saves one given as JSON, deletes one of yours or the project’s, deletes a built-in flow and brings it back, chooses the flow the start dialog opens on and the order of the list, turns on closing a run’s agents, and freeing their builds, once its pull request merges, moves a running team to another account, or sends your flows, or one of them, to your machines.
persona import SOURCE, persona list, persona new, persona edit ID, persona show ID, persona remove ID Imports personas (how an agent works, given to a flow’s roles) from a file, a folder, an address or a GitHub repository, lists yours, writes one of your own from a name and its instructions, changes one, prints one, or deletes one. --check previews an import and saves nothing, --catalogue lists a source’s personas by division with why each one cannot be imported, --only ID imports only those ids, --replace overwrites the ones you have, and --json prints the requests’ answers (persona-import, persona-list, persona-save, persona-show, persona-remove).
flow runs, flow messages, flow files Where each running flow stands, what its roles sent each other, and the files of its folder: see Follow a flow run.
files list, files read, files search The files panel’s folders, files and search, with git’s marks: see Browse and read a workspace’s files.
send [TEXT] Pastes text into a pane, and presses Enter with --enter.
keys KEY… Presses keys in a pane.
held Does what the two buttons of a pane’s bar do to a message send holds, --send-now or --wait-turn, for a program that draws that bar itself.
search TEXT Finds the panes where some text was said: in the agents’ prompts and replies and in every pane’s history.
read Prints a pane’s screen, its last lines, the last messages of one or several agents, an agent’s conversation, or what they wait for you to answer.
wait Waits until an agent stops working, a program ends, a line shows up or the output stops, in one pane or in the first or every one of several.
events Prints what happens as it happens: agents changing state, agents’ last messages changing, programs ending, panes, tabs, workspaces and projects opening and closing, with --host programs’ clipboard writes and bells, and with --notices the notices about agents.
surface Streams a tab’s terminals as cells with their panes and dividers, for a program that draws them, optionally as patches.
changes Lists, reads, marks, stages and discards the changes of a workspace, as the changes panel shows them, for a program that draws it.
view Opens a view of your own: its own tab and size, for a program that draws cornercase itself.
view-set Changes a view: its size, whether it is active, takes back the tab it shows or stops sizing it, or says which bot’s chat it shows.
input --pane ID EVENT… Types keys with modifiers, text, pastes and mouse events into a pane, or with --follow each line of standard input as it arrives, for a program that draws it.
scroll, selection, ratio, resize, link Scroll a pane’s view, select or copy text in it, move a divider of a tab’s split, lay a surface stream out at another size, or say which file a click on a cell opens, all for a program that draws the terminals.
redraw Sends a surface stream a complete line now, for a program that applies patches.
close Closes a pane, tab, workspace or project, or an agent with all it started (--agent); --check says first what removing a worktree, or closing an agent, would lose.
agents close, agents reopen, agents forget Close a workspace’s agents and reopen them later, each in its own conversation.
group, move, collapse, expand, move-pane Arrange the sidebar and the panes: create, style and delete groups, move rows, fold them, swap or move panes of a tab.
rename NAME Renames a tab, workspace, project or group.
focus Shows a pane, tab, workspace or project in the window, or with --machine picks a machine’s workspace or tab as the one shown (the window shows a card for it), or with --bot shows a bot’s chat.
go TOKEN Goes to the agent a notice is about, as a click on its desktop notification does, in the window or with --view in a view.
notify TEXT Shows a message in the window, with a desktop notification.
todo Adds, lists, edits, checks off and back, reorders and removes items of the TODO list (with undo), and sends one to an agent as send --enter would.
worktrees list, worktrees size, worktrees free-builds, worktrees remove List every worktree on disk with what makes it safe to remove and its size (and the builds of the merged ones added up), measure one, delete its git-ignored build folders, keeping the worktree, of one or of every merged worktree, and remove worktrees and their branches as the Worktrees dialog does: worktrees.
config Reads every setting, connection and project’s commands, and changes them with the Settings dialog’s own checks: settings for a program that draws its own preferences.
config models AGENT Lists every model the flow editor offers for an agent, opencode’s own list included: an agent’s models.
config pair KEY Gives a program that draws cornercase itself what the window’s pairing dialog shows, the address its QR code holds and the lines under it, and waits for the phone. KEY is app, browsers, telegram.chat or discord.chat; --routes prints the addresses the phone app reaches now: pair a phone.
config export, config import FILE Writes the settings to hand to a colleague, without tokens or personal ones, and imports such a file after showing what it changes. --preview prints that preview and exits 0 without importing: share your setup.
config forum-server ID Picks the server of the Discord forum when the app is in several of yours, as a click in its dialog does: pick the forum’s server.
machines Lists the other computers your work can run on with the state of each link, and adds, changes, hides, shows, removes, updates and retries them: machines.
away Has agents message you on Telegram or Discord; --off stops it.
usage Prints your Claude Code and Codex plan limits as the Usage dialog’s Limits tab shows them; --cached prints the last answer without asking the agents again, and --machine NAME or --machine all asks your machines.
plugin install SOURCE --preview, plugin update ID --preview Fetch a plugin and print what installing or updating it would run, without installing; --json is for a program that asks the user itself, and --commit then installs exactly that commit. See Plugins.
plugin status Prints the plugins as Settings › Plugins shows them, including whether each service is running, restarting or starting, and why plugins.json cannot be read. --json is the plugin-list answer. See Plugins.
paste-file --pane ID [FILE] Keeps a file of the machine you run it on next to the server’s session and pastes its path into a pane, so an agent there can open it: see Paste a file from another machine.
paste-file --undo --pane ID PATH Takes back a file you pasted, while it is still the last thing in the pane’s input: erases it there and removes its copy. See Paste a file from another machine.
plugin actions, plugin run PLUGIN ACTION, plugin popup-close List the actions your plugins add to the menus and buttons, run one on a project, workspace, tab or pane as its menu entry does (or on what the window or a view shows, as its button does), waiting for it to end, and close a plugin’s popup. See Plugins.
skill Prints the instructions that teach coding agents these commands.
pull-request Prints a workspace’s pull request and every check with the link to its job, as its dialog shows it, asking gh (or glab) at once: pull requests.
contract Says what the running server supports: its version, the contract it speaks, its boot and its operations and streams.

cornercase --help and cornercase COMMAND --help describe every option, with examples.

Terminal window
cornercase status # the tree above
cornercase status --json # the same, as JSON
cornercase status --panes # one line per pane, for scripts
cornercase status --panes --json # the same, as JSON
cornercase status --follow # the whole state as JSON, again after each change
cornercase status --app # the TODO list, queue, away, update and keep awake as JSON
cornercase status --app --follow # the same, again after each change

Each pane shows its program and folder. Recognised agents that emit OSC 7501 show their reported status, including when no session reader exists. A pane running Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI or GitHub Copilot CLI also shows what the agent is doing (working, waiting for an answer, pending review, done while you were elsewhere, failed, idle; a Claude Code turn that ended on an API error is failed, and send takes the next prompt; without OSC 7501, opencode is never waiting), its model and how full its context is, as the tab icons do. working (background shell) is a Claude Code agent whose turn is over while a shell it started in the background (a test watcher, a dev server) still runs: its tab keeps showing it as working, since Claude wakes up when that shell ends, but a script can tell it apart and stop waiting with --until turn-over. working (2 subagents) is an agent whose own turn is over while subagents it started (Claude Code, GitHub Copilot CLI) still run: it goes on when they report back, so it stays working, and the default, --until idle and --until turn-over waits keep waiting for them. (dialog open) is a Claude Code agent showing something else where its input box should be (a picker, the transcript view, a background shell’s details, its ! shell mode), which send refuses. (survey open) is Claude Code’s feedback survey above its input box, which send refuses too. Opus 5.5 · compacted is an agent whose conversation was just compacted: its context is empty until its next reply, which brings it back (compacted in the JSON). A workspace shows its branch, worktree when it has one of its own, the commits it is behind, and its pull request with the state of its checks, such as pull request #485 open, checks failing, or pull request #486 open, conflicts with main, checks passing when it has merge conflicts. A pull request in a GitHub stack adds its layer, pull request #483 open, checks pending, layer 2 of 2 of stack #484 on main. On GitLab it reads merge request !486 open, conflicts with main, pipeline passing.

A script that coordinates agents mostly needs the panes: which agent runs where, what it is doing, in which worktree. status --panes lists them flat, so nothing has to walk the tree: one line per pane, in the order of the sidebar, under a header line that names the columns, separated by tabs.

pane tab workspace project program agent status background_shell dialog at_prompt model context caller shown active tab_name workspace_name branch worktree project_name path survey resuming parent subagents role held_sends draft account_restart pid memory compacted since
4 3 2 1 claude claude working false false false Opus 5.5 23 false true true claude main main false web-shop /home/ana/code/web-shop false false - 2 - 1 true - 48213 - false 2026-11-28T10:41:17.508Z
5 6 2 1 zsh - - false false true - - true false true zsh main main false web-shop /home/ana/code/web-shop false false - 0 - 0 false - 48190 - false -
12 11 7 1 codex codex waiting false false false gpt-5.4 41 false false true codex fix/login fix/login true web-shop /home/ana/.cornercase/worktrees/web-shop/fix-login false false 5 0 - 0 false - 51377 - false 2026-11-28T10:46:03.123Z
Column What it holds
pane, tab, workspace, project The ids of the pane and of the tab, workspace and project it is in.
program The program in the foreground, as the tab names it.
agent claude, codex, gemini or opencode when one runs in the pane.
status What the agent is doing: working, waiting, pending, done, failed or idle.
background_shell, dialog, at_prompt As in the JSON: the agent’s turn is over but a background shell still runs; a Claude Code agent shows a dialog instead of its input box; the shell sits at its prompt with nothing running.
model, context The agent’s model and how full its context is, in percent.
caller true for the pane running the command.
shown true for the pane the window shows.
active true for its tab’s active pane.
tab_name, workspace_name, branch, worktree, project_name The tab’s and workspace’s names, the workspace’s branch and whether it has a worktree of its own, and the project’s name.
path The folder of the program in the foreground, in full.
survey As in the JSON: a Claude Code agent shows its feedback survey above its input box, which send refuses until keys --pane … 0 dismisses it.
resuming As in the JSON: the pane’s agent is coming back in its conversation after a restart, and takes no input until it is back.
parent The id of the pane this one was started from, while that pane is open and still runs what started it (an agent, or a shell running no agent): start, new-tab, split or setup run inside it. A flow’s members have their orchestrator’s pane, whatever runs there.
subagents How many subagents the pane’s agent started that still run (Claude Code, GitHub Copilot CLI), 0 otherwise. While it is above 0, subagents keep an otherwise idle (or background-shell) agent’s status at working, even when its own turn is over; a question (waiting) and an OSC 7501 report still take precedence, so scripts must still handle the reported status.
role The role the pane plays in a flow run (orchestrator, coder…) while the run lives, - otherwise.
held_sends, draft As in the JSON: how many messages send is holding for this pane, and whether someone is typing a draft in it.
account_restart As in the JSON: waiting while the pane’s agent waits for its turn to restart on another account, - otherwise.
pid The process id of the pane’s shell, not of the program running in it; - when it is not known.
memory As in the JSON: the memory the pane’s shell and the programs under it use, in bytes, while memory is on, - otherwise.
compacted true while the agent’s context is empty because its conversation was just compacted (/compact, /compress, or its own automatic compaction), until its next reply sets it again; false otherwise.
since As in the JSON: when the agent took its status, in UTC, such as 2026-11-28T10:46:03.123Z; - where there is no status. The last column.
  • The values are the ones --panes --json gives: true or false, numbers without a unit, full paths. A - stands where there is no value (no agent, no branch, a field the server is too old to know), so a column never goes missing and read keeps them in place. A tab or a line break in a name shows as a space.
  • The columns keep their order, and new ones only ever go at the end, so $7 stays the status.
  • --panes --json prints {"panes": [...]}, one object per pane with the columns as keys, in the same order, and null where the text shows -.
Terminal window
# the agents that wait for an answer
cornercase status --panes | awk -F'\t' '$7 == "waiting" { print $1 }'
# each pane with its agent and status, skipping the header
cornercase status --panes | tail -n +2 | while IFS=$'\t' read -r pane tab workspace project program agent status rest; do
echo "$pane $agent $status"
done
# the agents in the worktree of fix/login
cornercase status --panes --json | jq '.panes[] | select(.branch == "fix/login" and .agent != null) | .pane'

Another UI for cornercase, or a script that draws the sidebar somewhere else, needs the whole session and every change to it: names, order, groups, folds and how each tab is split. status --follow prints it as one JSON line, first as it is now, then again shortly after each time something in it changes:

Terminal window
cornercase status --follow | jq -c '[.revision, (.projects | length)]'
cornercase status --follow | while read -r state; do echo "$state" > /tmp/cornercase-state.json; done
  • Each line is what status --json prints, plus revision, a number that grows with every line, except caller, which is always null: find your own pane with CORNERCASE_PANE or status --json instead. It is always JSON, with --json or without, and it can’t be combined with --panes.
  • Each line is the whole state and replaces the one before: there are no differences to apply, so a reader can skip lines and lose nothing but the steps in between.
  • revision only compares within one boot, the start of the server it came from. It ends, with status 0, when the server stops or restarts, or once whatever reads it is gone; to go on, run it again: its first line is the state at that moment, so nothing is missed. The same goes for a connection that ended (status 1).
  • A change a command makes when no line went out in the last half second comes at once (not for input, scroll, selection and the other requests that come at a pointer’s pace, which wait their turn), and the changes that follow within that half second come together in the next line, not one line for each. Output alone (a program printing in a pane) gives none, but what status --json shows moves too, such as an agent’s status, its context or a pane’s folder, and each of those gives a line, so a working agent can bring one every few seconds.
  • A reader that falls behind isn’t disconnected for it: the server keeps up to four lines waiting for it, which it still reads, older ones first; past those it keeps only the latest, so once it has read them it reads the state as it is now, with a jump in revision. One that stops reading altogether is disconnected once the server has waited a second to write to it, like any client.

The changes panel’s data is there for another UI too: the changed files with their status and counts, each file’s diff with the words that changed and its highlighting, the unchanged lines between two hunks, the branch it compares with and the files you marked as viewed.

Terminal window
cornercase changes list # the workspace you are in, uncommitted
cornercase changes list --every --follow # every project's uncommitted changes, as JSON lines
cornercase changes list --worktree fix/login --mode commits --json
cornercase changes file src/main.rs --json # one file's diff
cornercase changes gap src/main.rs --hunk 1 # the unchanged lines before its second hunk
cornercase changes base origin/main # compare Commits and All with another branch
cornercase changes viewed src/main.rs # mark it viewed; --clear clears it
cornercase changes stage src/main.rs # put its changes in git's index, as git add does
cornercase changes unstage src/main.rs # take them out of the index; the file keeps them
cornercase changes discard src/main.rs # put it back as in the last commit; asks first, --yes for scripts
cornercase changes discard src/main.rs --digest 550a7a517a389403 --yes # only the version you saw
cornercase changes shared # the files other workspaces of the project change too (shared_files on)
cornercase changes merge-check # merge it into its base and with those workspaces, in a scratch copy
cornercase changes merge-check --with 12 --json # only the merge with workspace 12
  • changes (cornercase changes list --follow) is a stream, one per connection. It answers a first summary at once, which may say "state": "loading" while git reads, then sends a whole new one each time the files change, with a higher revision; a line is only sent when its content differs from the last. Each summary replaces the one before it, and a reader that falls behind reads the latest, as with status --follow.
  • A summary has boot, stream (its number, for changes-mode), revision, scope (project or every), mode (uncommitted, commits or all), state (loading, ready or failed, with error) and workspaces: each with project, workspace, base (what Commits and All compare with, null in Uncommitted), added, removed and files. A file has path, old_path (for a rename), status (modified, added, deleted, renamed or untracked), added, removed, fold (open, lockfile, binary or large: lockfiles show their lines, binary and large files have none), viewed, staged (no, partly or yes: how much of the file is in git’s index; only in Uncommitted and Every project, left out in Commits and All) and digest. Summaries have ids only; the names are in status.
  • A project stream has one workspace entry, with no files when there are none. An Every project stream (--every, only for Uncommitted) has one entry per workspace with changes, in the sidebar’s order, and never ends by itself. A project stream ends when its workspace or project closes. A workspace nobody follows costs nothing more than the rows’ count: git runs only for what a stream or the window shows, and for the rows a window or a visible view draws (see against_base below).
  • The mode belongs to the stream: changes-mode changes a running stream’s mode, and the window’s tabs don’t move. It only reaches a stream the same connection opened, so it is a request for a program holding the stream’s connection open over the socket: a separate command invocation uses a new connection and gets not-found, which is why cornercase changes has no command for it (start another changes list --mode … instead). A second changes on one connection is refused with conflict. The base and the viewed marks are shared with the window: choosing a base here changes what its panel compares with, and a mark set here shows as its ✓.
  • changes-file answers a file’s hunks: old_start, new_start, context and lines, each with kind (context, removed or added), old and new numbers (null where the line is not on that side), text (what a window draws, tabs as four spaces), raw (the line as it is in the file, tabs included, left out when it would be the same as text), emphasis (the words that changed, as [start, end) pairs in characters of text) and syntax (runs of style and text, left out where the line isn’t highlighted). styles is the table the runs point into, in the same shape as a surface’s: palette indices, never RGB, so the client’s own theme and tints apply; entry 0 is plain. To copy a line as the file has it, take its raw, or its text when it has none: a tab of raw is always four characters of text, so a selection made in text maps back to raw. cornercase changes file Makefile --json | jq -r '.hunks[].lines[] | .raw // .text' prints the lines with their tabs.
  • changes-gap answers lines with their old and new numbers, text, raw and syntax, as in changes-file, for the lines between hunk hunk and the one before it (hunk is the index in changes-file’s hunks, counted from 0, so hunk 0 has no gap). changes-base without arguments lists branches, the default branch and the current base; with base it sets it (the default branch goes back to following the default) and with clear it clears it. changes-viewed sets a mark with the file’s digest, or clears it with clear: a mark set with the digest of a version the file no longer has does not apply, as when the file changes under the window’s mark.
  • changes-discard takes the file’s path and the Uncommitted digest you saw, and throws its changes away: the file goes back to the last commit, and one that git doesn’t track or that was added since is deleted. It is refused with conflict if the file changed since that digest, and not-found if the file has no change. It answers workspace, path, old_path and status. The window shows no message. One sent while another runs in the same repository can fail on git’s index lock.
  • changes-stage takes the file’s path and the Uncommitted digest you saw, and puts its changes in git’s index, as git add does; with staged set to false it takes them out instead (staged is true when left out). The file keeps its changes either way. It is refused with conflict if the file changed since that digest, and not-found if the file has no change. It answers workspace, path, old_path, status and staged. The window shows no message. One sent while another git runs in the same repository can fail on git’s index lock.
  • changes-merge-check merges a workspace’s work, committed or not, in a scratch copy with git merge-tree (git 2.38 or later) and answers workspace and checks, one per merge: with (a workspace) or base (a branch) for what it was merged with, clean, conflicts (path, kind such as contents, modify/delete or add/add, and git’s message), left_out (untracked files over 1 MiB, or past 8 MiB in all, which the check left out) and error (clean is false when it is set). Without arguments it checks the workspace’s base branch (the one the changes panel compares with) and each workspace that shares files with it; with checks only that workspace of the same project, base only that branch, and the two together are malformed. An unknown branch is that entry’s error, not a refusal; a workspace outside a git repository, a with in another project and a with in the same folder are conflict. No checkout, index, branch or object of the repository changes. cornercase changes merge-check prints into main merges cleanly, or with workspace 12 feat/dark-mode 1 conflict and a line for each conflicting file, and exits with status 3 when any check has an error (conflicts are an answer, not a failure); --json prints the answer. cornercase changes shared prints the files the workspace shares with each other workspace, or {"workspace": 11, "shared": [...]} with --json; it reads status, where each workspace has shared (see the table below).
  • cornercase changes viewed, stage, unstage and discard read the file’s digest just before they act, so they act on the version there at that moment, but only when --digest is absent. A UI that showed a diff passes the digest it showed with --digest, and the command then reads nothing and sends that one (discard without --yes still reads the file, only to form its confirmation question, and asks first). A file that changed since is left alone: stage, unstage and discard fail with the conflict message, and viewed sets a mark that only applies to the version seen. For stage, unstage and discard it is the Uncommitted digest (Every project’s is the same); one from --mode commits or all is refused as changed.
  • digest is a string of 16 hexadecimal digits that changes whenever the file’s change does. status --json also gives each workspace changes (files, added, removed and mode), for a badge like the button’s, while cornercase keeps it current: the window’s workspace, one a stream follows, or any while a stream follows every project; it is left out otherwise.

The files panel’s tree, viewer and search are there for another UI too, which matters when that UI runs on another machine than the server (see Another machine): it can’t read that disk itself, and copying the panel’s rules (what git ignores, the size limits, what is an image or a binary) would drift from them.

Terminal window
cornercase files list --workspace 3 --json # the workspace's root: name, kind, size, modified, hidden, git status
cornercase files list src docs --workspace 3 --json # several folders in one answer
cornercase files list '~/code' --json # any folder on the server's machine
cornercase files list src --workspace 3 --follow # a JSON line again whenever the folders change
cornercase files read src/main.rs --workspace 3 --json # text, an image as base64, or what else it is
cornercase files read notes.txt # the text, as it is
cornercase files search parse --text --workspace 3 --json # the lines that match; --names searches file names
  • Paths are relative to the workspace (the one you are in, or --workspace or --worktree), never to the folder the command runs in. An absolute path, or one starting with ~/ (the server’s home folder), reaches any folder on the server’s machine and needs no workspace; git’s marks only show for what is inside the workspace. A path is echoed as you wrote it (path) and in full (dir, file).
  • files list answers workspace and folders, one entry per folder you asked for (the root with none): path, dir, entries, more (true when entries were left out: at most 10,000 per folder) and error (null, or why it could not be listed: no such folder, not a folder, permission denied; the other folders still answer, and the command exits with 3). An entry has name, kind (file, folder or other: a device, a pipe, a socket or a link to nothing), link, hidden, bytes (files only), modified (UTC) and status (modified, added, deleted, renamed, untracked or null: what is not committed yet, as the tree marks it; a folder is added when everything in it is new and modified when it holds changes). Entries come in the tree’s order, folders first. What git ignores and .git are left out, and hidden files are listed: hide them yourself with hidden. The text output is a table with a header line, . for the root and - for nothing.
  • files read answers path, file, kind, bytes, modified, language, text and image. kind is text (the whole file, up to 8 MB, with the language the viewer highlights it with), image (told by its first bytes, up to 32 MB: image has format, width, height and data, the file in base64), binary, too-large (with its bytes; nothing of it is sent), folder or missing. Only regular files are read, so a link to a device answers binary. A 32 MB image is about 43 MB of base64, in one line. The text output is the file as it is, or one line saying what it is; a folder or a missing file exits with 1.
  • files search answers the panel’s search, in the workspace only. With --names (the panel’s name mode), names: the best 200 files, ranked, smart-cased, each with path and indices, the characters of the path that matched. By text (the default), files: each with path and lines (number, text and ranges, [start, end) pairs in characters of the text), at most 1,000 matches in all. Both have workspace, query, mode, matches and capped. The text output is one path per line for names, and path:line:text for text, as grep -n prints it. It walks the files fresh each time and stops when your command goes away.
  • --follow on list and read keeps running and prints a JSON line each time what it shows changes: folders are listed again every 2 seconds and a file is checked every second, next to the disk, so a client on another machine doesn’t poll through ssh. The first line is the answer as it is now, with boot, stream, revision (counting from 1) and the same fields as above; each line replaces the one before, and a reader that falls behind reads the latest. A line is only sent when the folders (or the file) changed, so a busy folder sends about one every 2 seconds. It ends when the workspace closes, or once what reads it is gone. A connection follows one stream at a time (conflict); to open another folder, start the stream again with one more.
  • The requests are files-list (workspace, folders, follow), files-read (workspace, path, follow) and files-search (workspace, query, mode: text or names). Without --follow, one answer. Queries and file contents never reach the server’s log.
  • status --json gives home, the server’s home folder, so a client shows ~/… for paths there as the window does.

The session is not all of cornercase’s state. The TODO list, the queue, whether you are away on each chat app, the update found and keep awake live outside it, and another UI needs them too. status --app prints them as one JSON object, and --follow prints it again each time one of them changes:

Terminal window
cornercase status --app
cornercase status --app --follow | jq -c '[.revision, (.todos | length)]'
  • todos: the items as todo list --json has them, in the panel’s order. queue: the entries queue list --json has, prompts included, with started and result_at once an entry started and kept a result, never the result’s text, and unsent: true while a started entry’s agent did not take its prompt.
  • away: one row per chat app, telegram then discord, each with ready (paired, and the bot’s token not refused) and away. Discord’s row also has forum once forum mode is on or a forum is saved: on, ready, guild and channel (ids, as text) and pending, the setup step still left, or null. While that step is picking a server, it also has servers, each with id (as text) and name, which config forum-server ID picks from.
  • update: release (version and its notes, each with a version and text), or none saying why there is no release: disabled (a development build), off (check_updates is off and nothing was checked), unchecked, up-to-date or failed. Also checking, checked (UTC time of the last answer), error (why the last check failed), install ({"method": "replace", "path": …} when cornercase can replace itself, {"method": "command", "command": …} when you must run a command, as with Homebrew), installing, installed (restart to use it) and install_error. update-check and update-install drive it.
  • keep_awake: as in status --json, or null while the setting is off. version and boot are the server’s, as in status.
  • popup: while a plugin’s popup is open, plugin, action and its size, cols and rows; left out otherwise. plugin popup-close closes it, and surface --popup and input --popup show it and type into it.
  • machines: the rows of machines, there only while you list some. A line comes when a machine’s state changes or a failed try moves its retry_at, not as its unreachable · 8 s counts up or that time draws near, since seen and retry_at are times.
  • accounts_revision: a number that moves each time the accounts account list names change: account add, account remove, or a folder another program made or deleted, seen within a second. It is left out until it first moves, so a server that never had an account does not have it, and one that starts with accounts has it from its first line. List the accounts again when it moves, rather than on a timer: a first account added by a command typed in a pane changes nothing else you can see. An account’s name, a default and a profile do not move it, they move config.revision, so list again for either. Like revision, it only compares within one boot. An older server leaves it out too, so a client that stops asking on its own checks the accounts-revision feature first.
  • tour: the guided tour: active (the tour and step ids on screen, its index and whether the window shows its card, or null), offered (whether it was shown by itself already), and progress, one row per tour with the steps done and whether it is finished. See Draw the tour.
  • It follows the rules of status --follow: every line is the whole state and carries a revision that grows by one per line, revision only compares within one boot, a reader that falls behind reads at most four older lines and then the latest, and it ends when the server stops or restarts. A line goes out at most twice a second, and only while someone follows. It is a stream of its own so that the session’s lines do not carry the queue’s prompts and the release notes every half second.

A flow run is state of its own: the stage the work is in, the loops, each role’s pane and status, what the roles sent each other, the files they wrote. Another UI needs it to draw the Flow panel, and a script needs it to know whether a team is done.

Terminal window
cornercase flow runs
cornercase flow runs --follow | jq -c '[.revision, (.runs | length)]'
cornercase flow messages --worktree fix-login --follow
cornercase flow files --worktree fix-login
  • flow runs prints one block per running flow (a run that has stopped moving, with its orchestrator’s turn over, no agent of the team working and the run not ended, adds stopped moving 50 min ago: …, or stopped moving 5 min ago: the orchestrator's agent exited when the orchestrator’s agent is gone; --json has stopped, the UTC time it stopped, left out while the run moves; check flow-stopped before reading a missing one as moving): its workspace, the stage (counted from 1 for people), the rounds of its loops, the task’s first line, each role’s pane and status (closed once its pane is gone; exited for a role whose agent exited by itself while its tab is still open, with a line exited: coder; `cornercase agents reopen --workspace 7` brings it back, where - is a role not started yet; awaited is working, then finished until cornercase has told the orchestrator, while the role holds work the orchestrator sent it; a run whose agents were closed to reopen later is listed too, with state: "closed" and every role’s pane null), the last step and the last one outside the plan, whether the orchestrator marked its pane for review, which is how a run ends, and, after the work went back to an earlier stage, the stages it has not been through since (not run since the last change: stage 3, stage 4, or ended with stage 3 and 4 not run on the last change once the run ended). --follow prints the same as one JSON line each time something changes, until the server stops. The request is flow-runs, a stream like status --app: every line is the whole state with a revision (see status --follow for what that guarantees), a line goes out at most every half second and only while someone follows.
  • A run in the JSON has run (its id, which flow run answers too and which a restore changes), project, workspace, flow (the plan the team was briefed with, as in Manage flows, frozen at the start: editing or deleting the flow does not change it), task, dir (the run’s folder), roles (the orchestrator first, then the flow’s roles in order; each with role, pane, tab, status, closed, exited (true while the role’s agent has exited by itself and its tab is still open; left out otherwise; check flow-exited before reading a missing one as false), and worktree and branch for a role with a worktree of its own; a role with no pane, after a restore that could not bring it back, has null for all), stage, rounds, holder, last, outside, not_run (the stages, counted from 0, the work has not been through since it last went back: a loop’s round, or a step outside the plan to an earlier stage; a send into a stage takes it off; left out when there is none; a restart forgets it; check flow-not-run before reading a missing one as none), ended, messages and, on a run that closes its agents once its pull request merges (see Start a flow), close_when_merged (left out otherwise) and stopped (the UTC time the run stopped moving, left out while it moves: a run is stopped while its orchestrator’s agent is not working (its turn is over, or it has exited), no member of the team works, a background shell and subagents counting as working, and the run has not ended).
  • flow close-when-merged (--workspace ID, --worktree BRANCH, --free-builds, --off) sets, for a run that is already going, whether its agents close once its pull request merges, as flow run --close-when-merged does from the start. The request is flow-close-when-merged (workspace, off, both always written, and free_builds, left out when false) and the answer has run, project, workspace, close_when_merged, free_builds (left out when false) and changed: it sets the whole choice and never toggles it (without --free-builds the builds are kept, --off turns both off, and off with free_builds is malformed), so saying it twice changes nothing the second time. It refuses with not-found for an unknown workspace and conflict when the workspace runs no flow, when its agents are closed (reopen them first) and when turning it on for a flow that leaves the commits. The text says the agents of workspace 7 close once its pull request merges and none of them works, … already close …, … stay open after its pull request merges or … already stay open …; with --free-builds the first two end , freeing their worktrees' build folders, and without it a changed one ends , keeping their worktrees' build folders.
  • flow account (--run N, --workspace ID, --worktree BRANCH, --account AGENT=ACCOUNT, repeated, --now) moves a running team to another account, as the Flow panel’s account buttons do: every agent of the team of that kind restarts in its own pane, on the new account and in its own conversation (Gemini CLI, or a role that never had a turn, starts over with its role’s brief and is listed in fresh), once the team is idle, or at once with --now. A role whose agent had exited gets a new shell on the new account with nothing started in it, is listed in restarted, and comes back with cornercase agents reopen. Meanwhile the orchestrator is not woken and a send or keys into the team’s panes is refused with conflict, telling it to end its turn (it is told when the team is back, or that it did not restart when the change ends without one); keys to an agent waiting for an answer to a question or a permission prompt still go, so the prompt can be answered, until the team’s conversations start moving. AGENT= is the agent’s own login, and naming the account the team already runs on cancels a change that waits. The request is flow-account (run or workspace, else the caller’s run; accounts as {"claude": "personal"}; now, left out when false) and the answer has run, project, workspace, accounts, state (waiting, restarted, unchanged or cancelled), changed, restarted (the panes), skipped (each pane and why), cut and fresh (the roles whose turn was cut and those that started over; while it waits, what a restart would cut now). Without now it answers at once; with it, once the team restarted, or with conflict when the restart could not start (a pane of the team running another program, for instance), a conversation could not move or the account was removed meanwhile (nothing restarts then, and the whole change ends), no agent of the team could restart, or the run ended. An agent that could not restart while others did keeps its account and is listed in skipped. Every agent named is checked before any changes, so a refusal leaves the team as it was. It refuses with not-found for an unknown run or account, malformed for no account, an agent without accounts or a run outside the workspace given, and conflict when the workspace runs no flow, its agents are closed, the team has no role of that agent, or the caller is an agent of that run (it would restart itself). A bot cannot ask it. In flow runs, each role has account, the account it runs on (left out for the agent’s own login and agents without accounts), and the run has account_change (accounts, state, waiting or moving, and since, UTC) while a change waits; the text adds on personal to a role and restarts on claude: personal once its team is idle. Check flow-account first; it is kept in memory only.
  • Stages here count from 0, the index in flow.stages, unlike a loop’s back.to, which counts from 1 as in the flow’s file. stage is the stage the work is in (null before the orchestrator sends anything), rounds has one number per stage (how many times its loop went back), and holder is the role that last got the work. A step is {"edge": …, "from": …, "to": …, "time": …}, where edge is {"kind": "forward", "stage": N} (it leaves stage N), {"kind": "loop", "stage": N} (stage N’s loop) or {"kind": "outside", "from": N or null, "to": M} (a role of a stage the plan does not lead to), from is the role that held the work before (not the sender, which is always the orchestrator) and time is UTC. outside is the last step outside the plan, and ended is true once the orchestrator’s pane is marked for review. Only what the orchestrator sends into a role moves the work, as in the diagram.
  • flow messages prints what the orchestrator and the roles of a run sent each other: its sends, and the keys it pressed, the screens it read and the waits it made, each with its time, who, to whom and the text. --workspace ID or --worktree BRANCH names the run (the one in the pane’s own workspace, else the shown one, by default); with no run there it says so. --follow goes on printing until the run ends. With --json each message is one line: run, workspace, seq (counted from 1 for the run), time, from, to, kind (send, keys, read or wait), text (null when there was none), bytes (the real size: a text is kept up to 32 KiB) and edge, the step along the plan it moved the work through (null when it moved nothing); the backlog comes first, expanded into those lines. Only the last 256 messages of a run are kept, in memory, and never logged or saved, so a run that was restored starts with none. The request is flow-messages, a stream of its own on its connection: its answer is {"boot", "run", "workspace", "messages": [...]} with every message kept so far, then each new message is one line, in order, with no gap in between, and it ends (Detached) when the run does. A client that cannot keep up gets a {"event": "dropped", "count": N} line, as in Follow events, and reconnects to read what is kept. A second flow-messages on one connection is conflict.
  • flow files lists the files of the run’s folder, newest first, at most 200, as a table (name, bytes, modified, path; --json prints workspace, run, dir, files and more). After the run ended it lists the last folder the workspace’s runs made, for as long as the workspace lives; a workspace that never ran a flow is conflict, and a folder that was deleted failed. The request is flow-files, one answer. To read a file, cornercase files read with its path (see Browse and read a workspace’s files).

A program that draws cornercase’s terminals itself, such as an editor extension or a GUI, needs more than read’s plain text: the cells with their colours, where the cursor is, which modes the program turned on, and how the tab is split. surface streams all of it for one tab, laid out at the size you give, as one JSON line:

Terminal window
cornercase surface --tab 3 --cols 120 --rows 40
cornercase surface --tab 3 --cols 120 --rows 40 | jq -c '[.revision, [.panes[].pane]]'

The first line is the tab as it is now, the next ones come when something it shows changes, at most about 60 a second and never twice the same. Each line is complete and replaces the one before, unless you ask for patches. Find the tab’s id with cornercase status. The tab doesn’t have to be the one the window shows, and streaming it doesn’t switch to it or change anything the window shows. It works on a server started with start-server, with no window.

A line has these keys:

  • boot, session, surface and revision: the server’s start (see Contract and compatibility), the revision of the latest status --follow line sent before this one was drawn (0 if none was sent since the server started), this stream’s id (the one resize takes) and its own counter, from 1, up by one per line. A line from another boot is stale. To get a complete baseline again, run the command again: its first line is always complete.
  • tab, cols and rows: what you asked for.
  • layout: the tab’s whole split tree, as in status --json, hidden panes included. dividers: each divider with its dir, its path through layout (false for the first side, true for the second), the region it divides (area) and its cells (line).
  • panes: the panes the surface shows, each with pane (its id), active, rect (x, y, cols, rows: where to draw it in the surface), size (its terminal’s own columns and rows), cursor (x, y, shape as block, bar, underline or block_hollow, and blinking, or null when hidden or scrolled out of view), modes, scroll, colours, wrapped and lines.
  • modes: mouse (none, press, press_release, button_motion or any_motion), mouse_encoding (default, utf8 or sgr), alternate_screen, alternate_scroll, bracketed_paste, application_cursor, focus_events and kitty_keyboard (the flag bits). They are what you need to turn keys and the mouse into what the program expects.
  • scroll: total rows of history plus screen, offset of the view’s first row, and rows in the view. What is under the view is total - offset - rows. A pane scrolled up shows its history in lines.
  • hyperlinks: the table the runs’ hyperlink numbers index, shared by all the panes, left out when no cell has a link: [{"uri": "https://example.com"}], from OSC 8 (ls --hyperlink, compilers, gh). A link is its address: cells with the same address are one entry, so a link that wraps onto the next line is one link, and two separate spans to the same address open the same place. OSC 8 ids aren’t sent.
  • colours: the colours the pane’s program changed, left out when it changed none: fg, bg and cursor as [r, g, b] (OSC 10, 11, 12) and palette, such as {"1": [255, 0, 0]} (OSC 4). Resolve a colour {"index": n} through palette before your own palette, and draw default-coloured cells with fg and bg when they are there. Your theme is never listed: only what the program set, until it resets it.
  • wrapped: the rows, numbered as in lines, whose line goes on in the next row because the terminal wrapped it there, left out when no row does. "wrapped": [2, 3] says rows 2, 3 and 4 are one line, so a web address a program printed across them can be opened whole. To join a row to the next, pad its cells to size.cols with blanks first (lines leaves trailing blanks out): the next row’s first cell follows its last column. Where a wide character did not fit at the end of a row, the terminal left that last column empty, and the frame doesn’t say which one, so padding adds a blank there that the line never had: harmless in a web address, but it can split a line that holds wide characters. A line that ends with a newline is never listed, even when it fills its row. In a pane scrolled up, the last row is listed when its line goes on below the view, and nothing says whether the first row goes on from a row above it. A server without the feature surface-wrapped never sends wrapped, so there its absence says nothing.
  • lines: one entry per row of the pane’s terminal (size.rows), each a list of runs, {"style": 1, "hyperlink": 0, "cells": ["o", "k"]}: consecutive cells of one style and one hyperlink (hyperlink is left out when the run has none). A blank that is part of a link is kept at the end of a line. A cell is a string, the character with any combining marks. The right half of a wide character is "": don’t draw it, the cell before covers it. The cells after the last one that isn’t a blank in the default style are left out, so an empty line is [] and the rest of a line is blank.
  • styles: the table the runs’ style numbers index, shared by all the panes. Entry 0 is {}, the terminal’s default colours. Others have fg and bg (absent for the default colour, {"index": 0-255} for a palette colour, which your theme decides, or {"rgb": [r, g, b]}) and the attributes that are on: bold, dim, italic, underline, blink, inverse, invisible, strikethrough, overline, and for underlined cells underline_style (double, curly, dotted or dashed; a plain underline has none) and underline_colour (like fg). A client that knows only underline draws every style as a plain one. A selection made in a window shows as inverse.

A long-lived program that parses every line pays for the whole tab each time, and so does a link that carries it. With --patches the first line is complete and the next ones carry only what changed:

Terminal window
cornercase surface --tab 3 --cols 120 --rows 40 --patches

A server from before patches ignores the option and sends complete lines, which you apply the same way, and cornercase contract lists the feature surface-patches to check for it. A line with no base is complete, as above. A line with base is a patch, and has boot, session, surface, revision, tab, cols and rows as before (and view and projection for --view), then:

  • base: the revision it applies to, always the one before it. Apply a patch only when base is the revision of the last line you applied; otherwise ask for a complete line with cornercase redraw --surface ID, or connect again.
  • styles and hyperlinks: tables for this patch’s runs only. A run’s style and hyperlink in a patch index these, not the tables of the line you hold, so resolve them as you apply a row and keep what you resolved.
  • panes: only the panes that changed, each with pane and cursor (always: null is a hidden cursor), and only what changed of active, modes, scroll, colours ({} once the program resets them), wrapped (the whole list, [] once no row goes on), copy and lines. A pane that is not listed did not change.
  • copy: from, to and count. Before you apply lines, take rows from to from + count - 1 of the pane as you held them and write them at to. It is how output that scrolls arrives: the rows that moved, not their content. Rows it doesn’t cover keep what they had.
  • lines: row number ("3" is row 3) to that row’s whole line of runs, as in a complete line; [] is a blank row. Replace those rows after copy.

The layout, dividers, the set of panes, their rect and size, and the tab and size of the surface never change in a patch: when any of them does, the next line is complete. It is also complete when the view’s projection changes, after the server held back a line because you were slow to read, and when you ask:

Terminal window
cornercase redraw --surface 4

redraw takes the surface of the lines. The surface’s next line is complete and comes at once, even if nothing changed. It works with or without --patches. An unknown or ended surface is not-found, and no --surface is wrong usage.

Things to know:

  • The panes are laid out in your cols × rows the way the window lays out a tab, including when the tab is too small for all its panes: then only the active one shows, over the whole surface. The terminals keep the size of whoever sizes the tab (the window, or a view), though, so a pane’s size can differ from its rect: lines and cursor follow size. Streaming a --tab doesn’t resize anything.

  • cols is 1 to 1000 and rows 1 to 500. A connection streams one tab; cornercase resize --surface ID changes the size of one given with --tab in place, and another tab needs another connection.

  • It ends, with status 0, when the tab closes, the server stops or restarts, or whatever reads it is gone (stopping it yourself leaves the shells running). A pane whose shell exits drops out of the next line. A tab that doesn’t exist, or an out-of-range size is an error, with status 1; a missing --tab, --cols or --rows is wrong usage, with status 2.

  • A reader that falls behind gets fewer lines, each complete (with --patches, the line after falling behind is complete), so it never has to repair a picture: the server draws a new line only while little is waiting for it. One that stops reading altogether is disconnected once the server has waited a second to write to it, like any client.

  • Keys added later, such as hyperlinks, colours, wrapped, underline_style, underline_colour and overline, are left out when empty, so a reader that doesn’t know them keeps working and a terminal that uses none of them sends exactly what it did.

  • Not sent yet: images, OSC 8 link ids, pixel sizes and a terminal size set pane by pane. A pane’s title is in status --json, and its bells and clipboard writes in events --host.

  • against_base (feature against-base) is what the Changes panel’s All mode counts for a workspace: base (such as origin/main), files, added and removed. It is present only while a window or a visible view draws the workspace’s row and a count is held, and left out otherwise; files: 0 means counted and clean. cornercase status prints it as 16 files +640 −9 vs origin/main. A view’s lines also carry changes (Uncommitted) for the workspace that view shows, and a hidden view (view-set --hidden) draws nothing, so it keeps no count running.

Two programs that draw cornercase, or a program and the window, shouldn’t have to share one selection and one size. view opens a view: its own project, workspace and tab, an optional size, and an active flag. It keeps running and prints the session as one JSON line each time it changes, like status --follow, plus a view object, and the view lives as long as the command does: stopping it closes the view and hands its tabs back. The processes keep running.

Terminal window
cornercase view --cols 120 --rows 40 > view.jsonl &
id=$(head -n 1 view.jsonl | jq .view.id)
cornercase new-tab --view "$id" --focus --name logs
cornercase surface --view "$id"
  • view has id, projection, active, cols and rows (null without a size), shown (the project, workspace, tab and pane it shows) controls (whether it sizes its tab’s terminals now) and claims (false for a view opened with --no-claim). It starts on what the window shows, or on --tab, --workspace or --project; the window doesn’t move. Each tab in the lines has controller: the id of the view sizing it, absent when the window does.
  • --view ID works on status, focus, open, clone, new-workspace, new-tab, split, setup, start, flow run, send, keys, held, read, wait, mark, rename, go, surface and plugin run, account add --login and account login, also from separate commands. The view’s tab is their default, and focus, --focus move the view, not the window or the other views. focus --view --json prints the view’s new tab and its projection. Other commands refuse it. A server without views is refused up front, naming the update.
  • When something the view shows goes away, it moves like the window would: a closed tab to the one before it, a closing workspace or project to its neighbour. That never resizes a tab for it.
  • surface --view ID streams the tab the view shows, at the view’s size, and follows the view to other tabs. It takes no --tab, --cols or --rows, and each frame carries view and projection.
  • view-set --view ID changes it: --cols and --rows, --active or --inactive, --hidden or --visible (see below), --claim to size the tab it shows from now on, and --no-claim to give it back and stop sizing it until --claim. A view without a size, or inactive, sizes nothing and streams no terminals, but its lines keep following the session.
  • The tab a view shows counts as seen, like the window’s, while the view is active, has a size and is visible: an agent there gets no ✓, toast or desktop notification. view --hidden and view-set --hidden say its window is hidden or minimised, so agents there notify again, and --visible says it is back, which also asks again at once for every open pull request not read in the last 10 seconds, as coming back to the window does. While a view is open, the window’s tab counts as seen only while a window is attached; a program that only shows notices can open a view without a size.
  • view --no-claim opens a view that never sizes the tab it shows: its terminals keep the size of the window or of the view that claimed it last, while the tab still counts as seen and surface --view is laid out at the view’s size. It suits a phone or another small screen that should not shrink the terminal at the computer. Moving it, a new size or --active claim nothing; view-set --claim makes it claim like any view, and view-set --no-claim stops again. Its lines say "claims": false, and its text line no claim. contract lists view-no-claim, and the command checks it first: an older server would size the tab.
  • view --bot ID and view-set --bot ID say the view shows that bot’s chat in place of its tab (--bot '': none; a bot’s id, or its name). While the view is visible, the bot’s answers count as read and make no toast or desktop notification, as when the window shows the chat, and the tab behind it no longer counts as seen; it lasts until --bot '', the end of the view or the bot’s removal, and the view’s lines carry bot. contract lists view-bot.

Who sizes a tab. One at a time, so two programs showing the same tab never fight over its size. The window is the default. A view claims the tab it shows when it opens, moves there, turns active, or with --claim; using a window (a key, a paste, a click) takes back the tab it shows, until the window shows another tab. The latest claim sizes the tab’s terminals at the view’s cols × rows, without the window’s sidebar or panels; when it lets go (inactive, moved on, closed) the tab goes to the latest one left, else the window.

projection starts at 1 and goes up each time what the view’s surface shows changes: its tab, its size or whether it is active. Show a frame only when its projection is the latest one you know: an older one was drawn before your last move.

Still shared with the window and every other view: the programs and their output, how a tab is split, which pane of a tab is focused (focus --view --pane moves it for everyone), the scroll position and the selected text. The window’s overlays, side panels and sidebar scrolling are its own.

A program that draws a tab with surface also has to type into it and handle its own mouse. A window’s keys and clicks go through the window, where a dialog or a field can take them and a click is a cell of the window’s layout. These commands act on a pane or tab you name, whatever the window shows:

Terminal window
cornercase input --pane 12 '{"text": "ls"}' '{"key": {"code": "enter"}}'
cornercase input --pane 12 '{"key": {"code": "c", "mods": ["ctrl"]}}'
cornercase input --pane 12 '{"mouse": {"kind": "scroll-up", "x": 10, "y": 5}}'
cornercase input --pane 12 '{"paste": "two\nlines"}' --boot 4242-1700000000
cornercase input --pane 12 --follow --json -
cornercase scroll --pane 12 --up 10
cornercase selection --pane 12 --from 0,3 --to 79,5 --copy
cornercase ratio --tab 3 --path second 0.3
cornercase resize --surface 4 --cols 100 --rows 30
cornercase link --pane 12 --cell 10,3
  • input takes one JSON event per argument, sent in order (- reads one per line from standard input): {"key": {"code": "c", "mods": ["ctrl"], "kind": "press"}} (code as for keys; mods any of ctrl, alt, shift, super; kind press, repeat or release), {"text": "héllo"} (committed text, no control characters), {"paste": "two\nlines"} (bracketed when the program asked for it) and {"mouse": {"kind": "down", "button": "left", "x": 3, "y": 1, "mods": []}} (kind down, up, drag, moved, scroll-up, scroll-down, scroll-left or scroll-right; x and y are cells of the pane’s terminal, from 0, as in the lines of a frame).
  • Events are encoded the way the program in the pane asked for, the way the window encodes what you type: its keyboard protocol, application cursor keys, bracketed paste and mouse mode and encoding, all in the modes of a frame. Keys, text and pastes bring the pane’s view back to the bottom. They don’t set the shared window size and don’t answer for the agent: unlike send and keys, input types into an agent’s dialogs and answers its permission prompts, because it is a person typing through another UI. Scripts and agents should keep using send and keys, which check first.
  • A mouse event the program doesn’t take in its current mode, or a key release when it didn’t ask for event types, is not sent and is listed in the answer’s skipped ({"event": 0, "why": "mouse"}; the command prints a warning). Everything else is encoded first and written in one go: when one event is wrong, or the program isn’t reading its input, nothing is sent. Add "size": {"cols": 80, "rows": 24} to the request to say which terminal size your coordinates are for: if the pane has another size now, nothing is sent (conflict).
  • scroll moves the pane’s view through its history by --up or --down rows, or to --top or --bottom, and answers with its scroll as a frame has it. The view is the pane’s, so the window shows the same one. On the alternate screen, or when the program reads the mouse, the program scrolls itself: send it keys, or the wheel with input; scroll refuses with conflict.
  • selection with --from X,Y --to X,Y selects between two cells of the pane’s view (columns and rows from 0, as in lines; --rectangle for a block) and prints the text. Without them it prints what is selected, --clear removes the selection, and --copy also copies it through the window, as selecting there does, and prints what it copied (the answer’s text), so a program without a window can put it in the clipboard itself. The selection is shared with the window, which shows it as inverse, and with every client; the last one to change it wins.
  • ratio RATIO sets the share of the first side of a tab’s divider, between 0 and 1. --path names the divider as the path of a frame’s dividers does (first or second at each level down; without it, the outermost). The terminals follow at once, with the window’s geometry. To open or close splits use split and close.
  • resize lays a running surface out at another size without starting it again; ID is the surface of its lines. Its next line comes at the new size, with the next revision. It resizes no terminal: they keep the size of whoever sizes the tab. A surface that follows a view (surface --view) takes the view’s size, so resize refuses it: change the view with view-set.
  • link --cell X,Y says which file a click on that cell of the pane’s view opens in the window (columns and rows from 0, as in lines), so you get cornercase’s detection of the paths programs print without copying it: the path under the cell, looked up from the folder of the program in the foreground, then from the root of the pane’s workspace, with its line or lines. It prints path, path:12 or path:12-30, and nothing, with status 0, when the cell holds no file; --json also says whether the file is inside the workspace. It opens nothing, and OSC 8 links are in the frame’s hyperlinks, not here. Web addresses aren’t looked up: find them in the frame’s cells, joining the rows its wrapped lists.
  • input takes --boot BOOT, also with --popup: a server that restarted since you read the pane’s id types nothing, with status 4 (see Arrange). With --follow it goes with every line: a server that restarted since ends the command on the first line with status 4, and nothing after it is sent.
  • input --follow - keeps running, so a program types through one process rather than one per batch of keys, and with --remote through one ssh connection. It reads one event per line from standard input and sends each line as soon as it arrives. Lines that arrive while the previous request is on its way go together in the next one, so there is one request at a time, in order.
  • A line can name its pane, {"pane": 14, "key": {"code": "enter"}}; without pane it goes to --pane. One process can type into every pane of a view.
  • Each request is all or nothing on its own. With --json it prints one line per request: the answer with events (how many of your lines it answers; blank lines are skipped) and each skipped event counted from the first line read, or pane, error and events when a request was refused or a line wasn’t an event. The next lines still go, except after a refusal for --boot, which ends the command with status 4 and prints no line for it.
  • input --follow ends when standard input ends, after the last answer: with 0, with 3 if some line wasn’t sent, or with 1 once the server stops or the connection drops (it notices at the next line). A program on the socket does the same by keeping its connection and sending each input after the answer to the one before.
  • Requests on different connections aren’t ordered: send the next input after the answer to the previous one, put several events in one request, or keep one input --follow running. Unlike the other commands, these six log at debug level, since a program sends them as fast as someone types or drags.

A program that draws cornercase (a window of its own, an editor’s panel) sends many small commands: a focus, a scroll, a split. Run one by one, each is a whole process, and through --remote a whole ssh session. requests --follow - keeps one running and sends them all through one connection:

Terminal window
cornercase requests --follow -
cornercase --remote devbox requests --follow -
printf '%s\n' '{"args": ["status", "--json"]}' | cornercase requests --follow -
{"args": ["focus", "--tab", "6", "--view", "21"]}
{"args": ["send", "--pane", "5", "-"], "stdin": "cargo test"}
  • A line is one JSON object: args is the command line after cornercase, read by the same parser, so every flag works and each command’s --help stays the contract; stdin is what the command reads from - (text; for bytes use a file argument). Other keys are refused, so a typo never runs send - with no text. Blank lines are skipped.
  • Each line gets one answer line, in order: status (the exit status the command would have had: 0, 1, 2, 3 or 4), json (what it printed with --json), text (what else it printed, such as the id new-tab prints), stderr (its warnings) and error (its message). Only status is always there: empty json, text, stderr and error are left out, and a status 1 or 3 may have no error (its reason is in stderr or in its json). New fields may be added; read what you know. A line that isn’t JSON, is refused or fails does not stop the next ones.
  • It runs the commands that send requests. The streams (events, surface, view, changes list, config pair, tunnel hold, tunnel orders, every --follow), update, restart, kill-server, logs and the plugin commands that work on the files need a process of their own and are refused with status 2, as are start-server (it needs no connection, and requests needs a running server: run it first), --remote on a line and the commands that act on this machine (remote, skill, plugin windows and so on).
  • Inside a bot, each line is first checked as the bot’s command line is, and what it refuses gets status 2 with the same text.
  • Lines run one at a time, each after the answer to the one before. A line that waits (wait, send --wait, start --wait) holds the lines after it; to put a key before a focus, send both through requests. Lines aren’t ordered with other connections.
  • It ends when standard input ends, after the last answer (with 5, before the first line, when --remote reaches an older cornercase): with 0 if every line had status 0, with 3 if some didn’t, with 1 once the server stops or the connection drops (it never reconnects, because ids change with a restart: start it again and look at status), and with 0 when what reads its answers is gone, even while a line waits. Between lines it waits for the next one without watching the server or the reader, so it notices that either is gone at the next line.

A plugin’s popup is a terminal too, so a program that draws cornercase can show it and type into it the same way, with --popup instead of a tab or a pane:

Terminal window
cornercase surface --popup
cornercase input --popup --pane 40 '{"key": {"code": "down"}}' '{"key": {"code": "enter"}}'
  • surface --popup streams the popup open in the window, in the same lines as a tab: one pane, the popup’s terminal, at the popup’s own size (cols and rows, which follow the window’s size, or with no window attached the size of the view it opened for), with popup naming it: its id (pane, the same as its pane’s), its plugin and its action; tab is 0, layout null and no dividers. --patches works as for a tab. It takes no --tab, --cols, --rows or --view, and resize refuses it. It ends when the popup closes, like a tab’s surface when the tab closes; for the next popup, run it again.
  • input --popup types into the popup’s program, with the events input takes for a pane (mouse cells are the popup terminal’s, as in its lines). The answer’s pane is the popup’s id. Add --pane ID with the popup.pane of the lines you drew, as a program that draws the popup always should: if that popup closed and another one opened since, nothing is sent and it fails with not-found, so keys meant for one popup never reach the next. Without --pane it types into whichever popup is open.
  • Without a popup open, both fail with not-found. Watch status --app’s popup to know when one opens. Nothing changes in the window: the popup is still there, and you can still type into it there.
  • Every program that can reach the server, an agent in a pane included, can read what a popup shows and type into it, as it can for panes. See Popups for what that means for a plugin.
  • A server without the popup-terminal feature doesn’t know --popup: it refuses surface and input with popup alone, but types input --popup --pane ID into pane ID, if one has that id. Check contract before sending "popup": true.

An agent reads an image or a file from a path. When you work on another machine than the server (cornercase remote, the browser, a program that draws cornercase), a file on yours has no path there. paste-file sends it:

Terminal window
cornercase --remote devbox paste-file --pane 12 ~/Desktop/shot.png
pngpaste - | cornercase --remote devbox paste-file --pane 12
wl-paste --type image/png | cornercase --remote devbox paste-file --pane 12 --name error.png
cornercase --remote devbox paste-file --pane 12 ~/Desktop/shot.png --boot 4242-1700000000
  • The command reads FILE, or standard input without it or with -, on the machine where it runs, also with --remote. It takes files up to 32 MB and refuses an empty one before it even connects. With --boot BOOT (see Arrange), nothing is kept there or pasted when the server restarted since, with status 4.

  • The server keeps the bytes in a folder of its own, pasted/ next to session.json (one folder per paste, 0700; the file is 0600), and pastes the file’s path into the pane followed by a space: as a paste, bracketed when the program asked for pastes, quoted only if the path needs it. It prints the path; --json prints pane, path, bytes and paste, a number.

  • The name there is --name, else the file’s name, cleaned to letters, digits and . _ + - so the path needs no quoting (Screenshot 2026-10-27 at 10.03.12 AM.png becomes Screenshot-2026-10-27-at-10.03.12-AM.png). A name without an extension gets an image’s own (png, jpg, gif, webp, bmp or ico), told by the first bytes, so pngpaste - gives pasted.png.

  • A paste’s folder is removed when its pane closes, and what an earlier server left in pasted/ after 7 days.

  • Like input, it pastes whatever the program in the pane is doing: a dialog or a question there gets the path too, and none of send’s safeguards apply.

  • A program on the socket sends {"command": "paste-file", "args": {"pane": 12, "name": "shot.png", "data": "<base64>"}} and gets pane, path, bytes and paste once the file is kept and the path pasted; send takes those ids as "after_paste": [7]. data is standard base64, padding optional, line breaks ignored. It fails with malformed (no pane, empty data, not base64, over 32 MB), not-found (no such pane), busy (the program is not reading its input, or a send is between its paste and its Enter) or failed (the file could not be kept). A client that leaves before the answer gets nothing pasted. An older server refuses the request by name (unsupported). A program may add "boot" to the request, as to any other, and gets stale-boot when the server restarted.

  • The pane then counts as having a draft, so a send waits for it as for a person’s. To send the text that goes with the file, pass its paste to send --after-paste, once per file when you pasted several:

    Terminal window
    id=$(cornercase paste-file --pane 12 shot.png --json | jq .paste)
    cornercase send --pane 12 --after-paste "$id" --enter 'what is this?'

    The text joins the path and goes at once. It still waits when a person typed in the pane before or after the paste, or when another file is in the line, and every refusal of send still applies (an agent waiting for an answer, a dialog, the survey), so there is no need for --force.

  • To take a file back before it is sent, pass the path it answered to paste-file --undo:

    Terminal window
    path=$(cornercase paste-file --pane 12 shot.png)
    cornercase paste-file --undo --pane 12 "$path"

    It erases the file from the pane’s input (in Claude Code, the [Image #1]; in another program, the path) and removes its copy, but only while it is still the pane’s draft and nothing came after it: the last file pasted there, with nothing typed, sent or pressed since. In a program whose input cornercase cannot read (anything but Claude Code), it must be the only pasted file there. Otherwise nothing is touched, the command exits 1 and says why. With --json it prints pane, path, removed and why and exits 0 either way; why is unknown (that path was not pasted into that pane since the server started, or was already taken back), not-draft (it was sent or cleared, or a minute passed), typed (someone typed in the pane, or keys or a send wrote after the file), not-last (another file was pasted after it: take that one back first), not-alone (other pasted files are in a program cornercase cannot read) or not-shown (the agent’s input does not end with the file, or shows a dialog). paste-file answers once the path is written, before Claude Code draws its [Image #1], and the undo reads the input once: right after the paste it can answer not-shown and leave the file, so wait for the attachment to show and run it again. removed: true means the Backspaces were written: the copy is removed in the background, and if that fails the server’s log says so and the copy goes with the 7-day cleanup. In Claude Code’s vim mode, take a file back only in insert mode: in normal mode a Backspace moves the cursor, so the attachment stays while its copy is removed. Over the socket, send {"command": "paste-file", "args": {"pane": 12, "undo": "<path>"}} (without name or data, else malformed); check the feature paste-undo first: an older server refuses it as a paste without a file, or with unknown-field when the request carries contract or boot.

  • A program that types through input --follow should wait for paste-file’s answer before sending more, as the two travel on different connections and are not ordered.

Programs in the terminals ask for the colours they are drawn with (OSC 10, 11 and 4, and the light or dark query): Claude Code, Neovim and delta pick their look from the answer. The server takes them from the first window, so a program that drives cornercase without one has to give them:

Terminal window
cornercase start-server --theme dark.json
cornercase theme light.json # the system switched to light
cornercase theme - < dark.json # read from standard input
cornercase theme # client colours, dark
cornercase theme --clear # back to the window's colours, or the defaults
{
"foreground": [192, 202, 245],
"background": [26, 27, 38],
"palette": [[21, 22, 30], [247, 118, 142], [158, 206, 106], [224, 175, 104],
[122, 162, 247], [187, 154, 247], [125, 207, 255], [169, 177, 214],
[65, 72, 104], [247, 118, 142], [158, 206, 106], [224, 175, 104],
[122, 162, 247], [187, 154, 247], [125, 207, 255], [192, 202, 245]]
}
  • The foreground, the background and the 16 ANSI colours are required, as [r, g, b]. palette may go up to 256 entries; entries 16 and up are optional (absent or null keeps the default cube and greys). A theme that misses a part is refused (malformed, and cornercase exits 1 before connecting). Over the socket the request is {"command": "theme", "args": {"theme": {…}}}, {"args": {"clear": true}} or {"args": {}} to read; start-server takes the same object as args.theme.
  • The answer, and theme in status --json, status --follow and the start-server answer, say where the colours come from: {"from": "default" | "window" | "client", "scheme": "light" | "dark" | null}.
  • These colours win over a window’s until you give others, clear them, or the server stops. They are not saved: after a restart give them again. A window that attaches later draws its own chrome with its own colours and leaves the terminals’ alone; clearing gives the terminals the first window’s colours, if one ever gave them. start-server --theme applies even when the server already runs. The last theme given wins.
  • Every open terminal and every one made afterwards takes the new colours at once. Programs that turned on colour scheme reports (mode 2031) are told when light and dark switch. A program that read the colours once at start keeps its guess until it asks again, and a colour a program set itself (OSC 4, 10, 11) wins over these.
  • surface frames keep palette indices: resolve them with the colours you gave, so the program’s guess and your drawing agree.
  • Not covered: the cursor colour, colours per view, and the TUI’s own colours, which stay the window’s.

search answers “which pane dealt with this?” without opening tabs one by one. It looks, ignoring case, in what the coding agents in your panes were told and answered (Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI and GitHub Copilot CLI: the records read --last-message reads) and in the history of every pane, shells included. It is the same search as in sessions in the window, and leaves out panes of projects being closed and workspaces being removed.

Terminal window
cornercase search 'migration failed'
cornercase search --json checkout
pane=$(cornercase search --json 'tax bug' | jq -r '.matches[0].pane')
cornercase focus --pane "$pane" --reveal 'tax bug'

--settings also looks in the settings, as the search in the window does: --json adds a settings list with the fields of config search, left out when nothing matches, and text prints them as a second table after a blank line. Without it, search only looks in what was said. On a server without it the command says so.

Text is one line per match under a header, separated by tabs, the way status --panes is. Matches come in the order of the sidebar, an agent’s messages first, newest first, then the pane’s history from the bottom up.

pane who source place line text
4 claude reply web-shop › feat/dark-mode › claude - The checkout tax bug is in src/checkout.rs:42, where the rate is rounded twice.
4 claude prompt web-shop › feat/dark-mode › claude - Why is the checkout tax wrong for gift cards?
9 zsh screen orders-api › main › zsh 118 migration failed: duplicate key value violates unique constraint
Column What it holds
pane The pane’s id, for read, send, focus and the other commands.
who The agent’s name, else the program in the foreground.
source prompt or reply when it comes from an agent’s record, screen when it comes from what the pane printed.
place project › workspace › tab.
line The line in the pane’s history, for screen matches; - for an agent’s messages.
text The matching line, cut to about 160 characters around the match.
  • A - stands where there is no value, and a tab or a line break shows as a space, so every row is one line with the same columns. New columns only ever go at the end.
  • A match of a screen that the agent’s record already holds (agents print what they say) is listed once, as the agent’s message.
  • It lists at most 20 matches per pane and 300 in all. With --json capped says some were left out.
  • No match prints the header alone and exits 0, since finding nothing is an answer. An empty search is an error.
  • --json prints {"matches": [...], "capped": false}, each match with pane, tab, workspace, project (the ids), place, who, source, line (null when there is none), text and written (when an agent’s message was written, in UTC, or null).
  • The text you search for is never written to server.log.
  • focus --pane ID --reveal TEXT goes to the pane, scrolls it to the text and selects it, as Enter on a result in the window does. TEXT is what you searched for. --line takes a screen match’s line; leave it out for an agent’s message, which takes the newest place the pane shows the text. --json prints revealed, which is false when the pane no longer holds the text: the pane is still shown, a warning goes to stderr and the exit status is 0. A program that reads the mouse takes the pane back to the bottom. With --view ID the view shows it, not the window.
  • Over the socket: {"command": "focus", "args": {"item": {"pane": 9}, "reveal": {"query": "migration failed", "line": 118}}} answers {"ok": {"revealed": true}}. Check the focus-reveal feature first: an older server ignores reveal and only shows the pane.
Terminal window
cornercase open ~/code/orders-api # prints the project's id
cornercase open ~/code/orders-api --into 3 # the same, in group 3
cornercase new-workspace experiments # a workspace in the project's folder
cornercase new-workspace fix/login --worktree # a git worktree on branch fix/login
cornercase new-workspace fix/login --worktree --fresh # from the up-to-date default branch, fetched first
cornercase new-tab --name server -- npm run dev # prints the new pane's id
cornercase split --down -- tail -f server.log # splits the pane below
cornercase setup --worktree fix/login # runs its setup again, prints the pane's id once it is done
  • open finds a project that is already open instead of opening it twice. --into GROUP puts it in that group, as the group’s add project does, moving it there when it is already open; a group that isn’t there is refused before anything opens.
  • new-workspace adds to the project the command runs in (--project ID for another one). With --worktree, the project must be at a repository’s root, as in the new workspace dialog: the checkout goes in the worktrees folder from settings, the branch is created from HEAD when it does not exist, and, when the project has no setup, the command returns once git has made it. Each new workspace gets one tab, which runs the project’s setup first when it has one; new-workspace --worktree and start --worktree wait for it and answer an error naming the exit status if it fails, or saying so if its tab closes first; status --json shows a workspace’s setup as running or failed. close --remove-worktree runs the project’s teardown first; if that fails the worktree is still removed and the command prints warning: … on stderr.
  • A branch that does not exist yet starts from the project’s HEAD. --fresh ("fresh": true over the socket) makes it from the project’s default branch, fetched from its remote first (origin, else the first one), as a routine’s runs do, and --no-fresh ("fresh": false) asks for HEAD whatever settings → Worktrees → new branches (fresh_branches) says. Both go on new-workspace --worktree, start --worktree and start --issue, flow run and queue add/edit. A fetch that fails fails the command with git’s reason (could not fetch origin: …) and makes nothing; a branch that already exists is checked out as it is, with no fetch. --fresh needs the fresh-branches feature, which an older server lacks and would answer by branching from HEAD, so the command checks it first; --no-fresh checks nothing.
  • new-tab opens the tab in the workspace the command runs in (--workspace ID or --worktree BRANCH for another one). split splits the pane it runs in (--pane ID for another one), and refuses a pane too small to split.
  • setup runs the project’s setup again in a new tab of the worktree the command runs in (--workspace ID or --worktree BRANCH for another one), as run setup in the workspace’s menu does: with CORNERCASE_ROOT, CORNERCASE_WORKTREE and CORNERCASE_BRANCH set, the workspace’s setup reads running and its failed mark is gone, agents started there wait for it, and the tab then becomes a shell. Typing the script into a new-tab does none of that. It answers as new-workspace --worktree does, once the setup is done however long it takes: the new pane’s id, or --json’s ids, or status 1 and an error naming the exit status and the pane to read, or that its tab closed before it ended. It refuses, with status 1 and the reason (conflict on the socket), what the menu does not offer: a workspace that is not a worktree, a project with no setup, a setup already running. Stopping the command does not stop the setup: press Ctrl+C in its tab (keys --pane N ctrl+c) or close the tab. On the socket it is {"command": "run-setup", "args": {"workspace": 16, "focus": false}}, and a server without it refuses the name. A program that offers it reads worktree and setup from status --json and the project’s setup from config.
  • After --, the words of a command are joined with spaces and typed at the prompt once the shell is ready, as ssh does with its command, so quote what the shell should read as one argument: -- 'cargo test 2>&1 | tee test.log'. The command returns once it is typed.
  • Each prints the new pane’s, workspace’s or project’s id, so pane=$(cornercase new-tab …) needs nothing else. --json prints every id: {"project": 1, "workspace": 2, "tab": 8, "pane": 9}.
  • --focus also shows what was made.
  • --machine NAME makes the workspace on one of your machines instead: see Start work on a machine.
Terminal window
cornercase open ~/code/work.code-workspace # prints the group's id
cornercase open ~/code/work.code-workspace --focus # also shows its first project
cornercase open ~/code/work.code-workspace --into 3 # into group 3
cornercase --remote devbox open '~/code/work.code-workspace' --json

open also takes a .code-workspace file and imports it as the folder picker does: a group named after the file (a group of that name is reused), each of its folders a project in it, in order. A folder that is already open moves into the group, a folder’s name names a project you haven’t named, and folders that are gone or on another machine are skipped. A folder named work.code-workspace is still a folder, and any other file is refused as before.

  • The file is read on the server’s machine, so with --remote it is the other machine’s, given by its absolute path or with ~/, quoted so that your shell leaves it alone.
  • --json prints {"group": 3, "name": "work", "projects": [4, 5], "missing": 1, "failed": 0}: the group’s id (null when nothing could be imported, since the new group is then removed), its name, the ids of the projects, in the file’s order, how many folders were not found, and how many could not start a shell (server.log says why). A folder on another machine (a vscode-remote:// address, a network path on Windows) is in neither count, as the picker’s message leaves it out. With --focus --view it adds projection.
  • It exits with 3 when a folder was not found or couldn’t start its shell, or nothing was imported, after printing all that, and without --json says so on stderr: warning: 1 project imported into work, 1 not found. A folder on another machine doesn’t change the status. A file that can’t be read or parsed is an error, and nothing changes.
  • Nothing moves in the window without --focus, and a folded group stays folded. --into GROUP imports into that group whatever its name, and the group stays even when nothing came in.
  • It is the request {"command": "open", "args": {"path": "~/code/work.code-workspace", "focus": false, "into": 3}}, without into for a group of its own. Check the open-code-workspace feature before sending into, which an older server ignores and then opens the folder outside the group, or before offering these files, which it refuses as … is not a folder.
Terminal window
cornercase clone git@github.com:acme/orders-api.git ~/code # prints ~/code/orders-api in full
cornercase clone https://github.com/acme/orders-api # into the current folder
cornercase --remote devbox clone git@github.com:acme/orders-api.git ~/code

clone runs git clone on the server’s machine into a new folder inside FOLDER, named after the repository as git names it (orders-api for both URLs above; a ?query or #fragment of the URL is left out), opens that folder as a project, as open does, and prints its path once git is done. Without FOLDER the clone goes in the current folder, and with --remote in the other machine’s home folder; a FOLDER given with --remote is that machine’s, absolute or starting with ~/, and a FOLDER with .. in it is refused. Folders missing on the way are made.

  • A cornercase-access bot’s clone is refused: exit 1, code failed, a bot cannot clone a repository; clone it yourself and the bot can work in the project.
  • A folder of that name that exists and is not empty is refused; an empty one is used. While a clone runs, another one into the same folder, or into a folder inside it or around it, is refused.
  • A repository on the same machine can be given by its path: a relative one is read from the folder you run the command in. With --remote, give the other machine’s absolute path.
  • A repository named .git (such as …/.git.git) is refused, since its clone would be a .git folder that every git command under FOLDER would read.
  • A clone that fails leaves no folder behind, the folders it made on the way included, and says what failed: the URL is not a git repository (or one you can read), access was denied, or git’s own reason, such as a host it cannot reach. A folder that was there before is never removed. The messages never repeat the URL (git’s own reason may name its host and path, never its user name, password, query or fragment), so a token in it stays out of them and out of the log.
  • git never asks for a password, a passphrase or a browser login: it uses the ssh keys, ssh agent and git credentials of the server’s machine as they are, and a missing one fails at once as access denied. Prefer a credential helper to a token in the URL: like git clone, the clone keeps its URL in .git/config.
  • The command waits for git with no timeout, as long as the clone takes. Stopping the command does not stop the clone, and its project still opens.
  • --json prints {"path": "/home/ana/code/orders-api", "project": 4, "workspace": 9, "tab": 12, "pane": 13}. --focus also shows the project; when the view it should show in closed while git ran, the clone is still answered, without showing it.

--file copies files into the new clone once git is done, such as the git-ignored .env a project needs to run, as the Clone on machine dialog does with the ones you tick:

Terminal window
cornercase clone --list-ignored --from ~/code/orders-api --json
cornercase --remote devbox clone git@github.com:acme/orders-api.git '~/code' --file .env --file web/.env.local --from ~/code/orders-api --json
  • --file PATH, repeated for more, is read by the command, on the machine it runs on also with --remote, and sent with its permissions. PATH goes from the root of the repository that --from FOLDER is in (the current folder by default, and always a folder of this machine).
  • These are refused before anything is cloned, naming the file at fault and never the URL: a path that is absolute, goes up with .. or goes into .git (status 2), and a file that isn’t there, a folder, a link, a file over 1 MiB, more than 200 files or more than 8 MiB in all (status 1).
  • A file the clone couldn’t take, such as one the repository has, isn’t written and doesn’t undo the clone. The command names it on standard error (not copied: README.md (it is already in the clone)), or --json lists it under unwritten, and it exits with status 3.
  • cornercase clone --list-ignored [--from FOLDER] prints what the dialog offers and clones nothing: the git-ignored files in that folder, each by its path from the repository’s root, without ignored folders or links, and how many more past the first 200. --json prints {"root": "/home/ana/code/orders-api", "files": [{"path": ".env", "size": 42, "mode": 384, "too_big": false}], "left_out": 0}, where too_big is a file --file refuses. It reads this machine’s folder, so it needs no server, and --remote changes nothing for it: the files are here even when the clone goes elsewhere.
  • On Windows, --file and --list-ignored say they aren’t supported yet, and nothing is cloned.

It is the request {"command": "clone", "args": {"url": "…", "parent": "~/code", "focus": false}}; a refusal has the code not-found when the URL is not a repository, conflict when the folder is not empty, busy when a clone into that folder, or into one inside or around it, is already running, malformed for a relative folder or one with .., a relative path to a repository, or a URL with no usable name in it, and failed for the rest, access denied included. An older server answers that it has no such command. There is no button for it in the window: the one place the window clones is on a machine.

files is what --file sends, for a client that reads the files itself: each has a path relative to the clone, its data in base64, and its mode (420, that is 0o644, when left out). A path that is absolute, goes up with .., goes into .git or names a file the clone already has is not written, and more than 200 files, or more than 8 MiB in all, refuses the request as malformed before git runs, as bad base64 does. A file that can’t be written doesn’t undo the clone: the answer lists it under unwritten, with its path and why. The log says how many files and bytes, never their names or content. On a server running on Windows, files are not written yet: each one comes back in unwritten, saying so, and the clone itself is made.

Terminal window
cornercase start claude --worktree fix-login --prompt 'Fix the login form, then commit'
cornercase start codex --prompt-file task.md --wait --timeout 1800
git diff | cornercase start claude --prompt-file -
cornercase start claude --worktree fix-login --placed --json

start does what start does in the issue browser: it opens a tab, types the agent’s command with its arguments and mode from settings → Agents, waits for its folder trust question to be answered (by you, unless trust prompts is on), and once the agent is ready pastes the prompt and presses Enter (Claude Code gets the prompt once it wrote its session file, turned bracketed paste on and drew its input box, and its Enter is pressed again every 3 s while it sits idle without taking the prompt, at most 5 times). It returns then, printing the pane’s id, or fails if the agent never shows up. When Claude Code never takes the prompt, the answer has "unsent": true and a warning (printed on stderr as warning: …, kept in the --json document), and with --wait the command fails with that text; check the prompt-unsent feature before relying on it. The prompt may still be in the agent’s input box: keys --pane ID enter sends it.

  • Which agent: the one you name (claude, codex, gemini or any other kind); without one, the default from settings → Agents, or, when that is auto, the agent running in the pane the command runs in.
  • Where: a new tab in the workspace the command runs in; in another workspace with --workspace ID; or with --worktree BRANCH, in the workspace on that branch, made as a new worktree when there is none.
  • --name names the tab, --prompt gives the prompt and --prompt-file reads it from a file, or from standard input with -. Without a prompt, the agent just starts.
  • --model starts it with that model, through the agent’s own flag (--model opus, --model gpt-5.5), replacing a model set in its arguments. --mode picks another of the agent’s modes, as settings → Agents lists them (--mode plan), instead of the one chosen there; --mode default starts it with no mode arguments, only its extra arguments, whatever mode is chosen there. A mode the agent lacks is refused with the list of its modes, default first. --effort sets how hard the agent thinks, through its own switch (--effort high for Claude Code, -c model_reasoning_effort=high for Codex, --reasoning-effort high for Grok Build and GitHub Copilot CLI; Cursor CLI takes it in the model id), replacing an effort set in its arguments; a level the agent does not take is refused with its levels, and Gemini CLI, opencode and Cursor CLI, which have no effort switch, refuse any. A server older than these options refuses them rather than start the agent with the settings’ mode, which could be one that never asks.
  • --issue KEY starts the agent on an issue, as the Issues dialog’s start does: the branch is the one named after the issue (or what settings → Worktrees → issue branches makes of it; --worktree BRANCH names another), the prompt comes from settings → Issues → prompt, and it is always submitted, whatever send the prompt says there. A key such as #482, sc-48 or ENG-42, or the issue’s URL; --source picks the tracker when a key could be several. A GitHub or GitLab issue is worked on in the repository of --project ID (default: the one the command runs in, else the shown one), in a worktree on its branch; a workspace already on that branch gets a new tab with the agent. Shortcut, Linear, Jira, Plane and Asana issues aren’t tied to a repository, so with several places open the command lists them and asks for --project ID (a new worktree) or --workspace ID (a new tab). The workspace is named after the issue unless --workspace-name NAME (the workspace_name field) says otherwise, and so is a tab unless --name does. --workspace-name needs a server with the issue-names feature, which the command checks first, since an older one would ignore it. --prompt or --prompt-file with --issue add your own words after the issue’s prompt, a blank line between them (--issue '#482' --prompt 'only the API'), and the branch, the worktree and the names are still the issue’s; over the socket, start and start-with take prompt together with issue. That needs a server with the start-issue-prompt feature, which the command checks first, since an older one refuses the two as malformed, or, older still (without issues), ignores issue and starts the agent without it, or answers unknown-field to a request with contract or boot.
  • --wait then waits like wait does, and prints how it ended on a second line. --until with one of wait’s states (idle, working, waiting, shell, turn-over) waits for that one instead.
  • --placed ("placed": true over the socket) answers as soon as the tab is open, after its worktree is made or its issue read, with the same ids, and the launch goes on, as the window’s dialogs do. It is for a program that shows the new tab itself: without it, the ids wait for as long as the agent’s trust question stays. The agent still gets its prompt once it is ready, even after you answer its question, but the command can no longer say that it never showed up. wait and send only work once that launch is over, and the answer doesn’t mean it is. Until the agent runs, wait answers runs no agent; until its prompt is typed, wait can end on idle; and send goes to whatever reads the pane then, the shell, or the trust question, which it would answer. status has no field for the launch, so read the pane there: agent is null until the agent runs and reports, and at_prompt true while its shell still waits for it; agent with the status idle only says it runs, since it may still be asking its question and its prompt may not be typed; and the status working says it took its prompt, so the launch is over. Once agent is there, wait --until working waits for that. Without a prompt, or with an agent that reports no status, only its screen says so (read). To send or wait right after start, leave --placed out: its answer then comes when the launch is over. It takes no --wait, --until or --timeout (over the socket, wait or timeout with it is malformed). An older server would ignore it and hold its answer, so check the machine-start feature first, as the command does; it came with placed.
  • --folded ("folded": true over the socket) starts the agent collapsed in the agents section, as collapse --pane would fold it: the agents it starts stay hidden under its row (▸ +n) until you expand it, and status says collapsed from its first answer, even a --placed one. The fold belongs to that agent, as one made with collapse does: expand --pane ID or jumping to one of its hidden agents opens it, a later agent in the pane starts expanded, and an agent that never starts leaves no fold. An older server would ignore it, so check the start-folded feature first, as the command does. With --machine that check is of this server’s features: a machine running an older cornercase refuses the field with unknown-field once it has reported its first snapshot, and before that may drop it and start the agent expanded.
  • --machine NAME starts the agent on one of your machines instead, with that machine’s ids, agents, accounts and trackers; it takes no --wait, --until or --timeout. --machine auto picks this computer or the machine with the project and the most free memory, with this computer’s ids. See Start work on a machine.
Terminal window
cornercase account add claude work --login
cornercase account login claude work --focus
cornercase account list --json
cornercase account use claude work
cornercase account rename claude --system Personal
cornercase start claude --account claude= --prompt 'fix the tests'
cornercase profile new Work claude=work codex=work
cornercase profile use Work
cornercase start claude --profile Home --prompt 'fix the tests'

account and profile manage the accounts and profiles agents start with. Every answer has the same shape (--json): the agents that take accounts, each with its variable, its accounts (name, canonical path, label when you named it, and unshared, the settings that stopped being links), system_label, system_path and system_login for the agent’s own login, and active, its default account (left out for its own login); then the profiles with their accounts, and profile, the active one ("" for none). account use AGENT ACCOUNT (account-use) makes an account that agent’s default (--system, "" on the wire, for its own login), the one new workspaces and requests without a pane start with, keeping the other agents’ and leaving any active profile; account rename AGENT ACCOUNT NAME (account-rename) sets the name the window shows (--system for the agent’s own login, --clear or "" to remove it): a name already used by another account of that agent is a conflict. Both name an account by its folder, never by its name. --account AGENT=ACCOUNT on start, new-tab, flow run and queue add|edit (the accounts field, AGENT= for its own login) starts with that account once, over a profile; --profile NAME on start, new-tab and flow run uses a profile once without changing the active one (--profile '' is every agent’s own login). Without --profile, start and new-tab run inside a pane of this server start from that pane’s accounts, as split does, --account changing only the agents it names; from outside a pane, and flow run always, start from the default accounts. An unknown agent, account or profile fails with not-found before anything opens. A server without accounts, or without account-switch for --account, would ignore the field, so the command checks the server’s contract first and refuses. profile use --system (profile-use with "") also forgets the accounts chosen with account use, so every agent goes back to its own login. status --app gives accounts, each agent’s default account, and accounts_revision, which moves when the accounts themselves change. status --json names a pane’s account, and a pane’s opened event its accounts. account list --check (the check field of account-list, behind the account-login feature) first asks each account whether it is logged in, with the agent’s own claude auth status or codex login status, and answers once they have all replied: each account then has login (state: signed-in, signed-out, unknown or failed; email and plan when the agent gives them; checked, UTC). tokens lists the names, never the values, of the token variables set where the server runs, which win over the accounts. With check, agents lists each agent the server knows, with its command and installed, whether the server finds that command on its PATH (a shell in a tab may find more). A queue entry keeps its accounts; one whose account was removed before its time fails and says why.

account login AGENT ACCOUNT (account-login-tab: provider, account, "" with --system for the agent’s own login, workspace, focus) opens the tab account add --login opens, for an account that exists or the agent’s own login, and answers the same shape with login, the tab’s ids. An unknown account is not-found; an agent without accounts, or without a login command (Gemini CLI), is malformed. --focus shows the tab in the window, or with --view ID in that view (--json adds the view’s projection), and account add --login --focus takes --view too. A server without the account-login-tab feature is refused up front, naming the update. Through --remote the tab opens on that machine.

Terminal window
cornercase account restart claude # every open claude on another account, onto the default
cornercase account restart claude personal --pane 4 --json
cornercase --remote vps account restart claude work --pane 9 --json --boot 4242-1700000000

account restart AGENT [ACCOUNT] (account-restart, behind the account-restart feature) restarts open agents on another account, in the same pane and conversation: every pane of that agent whose account is not ACCOUNT (its default when you leave it out, --system or "" for its own login), or only the panes given with --pane (panes). It answers once each agent that could restart now has its conversation in the other account’s folder, with restarted (the panes restarting now), waiting (the ones that restart when their turn is over) and skipped (pane and why: a flow’s agent, a custom account, a pane that already uses that account, a conversation that could not be moved). A pane given with --pane that is a shell at its prompt, without that agent, starts a new shell in its place and folder with that account and is listed in restarted; one running another program is skipped with stop <program> first, and one being set up or resuming with wait for its setup or wait for it to resume. Without --pane, shells are left alone. A pane given that does not exist is not-found before anything restarts, and an agent without accounts malformed. A server without account-restart would refuse the request, so the command checks the contract first. With --boot BOOT, a server that restarted since you read the pane ids refuses with status 4 and restarts nothing. Each restart is logged in server.log (agent restarted, with how the conversation went: linked, copied, moved or fresh).

Terminal window
cornercase flow list
cornercase flow run Quick --prompt 'Fix the login form'
cornercase flow run 'Full issue' --prompt-file issue.md --worktree fix-login --json
cornercase flow run 'Full issue' --issue ENG-42 --project 3
cornercase flow run 'Full issue' --issue '#482' --prompt-file task.md

flow list prints each flow, yours, the built-in ones (those you have not replaced) and the project’s, in the user’s order (by name for the flows not placed in it) with the default one tagged default, with its description, its roles with their agents, models and efforts, and what keeps it from running, if anything; files it cannot read are listed with their error. flow run starts one as the window’s start does: it makes the worktree (from --worktree, else from the task’s first words, with a short suffix when they give nothing, a default branch or a branch already taken), opens a tab per role, starts every agent without permission prompts and answers their trust questions, and starts the orchestrator last with its brief. It answers once the tabs exist, while the agents are still starting: the workspace’s id, then one line per role with its pane’s id and the role’s name, separated by a tab. The run’s folder for its files is printed on stderr (run_dir with --json), and every pane of the team has it in $CORNERCASE_RUN_DIR. Before any agent starts, the task is saved there as task.md, byte for byte the run’s task in flow runs --json. To follow a run’s end, watch run.reached in status --follow; run.close_when_merged says the run will close its agents once merged.

8
10 orchestrator
12 coder
14 reviewer
  • A role set to worktree = "own" gets a worktree of its own on the branch <branch>--<role>, made from the run’s branch, with the project’s setup. --json then adds, for each such role, its worktree (the folder) and branch; the other roles’ entries have neither. The answer waits for every worktree and its setup, and a role worktree that cannot be made opens nothing.
  • The task comes from --prompt, or from a file with --prompt-file (- reads standard input), or from an issue with --issue KEY, as the dialog’s start a flow takes it: its branch (--worktree names another), its prompt template (--prompt or --prompt-file with --issue replace it with your own task and keep the issue’s branch and name, behind the flow-issue-prompt feature, which the command checks first), the workspace named after it (--workspace-name NAME names it otherwise, behind the issue-names feature) and, for an issue that isn’t tied to a repository, --project ID when several projects are repositories (see Issues).
  • The flows of the project the command runs in, else the shown one, else --project ID, are found too. A name is looked up in yours, then the built-in flows, then the project’s: yours replaces a built-in flow of its name, and a project’s flow, which comes with the repository, never stands in for another of the same name; the command says so on standard error when a name is in several places. A built-in flow you deleted in settings → Flows is refused, and keeps its name: a project’s flow named like it does not run either. An unknown name lists the flows.
  • It refuses before anything opens a flow with problems, an agent that is not installed, a project that is not the root of a git repository, a branch that already runs a flow, and a --worktree that is main, master, the project’s default branch or the one its own folder is on: a flow works on a branch of its own.
  • Nothing changes in the window unless you pass --focus, which shows the orchestrator’s tab and opens the Flow panel. A program that draws cornercase itself adds --view ID: the orchestrator’s tab then shows in that view instead, --json adds the view’s projection, and the window and its Flow panel stay as they are (draw your own from flow runs). A server without the flow-run-view feature is refused up front, naming the update. With --machine, --focus takes no --view.
  • --close-when-merged closes the team’s agents, as agents close does (and tells programs that draw cornercase, as a flow-merged message on events --notices), once the run’s pull request (or merge request) has merged and none of them has worked, waited, started or been typed into for 3 minutes; a shell in one of the team’s tabs keeps them open, and nothing is removed. With --free-builds too (it needs --close-when-merged, a usage error without it, and a server that knows the flow-free-builds feature), the build folders of the run’s worktree and of its roles’ own worktrees are freed once the agents closed, as worktrees free-builds does without --force (a program running there, or a git checkout inside, keeps them); the flow-merged message then comes once that is done, a few seconds after the agents close, and says what was freed or why not (… 5 agents closed, 15.7 GB of builds freed, with failed: true when something could not be freed), and --json has free_builds: true. A flow that leaves the commits is refused before anything opens, and a server without the flow-close-when-merged feature is refused up front, since it would start a run that never closes its agents. --json has close_when_merged: true, and the text form prints one more line on stderr naming agents reopen --workspace ID. With --machine the machine’s own server does the closing, and the up-front refusal is of this server’s features: a machine running an older cornercase that has not yet reported its first snapshot may drop the field and start a run that never closes its agents, which the answer shows by lacking close_when_merged: true (or free_builds: true). See Close them once the pull request merges.
  • --folded ("folded": true) starts the orchestrator collapsed in the agents section, its team hidden under its row; the members get no fold of their own. It needs the start-folded feature, as start --folded does, and with --machine a machine running an older cornercase may likewise drop it and start the orchestrator expanded.
  • --machine NAME runs the flow on one of your machines instead: that machine’s flow of that name, with its agents and accounts. --machine auto picks this computer or the machine with the project and the most free memory, counting the flow’s memory. See Start work on a machine.
  • --boot BOOT (also on flow list, export, import, save, delete, default, order, close-when-merged, messages and files) says which run of the server the --project, --workspace or --view id is from, as Arrange says: one that restarted since refuses with status 4 and nothing runs, is saved or is listed. With --machine it is the boot of that machine’s entry instead (see Start work on a machine).

flow export NAME prints a flow as TOML, so cornercase flow export Quick > quick.toml makes a file to send, and --json prints its name, origin, path and text. flow import SOURCE (a file, - for standard input, an https:// address or OWNER/REPO on GitHub, see community flows) adds one to yours, or to the project’s with --to project, and prints where it went. A flow from an address or a repository, or that sets env or args, asks first, or needs --yes without a terminal; a name that is taken is refused unless --replace overwrites it or --name gives the new one another. A text over 256 KiB is refused. See Share a flow.

flow import SOURCE --check --json previews an import without asking or saving, including with no terminal or with - for standard input. It sends flow-import with check: true, using the same --to, --project, --name and --replace options as the later import with --yes. The answer has name, origin (user or project), path (null when checking), replaced (whether an existing file would be overwritten), and roles (orchestrator first, each with role, agent, model, effort, edits and optional worktree (own; omitted for a shared worktree)). Optional check names the variables and arguments that run unattended; the CLI adds the warning about an unreviewed source when fetching from the web. Optional note names agents that are not installed here. These fields are also available over the socket and after an import; older servers omit roles and check, which the CLI fills from the source it already read before printing either text or JSON. Without --json, the preview is text on standard output. A successful check exits 0; bad text, a flow that cannot run or a name conflict exits 1. --check and --yes cannot be combined.

Terminal window
cornercase flow list --json
cornercase flow save draft.json --check
cornercase flow delete 'Quick mine'
cornercase flow hide Quick
cornercase flow restore Quick
cornercase flow default Quick
cornercase flow order Quick 'Full issue'
cornercase flow sync Review --machine vps --json

Each verb means one thing. flow delete NAME deletes the file of a flow of yours or the project’s (--in yours or --in project when both have the name, --project ID, or --path FILE for a file that cannot be read, as flow list --json gives it) and nothing else: a run already going keeps the plan it was started with. It refuses a built-in flow, which has no file, and your version of one, with the command that does what you mean (conflict). flow hide NAME is what the delete button of settings → Flows does with a built-in flow: it hides its name, and deletes your version of it if you edited it. flow restore NAME brings a hidden built-in back and deletes your version of it. Both change nothing when there is nothing to do (changed is false), and name only built-in flows (not-found for others). None asks first, and --json prints name, origin, deleted (the file), hidden and changed.

flow sync [FLOW] sends your flows, or only FLOW, to every machine that is linked and shown here, or only --machine NAME’s, and waits for their answers: the request is flow-sync (name and machine, each left out for all), behind the feature flow-sync. Nothing is sent on its own, and nothing is deleted there. --json prints machines, one per machine, each with machine, sent and kept (newer there, left alone), each a list of flow names, same (how many were already the same), failed (name and error of each flow that did not go: refused there, too large to share, saved with a time ahead that could not be fixed, or two files of yours with that name; name is instead the file’s name for a file of yours that cannot be read, and the folder’s path when the folder of your flows cannot be read) and error (why it could not be reached, as for one that is not linked now, or it runs an older cornercase: update it there, then sync again for a machine on a release without the feature flow-sync, which is sent nothing). The command exits with status 1 when a machine has an error or a failed entry, after printing the answer. It is refused as conflict when no machine is shown here or FLOW is a built-in you did not change, and not-found for a hidden or unknown machine or a name that is none of your flows (unless the folder of your flows cannot be read: that is then a failed entry). flow list --json gives a flow of yours changed, the time it was last saved; a synced import is a flow-import with synced_from, the sending computer’s name, which keeps the flow’s changed (unless it is more than 5 minutes ahead of the receiving computer’s clock: the flow is then saved with that computer’s time), does not ask, and is refused when the copy it would replace was saved later.

flow default NAME is what set default does in settings → Flows: the start dialog opens with that flow selected, as long as it can start, and --clear chooses none. flow order NAME… puts the flows in the order you name, as dragging them does; the flows left out go after, by name, and --clear gives name order back. Both take --project ID for the flows they look in, accept a name ignoring case, and change nothing when there is nothing to do (changed is false). A name no flow has is not-found (and so is a built-in flow that was deleted), a blank name or a name given twice is malformed, and a flow with problems can still be the default. --json prints name and changed for flow default, and names (every flow of the scope in its new order) and changed for flow order. The requests are flow-default (name, null to clear it, and project) and flow-order (names and project); an open Flows dialog refreshes. flow run NAME still needs the name: a script says what it runs.

An app with an editor of its own works on the flow as JSON. flow list --json gives each flow whole as flow: name, description, notes, end (pull_request or commits), memory (the free memory a run needs, as written, left out when the flow says none), orchestrator and roles (each with name, agent, model, effort, persona when it has one, args, env, edits, worktree (shared or own) and prompt) and stages (roles and back, null or to counted from 1, as in the file and the editor, when and at_most), with edited for your version of a built-in. The deleted built-ins come as hidden, and builtins lists every built-in name, which stays reserved even while it is hidden. The request flow-save takes that same flow, place (yours or project), project, path (the file of the flow being edited, as flow list --json gave it, when it is renamed or moved: the old file is deleted; any other path is not-found) and check:

{"command": "flow-save", "args": {"flow": {"name": "Quick mine", "description": "", "notes": "", "end": "pull_request", "orchestrator": {"name": "orchestrator", "agent": "claude", "model": null, "effort": null, "args": [], "env": {}, "edits": false, "worktree": "shared", "prompt": "Run it."}, "roles": [{"name": "coder", "agent": "claude", "model": null, "effort": null, "args": [], "env": {}, "edits": true, "worktree": "shared", "prompt": "Write it."}], "stages": [{"roles": ["coder"], "back": null}]}, "place": "yours", "path": null, "check": true}}

With check it answers problems (what the editor shows in red: the flow’s own, then a name conflict), own_problems (how many of problems, from the first, are its own) and the check text (what a project’s flow runs unattended: its env and args), and writes nothing; without it, it saves, answers the path and is refused as malformed while the flow has problems of its own. So an editor keeps its save available while own_problems is 0: a name conflict alone, another flow of that name that runs instead, is saved and listed, as Settings › Flows does. A save answers 0 (and the conflict it now has); an older server leaves the key out. A request is not-found for a project that is not open and a path that is no flow file, and malformed for another place. The last write wins over an editor open on the same flow, as with a file edited by hand. The editor’s form offers a role the agents whose flows is true in config --json’s agents, their models as suggestions (and, for one whose catalogue is true, the whole list config models gives) and their efforts as the effort’s choices.

flow save FILE sends that request from the command line, with the flow read as JSON from a file or, with -, from standard input (at most 1 MiB): cornercase flow list --json | jq '.flows[0].flow' > draft.json gives one to edit. --to yours or --to project is the place (by default the place of the --path file, else yours, so an edit never moves a flow unless you ask), and --project ID, --path FILE (taken without . and .., so it matches the path flow list --json gives) and --check are the request’s. Keys left out take their defaults, so a form can send only what it has, and a key a flow does not have is refused with its place (roles.0.promt). It prints where the flow went and what still stops it from running; with --check it says whether the flow can be saved (a name conflict alone does not stop it), prints the problems and saves nothing, and exits with 0 whether or not the server finds problems (a draft the command cannot read, such as invalid JSON or a stray key, is still an error). --json prints the request’s answer. Without --path it makes a new flow, so save again with the --path it printed: the same draft saved twice makes a second flow of that name, listed with the clash.

Terminal window
cornercase issue sources
cornercase issue list --source github --assignee me
cornercase issue list --closed --json
cornercase issue list --query login --json
cornercase issue list --source github --after 100 --json
cornercase issue list --all-projects --json
cornercase issue read '#482'
cornercase issue people jira
cornercase start claude --issue '#482'
cornercase start claude --issue '#482' --prompt 'Only the API, leave the UI alone'

These read the trackers through the connections the server already holds, the ones the Issues dialog uses: GitHub through gh, the others through the tokens saved in settings or set in the environment. They change nothing at a tracker. Another program that wants the issues gets them without keeping a client for each tracker or a token of its own.

issue sources says, for the project (--project ID, default the one the command runs in, else the shown one), which trackers are connected and as whom, in the order of the dialog’s tabs, then the others. Each is one of:

  • connected, with its account and where its token comes from (through gh, saved, or from LINEAR_API_KEY, followed by over the saved one when a saved token is there too but unused). In --json, from is gh, saved or env, env names the variable, and shadowed is true when the variable hides a saved token.
  • missing, with what is missing: token (connect it with cornercase config secret SOURCE, the token on standard input), site and email for Jira (cornercase config set jira_site …), workspace for Plane (plane_workspace), or repository (the project isn’t a git repository, or for GitLab none of its remotes is on gitlab_url). An Asana token with several workspaces shows as failing until asana_workspace is set.
  • failing, with the reason the last list failed (a rejected token, naming whether it was the saved one or which variable it came from, a rate limit, an Asana token that belongs to several workspaces). It is a list’s failure only, and the next good list or a change to that tracker’s token or settings clears it.

It ends with the places an issue that isn’t tied to a repository can be worked on: a repository-root project is a new worktree, an open workspace of any other project a new tab, and the one you are in is marked.

issue list prints one line per issue under a header, separated by tabs (source, key, state, author, updated_at, title, url, branch, project, with - for nothing; new columns only at the end). project is the id of the project whose repository a GitHub or GitLab issue belongs to, - for another tracker’s. Without --source it lists every connected tracker the project can use, newest first, as the dialog’s All tab does. --closed adds closed issues, and --assignee and --author (also --owner and --requester, --creator, --reporter, the names the dialog uses) take me, anyone, a handle or, for Jira, Plane and Asana, an id from issue people; a handle needs --source, since a filter names one tracker’s people. --cached answers from the lists the server already holds, without asking any tracker, and an empty answer then means nothing was held for those filters. A tracker that fails does not stop the others: it is named on standard error with its reason, its cached list (if there is one, and filtered by --query when one is given) is still printed for a first page, a later page (--after) prints nothing for it, and the command exits 3 after printing the rest (see Exit status).

--query TEXT sends the text to each tracker’s own search, so it finds issues beyond the newest hundred: GitHub’s search syntax through gh (a word, label:bug, sort:updated-desc), GitLab’s title and description, Shortcut’s search with its operators, Linear’s title or description, Jira’s text ~ and Plane’s search. Asana has no search for its lists, so cornercase filters the tasks it lists (up to ten pages of each) by key, title, state, labels and people, and standard error says Asana: filtered here, among the issues it listed. A search or a later page is never kept by the server; --cached --query filters the list it already holds the same way.

Lists come about a hundred issues at a time (Plane can give up to 199 when a creator filter is set). When a tracker has more, standard error names the command for the next page, with the filters you gave (GitHub: more with --source github --project 3 --query login --after 100), and with --json its entry in sources has a next: --after NEXT with the same --source, --project and filters prints the page after it. GitHub and GitLab say there is more when a page came full, so the last page can be empty, and GitHub stops at 1,000 issues; Asana has no pages. --after needs --source and cannot go with --cached or --all-projects.

--all-projects lists every open project at once: each account tracker (Shortcut, Linear, Jira, Plane, Asana) once, and GitHub or GitLab once for each project that is a repository, each issue with its project; --source narrows it to one tracker.

issue read KEY prints the issue’s title, the dialog’s info line, its URL and the branch start would use, then its description as Markdown and its comments. KEY is a key or a URL, as for start --issue; a URL of another repository, site or workspace than the project’s is refused. issue people SOURCE prints whom that tracker’s filters can name, one per line with the handle, name and id.

With --json, sources prints {"project", "closed", "sources": [...], "places": [...]}, list prints {"project", "issues": [...], "sources": [{"source", "count", "cached", "account", "error", "project", "next", "search"}]} (each issue also has its project when it is a GitHub or GitLab one; next is there when the tracker has more, and search is "tracker" or "local" when the request had a query), read prints {"issue", "info", "body", "comments", "prompt"} and people prints {"source", "fields", "cached", "people"}. They are four requests, issue-sources, issue-list, issue-read and issue-people, with the same options as fields (people is the two filters in the order fields names them: "me", "anyone" or {"person": {"handle": "bo", "id": null}}). issue-list also takes query, after and all_projects. A request is refused with not-found for an unknown project, malformed for an unknown source or a person without one, an after without source, with cached or all_projects, or for Asana, and all_projects with a project, and conflict for an issue of a tracker that is not connected or that was reconnected while it was read. start and flow-run take issue and source, which an older server would ignore, so check the issues feature first. flow-run also takes prompt together with issue, in place of the template’s; an older server refuses both as malformed, so check flow-issue-prompt.

A bot with cornercase access writes only prompts to agents here: keys and input exit 1 with a bot cannot press keys or type as a window does; send, todo send, paste-file and held --send-now exit 1 into a pane that runs no agent, or whose agent asks something, shows a dialog or its shell mode, or is starting, even with --force (a bot can only type into a pane that runs an agent, and …), and for a text starting with / or ! (a bot writes prompts to an agent, not its commands); new-tab or split with a command are refused too.

Terminal window
cornercase send --pane 12 --enter 'Now add tests for it'
cornercase send --pane 12 --enter --wait --timeout 900 - < next-step.md
cornercase send --pane 12 --enter --wait --until turn-over 'Run the tests'
cornercase send --pane 12 --enter --boot 4242-1700000000 'Now add tests for it'
cornercase keys --pane 12 ctrl+c
cornercase keys --pane 12 ctrl+c --boot 4242-1700000000
cornercase keys --pane 12 down enter
cornercase held --pane 12 --send-now
cornercase held --pane 12 --wait-turn --json
cornercase read --pane 12
cornercase read --pane 7 --lines 200
cornercase read --pane 12 --last-message
cornercase read --last-message --pane 12 --pane 15
cornercase read --last-message --pane 12 --pane 15 --json
cornercase read --pane 12 --pending --json
cornercase read --pending --pane 12 --pane 15
cornercase read --messages --pane 12 --last 5 --json
cornercase read --messages --pane 12 --before 41
cornercase read --messages --pane 12 --after 42 --json
  • send pastes the text in one go, bracketed when the program asked for it, as a paste from your terminal would be. - reads it from standard input. --enter then presses Enter once the screen settles.
  • With --enter, send to Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI or GitHub Copilot CLI returns once the agent has recorded the prompt in its own history (Claude Code’s transcript, Codex’s rollout, Gemini’s session file, opencode’s database, Grok Build’s session, Cursor CLI’s chat store), so its success means the prompt was submitted, not just typed. When the agent records nothing, it fails with not confirmed: the prompt may not have been submitted: read the pane before sending it again. Codex, Gemini, Grok Build, Cursor CLI, Vibe CLI and GitHub Copilot CLI keep a prompt sent while they work until they take it, so send returns then; --timeout gives up earlier, with status 1. Grok Build queues that one Enter. Pressing Enter again sends the queued prompt now and cancels the turn, which send does not do. A compact command (/compact for Claude Code, Codex and Vibe CLI) returns once the agent records the compaction, however long that takes while the agent works on it (a compaction of a long conversation can take minutes); --timeout bounds it. In any other program, send --enter returns once Enter is pressed.
  • From a flow’s orchestrator, a send that moves the work on to a stage while an earlier stage has not run since the last change (the work went back to a stage, and this one was skipped) still goes, and says so: warning: stage 3 (reviewer, security) has not run since the last change in stage 2: run it first, or say in your summary why not on stderr, so stdout stays what a script parses, and in the answer’s warning with --json. The same line, for every stage still owed, comes from mark on the orchestrator’s own pane.
  • GitHub Copilot CLI’s / and ! lines and a lone ? write no prompt record, so send --enter returns after Enter for them; ? text is a real prompt. A prompt typed while it works is queued, and Copilot records it when it takes it, so the confirmation waits for that.
  • Cursor CLI’s / commands and ! shell input return after Enter without a prompt confirmation too. Cursor’s chat store is read from its code, not a live session, so a prompt it records in a layout cornercase cannot read fails with not confirmed; read the pane then.
  • Gemini local slash commands, ? help and ! shell input return after Enter without a prompt confirmation, so they do not fail with not confirmed; use read to inspect their result. Gemini has no calibrated input-box check, so read its screen before sending into a picker or dialog.
  • --wait then waits until the agent stops working; it fails if the agent does not start working within 10 seconds of the Enter, rather than waiting forever for an agent that never got the text. --until waits for another of wait’s states, as start does.
  • send refuses a pane whose agent is waiting for an answer to a question or a permission prompt: whatever it typed would answer it. Answer such a prompt with keys, after deciding what the answer should be.
  • send also refuses a Claude Code agent that shows a dialog, a panel or its shell mode instead of its input box: in the details of a background shell an x stops the shell and Enter closes the panel, and in shell mode (!) a prompt would run as a command. cornercase tells from the screen, and only once it has seen that agent’s input box, so a Claude Code that draws it differently is never refused. Read the pane, close what is open and send again; --force sends anyway.
  • send also refuses a Claude Code agent that shows its feedback survey above its input box (How is Claude doing this session? (optional), then 1: Bad 2: Fine 3: Good 0: Dismiss): one digit sent alone answers the survey instead of reaching the agent, so send --enter 2, the answer to a numbered question, would be lost. cornercase keys --pane 12 0 dismisses the survey without answering it; then send again. --force sends anyway: a longer text hides the survey and goes to the input box, as when you type over it.
  • send also refuses a pane whose agent is resuming its conversation after a restart (resuming in status): before the agent is back, text would land in front of the resume command or in the agent’s start-up. Wait until status no longer shows it, or pass --force. keys is not refused.
  • send also refuses a pane that is a flow role whose agent exited (exited in flow runs), where the text would be typed into its shell, even with --force: cornercase agents reopen --workspace ID starts it again in that pane. The refusal has the code conflict, and todo send and the orchestrator’s own sends are refused the same way. held --send-now and the window’s send now do not return the conflict: the refusal goes to the sender of the held message, and held --send-now returns only what remains held. A pane outside a flow whose agent was quit takes send as any shell does; keys and input are not refused.
  • send, keys and held take --boot BOOT (see Arrange): they act only on that run of the server, and one that restarted since refuses with status 4 and nothing is sent or pressed.
  • send (with or without --enter) and todo send wait while a person is typing in the pane, so your text never joins theirs and they never send half a sentence. It waits while the pane has a draft (text typed or pasted into it from a window, the browser or cornercase input and not yet sent with Enter or dropped with Esc, Ctrl+C or Ctrl+U; a draft lapses after a minute without typing, and for Claude Code as soon as its input box is empty again), while someone typed in it in the last 2 seconds, and while an earlier message to that pane has not gone out. Then it pastes, presses Enter and confirms as usual; messages held for one pane go out one at a time, in the order they came. Meanwhile a bar on the pane’s bottom row says 1 message waiting from pane 40 · goes after yours, with send now (sends it at once, as --force, but while the person has a draft it pastes the message after it and leaves the Enter to them, so their half-written line never goes with it, and a toast says so; a sender with --enter then gets an error saying the message is in their input) and wait turn, which only says the person saw it: the bar stays, with the working icon and queued: goes right after yours, and a new held message shows wait turn again. Either way the message goes out right after the person’s prompt. status shows held_sends, held_from, held_queued and draft for each pane. --timeout bounds the wait and its error says whether the pane had a draft or recent typing; --force sends at once. A file you pasted yourself with paste-file is such a draft, and send --after-paste passes it (see Paste a file from another machine). While a message sits between its paste and its Enter (at most about 3 seconds), what a window types into that pane is dropped with a toast. keys never waits.
  • held is those two buttons, for a program that draws cornercase and its own bar. Give one of them. --send-now sends the first held message at once, as --force does, still after the Enter of a message sent just before it, so held_sends may only drop a moment later; the others keep waiting. If the person has a draft in the pane then, it pastes the message after the draft and leaves the Enter to them: nothing half written is sent, they see both and send them with Enter or edit them first. Its sender gets the usual answer, an error saying the message is in the person’s input when the Enter was left to them, or the refusal when the pane can’t take it then. --wait-turn only says the person saw it, and covers the messages held so far. Both exit 1 and say why when nothing is held in the pane (it may just have gone out), and --send-now also while the pane is resuming, when the window has no bar. It prints what is held now, and --json prints pane, held_sends, held_from, held_queued and after_draft, true when --send-now left the Enter to the person (check the held-after-draft feature: an older server sends both as one line). --pane, --tab and --view work as for send. On the socket it is {"command": "held", "args": {"pane": 12, "action": "send-now"}}, or "wait-turn".
  • To draw the same bar, read each pane in status --json, status --follow or view, which send a line when any of these change. While held_sends is above 0, held_from is the pane that sent the first held message (null for a sender outside a pane; a pane since closed keeps its id, and ids last one run of the server), and held_queued is true once wait turn covers the newest one. The window then reads 1 message waiting from pane 40 · goes after yours, 3 messages waiting, the first from pane 40 · goes after yours, or without a sender 2 messages waiting · goes after yours; and once queued queued: goes right after yours or 2 queued: the first goes right after yours, with no wait turn button. While draft is true, send now puts the message after the person’s line instead of sending both, so with the held-after-draft feature a client can say so before the click.
  • keys presses keys, encoded the way the program in the pane asked for: enter, esc, tab, backspace, space, up, down, left, right, home, end, pageup, pagedown, delete, insert, f1 to f12, or one character, each after any of ctrl+, alt+ and shift+ (shift+tab, ctrl+c, alt+x).
  • A program that draws the terminals itself should type with input instead: it sends keys, text, pastes and mouse events to the pane you name without checking what the agent shows, which is right for a person typing and wrong for a script. Scripts and agents keep send and keys.
  • read prints the screen as text. --lines N prints the last N lines instead, scrollback included (a pane keeps its last 10 MB of output, about 14,000 lines at 80 columns). Lines the terminal wrapped come back as one, and empty lines at the end are left out.
  • A Claude Code screen may end with its feedback survey right above the input box, ● How is Claude doing this session? (optional) and 1: Bad 2: Fine 3: Good 0: Dismiss: that is Claude Code asking you, not something the agent wrote. status marks it (survey open), and keys --pane 12 0 dismisses it.
  • read --last-message prints the last message the agent in the pane wrote, as plain text. It comes from the agent’s own record, not the screen: Claude Code’s transcript, Codex’s rollout, Gemini’s session file or opencode’s database, the ones cornercase already reads for the context line. So the message comes whole even once it scrolled off, without the input box, the status lines or a suggestion Claude Code shows in grey, and nobody has to ask an agent to write its report to a file. While the agent works it is the newest message so far, such as a note on what it is about to do; once its turn is over it is its answer. --json adds written, when the agent wrote it, and turn_over. A program that shows it can follow events for the pane’s last message changed line and read it then, instead of reading it again and again.
  • With --last-message, repeat --pane or --tab to read several agents in one call, using the ids from status --panes. Each message appears under a header with its pane id, agent, turn_over and written; unknown metadata is unknown. --json gives {"panes": [...]}, with the usual individual answer in each entry. Panes come first, then tabs, each in the order given, and a repeated id is read once. A failed target gets its own error block or JSON entry with error and the requested pane (or tab, when its pane could not be resolved). The command reads every target before exiting 3 if any failed (see Exit status); with no server it prints nothing and exits 1. One distinct target keeps the usual output exactly. Reading screens takes only one target.
  • read --last-message fails, with status 1 and a message saying why, on a pane without Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI or GitHub Copilot CLI, before the agent has written anything, and while cornercase has not found its record: Codex writes its rollout from its first turn on, and two Codex, two Gemini with the same home, or two opencode, in the same folder can’t be told apart. Read the screen then. A permission prompt or a question the agent is asking is not a message either: read --pending reads it.
  • read --pending prints what the agent in the pane waits for you to answer, from its own record rather than its screen: each question it asks with its numbered options, or the tool and the command of a permission it asks for. Without --json it is text (Database: Which database should the service use?, then 1. Postgres - What the other services use and so on; permission: Bash and the command; nothing pending). With --json it is data for a phone app, a board or a script: {"pane": 7, "agent": "claude", "source": "question", "tool": null, "command": null, "questions": [{"header": "Database", "question": "Which database should the service use?", "multi_select": false, "free_text": true, "options": [{"number": 1, "label": "Postgres", "description": "What the other services use", "selected": null}, …]}], "open": null}, or for a permission "source": "permission", "tool": "Bash", "command": "cargo test --locked" and no questions; null when nothing is pending. Every key is always there. number starts at 1, in the order the agent shows the options, so cornercase keys --pane 7 1 enter answers with the first one. selected and open are null: only the screen knows which option is highlighted and which question is open, so read the screen for that, and for a permission’s own choices. free_text is true: Claude Code always lets you type an answer instead.
  • read --pending reads only Claude Code’s records, and only while status says the agent is waiting: a tool that runs and one that waits for your permission look the same in the record. So it is null while the agent works, also for a moment after you answered, and for a wait its record does not say, such as a menu or the trust question (read the screen then). On a pane with another agent or a shell it fails with status 1 and the reason. Repeat --pane or --tab as for --last-message: {"panes": [...]}, exit 3 if a target failed, and a target with nothing pending is {"pane": 7, "source": null} (or "tab"). It needs the pending-question feature, and refuses an older server before asking.
  • read --messages prints the conversation of the agent in the pane, oldest first, from the same records as --last-message: what you and the agent wrote, without tool calls, their results or thinking. A prompt typed in the pane and one sent with send are both user messages. Each message comes under a header with its id, its role (user or assistant) and, when the record has it, the time it was written (41 user 2026-11-10T09:12:03Z), and messages are separated by an empty line. --last N gives the newest N (20 by default), --before ID the N just before that id, to page back, and --after ID every message after it, or the newest N of them with --last. Without --json, a line on standard error names the --before that reads the page before (earlier messages: --before 41), so standard output stays only messages. An id is the message’s position among the messages read, from 1, and it stays only while cornercase reads the same messages before it. A record past the 64 MiB a read walks is numbered from the oldest message inside them, so its ids move as it grows; a message Gemini CLI rewrites in place, or an opencode message whose text arrives after a later one, moves them too. The newest message can still grow under its id (opencode, GitHub Copilot CLI), so a program that follows a conversation reads again from the id before its last one rather than trusting an old --after. When conversation in --json changes (after a /clear, say) the ids start again. The text of each message comes whole. It takes one --pane or --tab, and fails as --last-message does.
Terminal window
cornercase wait --pane 12 --timeout 600 # until the agent stops working
cornercase wait --pane 12 --until waiting # until it needs an answer
cornercase wait --pane 12 --until turn-over # until its turn is over, background shells or not
cornercase wait --pane 7 --until shell # until the program ends
cornercase wait --pane 7 --text 'test result: (ok|FAILED)' # until a line matches
cornercase wait --pane 7 --quiet 5 # until it writes nothing for 5 s

wait blocks until its condition holds, then prints how it ended:

Condition Ends when Prints
(none) the agent stops working: it is idle, done, failed, pending review or waiting idle, done, failed, pending or waiting
--until idle the agent is idle, done, failed or pending review idle, done, failed or pending
--until working the agent is working working
--until waiting the agent waits for an answer to a question or a permission prompt waiting
--until turn-over the agent’s turn is over: it stops working, as with no condition, or only a background shell it started still runs (subagents still running keep it waiting) idle, done, failed, pending, waiting or shell
--until shell the program in the foreground ended and the shell is back, quiet (a second when cornercase never saw the program run) shell
--text REGEX a line on the screen matches, one already there included the line
--quiet SECONDS the pane wrote nothing for that long quiet
  • The agent conditions need a recognised agent reporting OSC 7501, or a reader for Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI or GitHub Copilot CLI in the pane. On a pane with no agent status or supported reader, wait for shell, a line or quiet instead.
  • A Claude Code agent that ends its turn while a shell it started in the background still runs counts as working: it wakes up when that shell ends, and may then carry on. So the plain wait keeps waiting, and its timeout says that only a background shell is left. --until turn-over ends there and prints shell; read the pane to see what the agent said, and stop the shell yourself if nothing should wake the agent. An agent whose own turn is over while subagents it started still run (working (2 subagents)) keeps the default, --until idle and --until turn-over waits waiting, since it wakes up for their results; the timeout names them. Codex, Gemini and opencode report no such state: their turn ends when they say so, whatever they left running, so for them turn-over ends as the plain wait does.
  • After a prompt reached the agent (through start, send --enter or keys … enter), a wait for it to stop first gives the agent up to 10 seconds to take the prompt, so it doesn’t end at once on an agent that hasn’t started yet. If the agent shows no change in that time, the wait fails: it may have finished at once, or never got the text, and read tells which. If the agent was already working when the text arrived, the wait ends when it next stops. An agent that only had a background shell left counts as taking the prompt once it works again.
  • Waits run in the server and don’t slow it down. They end with their condition, their --timeout (none by default) or when you interrupt the command. A timeout exits with status 1 and says what the pane was doing. It doesn’t prove that the agent missed what you sent: read the pane before sending it again.
Terminal window
cornercase wait --any --pane 12 --pane 15 --tab 9 --timeout 1800 # until the first of them stops
cornercase wait --all --pane 7 --pane 8 --until shell # until both programs end

Repeat --pane and --tab to wait on several panes, with --any or --all (several without either is wrong usage). The condition and the --timeout apply to each of them.

  • --any returns as soon as one of them meets the condition and prints one line: the id you gave and how it ended, such as 15 idle. When several meet it at the same moment, it prints the first in the order you gave them; wait again on the rest to hear about the others.
  • --all returns once every one of them has met the condition, and prints one such line each, in the order you gave them (--pane ones first, then --tab ones). A pane that met the condition counts as done even if it changed again before the others caught up.
  • The id on each line is the one you gave, so a --tab line starts with the tab’s id; panes and tabs never share an id.
  • A pane that closes while you wait ends as closed (12 closed) instead of failing the wait, so --all goes on with the others and --any returns it. Anything else that fails a wait on one pane (its agent exits, it doesn’t take a prompt) fails the whole wait, naming the pane.
  • A timeout says what each pane still being waited for is doing.
  • --json prints {"panes": [...]}, one entry per line of text.
Terminal window
cornercase events # everything, until the server stops
cornercase events --pane 12 --pane 14 # only these panes, until they all closed
cornercase events --host --json # also clipboard writes and bells of programs
cornercase events --notices --json # also the notices about agents, with their tokens, and the server's other notices
cornercase events --json | while read -r event; do …; done

events keeps running and prints one line per event, as it happens, so a script that coordinates agents can react to each change, such as an agent asking for an answer or a pane closing, instead of polling status or waiting again after each wait:

tab 15 opened in workspace 2
pane 14 opened in tab 15 from pane 12
pane 14 claude none → idle
pane 14 claude idle → working
pane 12 claude working → waiting
pane 14 claude last message changed
pane 14 claude working → shell
pane 7 cargo exited
pane 7 clipboard 11 bytes
pane 7 bell 3 times
pane 14 closed
tab 15 closed
workspace 2 notice claude needs you in web-shop › main cc-3f2a9c-4
machine vps notice claude on vps needs you in web-shop › main cc-3f2a9c-5
notify the release build is ready
workspace 2 flow-merged pull request merged in fix-login: 3 agents closed
workspace 2 flow-exited coder's agent exited in shop › fix-login
Event When
pane ID AGENT FROM → TO An agent changed state: working, shell (its turn is over, but a background shell it started still runs), waiting for an answer, pending review, done while you were elsewhere, failed, idle, or none before it started and once it left the pane. Every recognised agent reporting OSC 7501, or Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI and GitHub Copilot CLI through their readers, as for wait.
pane ID AGENT last message changed The agent in the pane wrote a new message, or more of its newest one, as read --last-message reads it: read it then. cornercase reads the record on its half-second looks, once one read has ended, and sends one line at most per read: about one every half second while the agent writes, two now and then a little closer when a read was slow, and none while it writes nothing new (a tool running, a state change alone). When no reader was following the pane, the message it holds at cornercase’s first read of it is not told, even one the agent wrote after the reader started and before that read (within half a second). A reader that starts while another follows the pane may get one line for a message written just before it started. Every agent read --last-message reads. No text in the line or in --json. Check the last-message-events feature: an older server sends none.
pane ID PROGRAM exited The program in the foreground ended and the shell is back, or another program took its place.
pane ID clipboard N bytes Only with --host: a program wrote to the clipboard (OSC 52, such as a yank in Neovim). The text is in --json’s text, never in the line. Reads and the primary selection are not told.
pane ID bell Only with --host: a program rang the bell (a BEL character, not one that ends another escape sequence). It reads bell N times when several rang.
workspace ID notice MESSAGE TOKEN Only with --notices: cornercase told you an agent needs you, failed or finished, as the window’s toast says it, with the same rules (a second’s wait, once per change, never for a tab seen in the window or in a view). --json has token, agent, status, place, message and panes, and sound (needs-you or finished), the sound the server chose for it when sound is on for this agent (left out otherwise), so a program that draws cornercase plays the same sounds the window does. It says which sound was chosen, not that one played: a window in a plain ssh session, the browser or a machine without a player plays nothing. A notice about an agent started by another agent or by a flow has subagent: true, left out for the others, so a program can leave those out by itself; with notify_subagents off there are no such notices. A --pane reader gets the notices naming its panes. cornercase go TOKEN [--view ID] does what a click on the notification does; it fails for a token the server never gave or no longer keeps (the last 64) and when the agent and its workspace are gone. Check the notices feature before sending --notices. The server’s other notices have no token: see the workspace ID KIND MESSAGE row below.
machine NAME notice MESSAGE TOKEN Only with --notices: the same for an agent on one of your machines, with the machine’s name in the message. --json adds machine, and its panes are the machine’s ids, with no project or workspace here, so a --pane reader never gets it. cornercase go TOKEN shows that workspace of the machine, as a click on its row does, in the window only: with --view it is refused.
workspace ID KIND MESSAGE Only with --notices: one of the server’s other notices, which have no token, in the words of the window’s toast, less what only the window offers: a merged run’s toast ends with · ▶ on the workspace reopens them, which the message leaves out. The kinds are notify (cornercase notify, naming the pane it ran in, none when run outside cornercase); queue-started, queue-unsent, queue-failed, queue-missed and queue-kept (a queued agent or routine run that started (naming the computer it started on when it waited for room: started queued agent 7 on torre), started without its agent taking the prompt (queue-unsent, which replaces queue-started, the entry has unsent: true then), failed or kept its workspace, or a routine’s run that missed its time, the state its entry now has; a one-off entry that missed its time sends none, and queue-failed and queue-missed name no pane or workspace); queue-waiting (an entry waits for room, once when it starts waiting: queued agent 7 waits for room: 1st in line, needs 6 GB · best: torre 4.1 GB, or …: 2nd in line, behind queued agent 7) and queue-pull-request (the pull request of an entry that waited for room opened: queued agent 7's pull request opened: #123 Fix the login), both naming no pane or workspace; setup-failed (a setup that failed while nobody was looking at its tab, in the window or a view); flow-consent (a flow’s member waits for you to accept or refuse Claude Code’s bypass permissions mode in its tab); flow-exited (a flow role’s agent exited by itself, once per exit, never for a tab seen in the window or a view; a member’s only while notices for subagents is on; not again after a restart, and again once the role came back and exited again); and flow-merged (a run’s agents closed once its pull request merged, as --close-when-merged asks; closing agents yourself sends none). A message about no workspace starts with its kind. --json has kind (read it as a string: a newer server adds kinds), message, panes ([] when it names none), the project and workspace ids when it is about one, and failed: true on a flow-merged whose --free-builds could not free everything (the window’s toast shows ✗ then), left out otherwise; check the message-failed feature before taking a missing failed to mean the builds were freed. A flow-exited also has run (the run’s id, as in flow runs) and role (the orchestrator’s is orchestrator); check the message-flow-exited feature first, since an older server sends none. A --pane reader gets the messages naming its panes. There is no token: go there with focus --pane or --workspace (see Arrange), and bring a merged run’s agents back with agents reopen --workspace ID. A server without the notice-messages feature sends only the agents’ notices.
KIND ID opened in PARENT A project, workspace, tab or pane opened. A pane started from another pane (see Ids) ends with from pane ID.
KIND ID closed A project, workspace, tab or pane closed. A pane closes when its shell exits, whatever closed it.
  • --pane ID, given once or more, keeps only what happens to those panes, and ends the command once they have all closed. Without it, events ends when the server stops (kill-server, a restart), with status 0. Either way it also ends, with status 0, once whatever reads it is gone, such as an ssh running it on another machine (see Exit status).
  • --json prints one JSON object per line instead: event (status, last-message, exited, opened, closed), time (UTC, as in the server’s log), the project, workspace, tab and pane ids it concerns, and agent, from and to for a status (null for no agent), agent for last-message, program for exited, kind for opened and closed, and parent for an opened pane started from another pane (left out when it has none).
  • --host is how a program that draws the panes learns what their programs ask of the terminal: a UI has no window to receive an OSC 52 write, so it puts text in the clipboard itself. Readers without --host get none of it. Bells come at most one line a second per pane, with how many rang (count). A server without the host-events feature refuses --host; check contract before sending "host": true. A reader that falls behind loses these events like any other, clipboard texts included.
  • It only tells what happens after it starts. Start it before what you want to follow, or read cornercase status once it runs, so nothing falls in between.
  • cornercase looks at the program in each pane every half second while something follows events, so a program that runs for less than that may not show. To wait for one program, wait --until shell is exact.
  • A reader that falls far behind (over a thousand events waiting for it) loses events, and gets a line such as 12 events dropped when it catches up, so it knows to read status again. One that stops reading altogether is disconnected once the server has waited a second to write to it, like any client; the command then says the connection ended and exits with status 1.
  • --boot BOOT (see Arrange) refuses it before its first line, with status 4 and nothing printed, when the server restarted since you read the pane ids; one that restarts while it runs ends it as above, never with 4. For example: cornercase --remote vps events --pane 9 --json --boot 4242-1700000000.
Terminal window
cornercase close --tab 9
cornercase close --worktree fix/login --remove-worktree
cornercase close --worktree fix/login --remove-worktree --check
cornercase close --worktree fix/login --remove-worktree --unlock
cornercase close --agent --pane 12 --check
cornercase close --agent --pane 12
cornercase close --agent --pane 12 --keep
cornercase close --agent --pane 12 --keep --tabs 9,11 --stops 12,14
cornercase close --workspace 5 --boot 4242-1700000000
cornercase group new work
cornercase group style 12 --icon '★' --colour 99
cornercase group delete 12 --close-projects
cornercase move --project 5 --into 12
cornercase move --tab 9 --before 7
cornercase move --worktree fix/login --last
cornercase collapse --group 12
cornercase collapse --pane 12
cornercase collapse --section agents
cornercase expand --worktree fix/login
cornercase collapse --pane 12 --boot 4242-1700000000
cornercase move-pane --pane 4 --target 7 --place below
cornercase move-pane --pane 4 --target 7 --place below --boot 4242-1700000000
cornercase rename 'review #42'
cornercase rename --workspace 5 ''
cornercase rename --workspace 5 docs --boot 4242-1700000000
cornercase focus --pane 12
cornercase mark --pane 12
cornercase mark --pane 12 --reviewed
cornercase mark --pane 12 --seen
cornercase mark --pane 12 --boot 4242-1700000000
  • close takes exactly one of --pane, --tab, --workspace, --worktree or --project and stops its shells, as its × would, but never asks first, not even for a project. A worktree’s workspace stays listed while its worktree is on disk; --remove-worktree removes the worktree too and answers once it is gone. Without --force, a worktree with uncommitted or untracked changes is refused before anything stops; --force throws those changes away. A locked worktree (git worktree lock) is refused before anything stops, even with --force; the error gives the reason and the git worktree unlock command to run, and --unlock does what the dialog’s unlock and remove does. It does not imply --force: changes still need it. The branch is never deleted. To remove a worktree that is not open in cornercase, or its branch too, use worktrees remove.
  • close --remove-worktree --check only says what removing the worktree would lose, as the Remove workspace dialog does, and stops nothing: whether it has changes that are not committed, its lock with the reason and whether the process the reason names still runs, the worktrees of a flow’s roles that go with it, and whether the project’s teardown runs first. --json prints workspace, path, branch, changed, lock (reason, path, role, pid, running, or null), roles (role, path, branch) and teardown. Run it before removing a worktree you did not just make.
  • close --agent --pane ID closes an agent as the agents section’s close agent does, but never asks first: the agent’s whole tab and the tabs of the agents it started in the same workspace, at any depth. When the agent is a member of a flow’s run, its whole team closes and the run ends. Agents it started elsewhere keep running. It never removes anything from disk: a worktree and its branch stay (close --workspace ID --remove-worktree removes a worktree), and --force and --unlock are refused with --agent. It takes only --pane (a pane that runs no agent cornercase reads is refused with conflict).
  • close --agent --check only says what closing would do, and stops nothing: --json prints pane, agent, project, workspace, removes (always null) and branches (always empty), both kept for older servers, tabs, stops and keeps (panes with agent, project, workspace and tab; keeps are the agents that keep running), run (the flow run that ends when its team closes), closed, warning and closed_agents (the closed agents the workspace keeps). Without --check, --json prints the same once it is done, with closed true. Run the check first when you did not start the agent yourself.
  • close --agent --keep keeps what it closes with the workspace’s closed agents, as agents close does, so agents reopen --workspace ID or the workspace’s ▶ brings the agent back in its conversation (a flow’s team with its run), and agents forget drops it; it prints the line to bring it back. Without --keep the agent is closed for good, as with its ×. A tab of the plan with no agent left in it closes without being kept. closed_agents in the --json answer is how many closed agents the workspace keeps now (feature close-agent-keep).
  • close --agent --tabs IDS --stops IDS closes only what a check confirmed. Give back the check’s tabs (jq -r '.tabs|join(",")') to refuse the close when the agent has since started a tab that it would now close. Give back its stops (jq -r '[.stops[].pane]|join(",")') to refuse the close when it would now stop another pane. A pane started inside a confirmed tab is caught only by --stops, so --tabs alone does not protect it; give both to guard both. A refused close names what was added and closes nothing; check again. A plan that shrank closes what is left. Both are refused with --check (feature close-agent-bound).
  • group new NAME creates a group with the next icon and colour, as new group does, and prints its id. group style ID sets --icon (one of ● ◉ ◐ ◆ ■ ▲ ▼ ★ ✦ ♥ ♣ ♠) and --colour (a palette index: 1 9 208 214 3 11 2 10 6 14 4 12 99 5 13 205); with neither it prints the group’s style, and --json also lists both sets. group delete ID keeps the group’s projects, outside any group; with --close-projects it closes them and deletes the group once their shells have stopped.
  • move puts a group, project, workspace or tab (--group, --project, --workspace, --worktree, --tab) --before another of the same kind, or --last at the end of its list. A project moved before another joins that project’s group; --into GROUP puts it after the projects of that group and --ungroup after the ones that have none. A workspace stays in its project and a tab in its workspace. Programs keep running, and the window keeps showing what it showed.
  • collapse and expand fold or unfold a group, project or workspace (--group, --project, --workspace, --worktree), or an agent’s pane (--pane, refused with conflict for a pane that runs no agent cornercase lists), whose agents then hide under it in the agents section for as long as the agent running there now keeps running, whatever it was. start --folded and flow run --folded begin with that fold already set. --section projects|workspaces|agents instead folds or opens a whole section of the sidebar, in every window, kept across restarts; a section that isn’t drawn takes it and shows it later. A request names an item or a section, not both (feature section-folds). status lists the collapsed ones in collapsed_sections.
  • move-pane --pane ID --target ID --place swap|left|right|above|below swaps two panes of a tab or moves one to that side of the other, as dragging a pane with the right button does. It is refused (conflict) when the tab would have no room for every pane at the size it has, or when the panes are in different tabs; the moved pane becomes the tab’s active one. --json prints the tab’s new layout. Over the socket the requests are group-new, group-style, group-delete, move, collapse, expand, move-pane and removal-check, and close takes unlock; each change shows in the next status --follow snapshot.
  • rename renames the tab it runs in, or the --tab, --workspace, --worktree, --project or --group you name. An empty name goes back to the default one (a group always keeps a name).
  • account add, account login, account restart, agents close, agents forget, agents reopen, changes base, changes discard, changes file, changes gap, changes list, changes merge-check, changes shared, changes stage, changes unstage, changes viewed, clone, close, collapse, config project, context, events, expand, files list, files read, files search, flow account, flow close-when-merged, flow default, flow delete, flow export, flow files, flow import, flow list, flow messages, flow order, flow run, flow save, focus, go, group delete, group style, held, input, issue list, issue people, issue read, issue sources, keys, link, mark, move, move-pane, new-tab, new-workspace, open, paste-file, plugin run, ports, processes, pull-request, queue add, queue edit, ratio, read, redraw, rename, resize, scroll, selection, send, setup, split, start, surface, todo send, view, view-set, wait, worktrees free-builds, worktrees list and worktrees size take --boot BOOT, the boot of the status --json you read the id in, or of a machine’s entry there. Ids last one run of the server, so one that restarted since refuses, with stale-boot’s message and status 4, and nothing is done or printed (nothing closes, changes, folds, moves, starts, is sent, typed, pressed or pasted, context starts no second claude, no flow runs or is saved, and nothing of what took the id is read); without the flag, the command acts on, or reads, whatever has that id now. Comparing the boot yourself before sending leaves a gap, since the server can restart in that moment; here the server compares as it acts. It works in every form of these commands, close‘s --worktree, --check and --agent, every form of collapse and expand (--group, --project, --workspace, --worktree, --pane, --section), and --tab of mark, context and send, and --popup of input, included, and on a line of requests --follow, for that line only. Any other refusal says what it says without the flag, with status 1. A server from before boot (0.12.108 and older) would ignore it and act, so it is refused (… would ignore --boot …, status 1) and nothing is done there: a request that such a server would carry out waits until the server says that it knows boot. That is every command that sends an operation from before --boot (0.12.108 and older): close, rename, send, keys, read, wait, focus, split, mark, start, new-tab, new-workspace, open, events, flow run, flow list, flow export, flow import, flow save, queue add, queue edit, changes shared, changes list without --json (which asks for the workspaces’ names first), and the lookup behind --worktree. The others go at once, since such a server refuses them by name, so a poll costs one round trip. One older than an option of the command refuses it as unknown-field, where it would otherwise ignore it: restart it so it runs the version you installed. plugin run sends it with its revision lookup too, so a stale boot fails before anything runs. queue edit takes it as queue add does. input --follow ends with status 4 on the first line a server refuses for it, and sends nothing after it. With --machine, start, new-workspace, flow run and focus take the boot of that machine’s entry, whose ids they name (see Start work on a machine). A stream (events, surface, view, changes list, files list or files read and flow messages with --follow, and a long wait) is refused before its first line, with status 4 and nothing on standard output, with or without --json; the server compares the boot once, when the stream starts, and one that restarts while it runs ends it as it always did (status 0, or 1 when the connection drops), never with 4. clone --list-ignored refuses it, since it needs no server. status, where the boot is read, flow runs, flow hide and flow restore, processes stop and ports stop (a pid and a port are the system’s), and the ids that survive a restart, such as todo done and queue remove, take none.
  • focus shows a pane, tab, workspace or project, as picking it in the search does. --reveal also scrolls a pane to a text and selects it (see Find where something was said). --machine NAME picks a workspace or tab of a machine as the one shown instead, whose tab the window shows from the machine (see Machines’ workspaces). --bot BOT shows that bot’s chat on the Bots page, as a click on its row does (feature focus-bot).
  • mark marks the agent in the pane it runs in, or in the --pane or --tab you name, as pending review: its tab shows a blue ● until it is marked --reviewed or the agent starts working again on a new prompt or an answer, and status and events give it as pending. A pane without Claude Code, Codex, Gemini CLI, opencode, Grok Build, Cursor CLI, Vibe CLI or GitHub Copilot CLI is refused. An agent that ends its turn with work for you to check can run it on its own pane. --seen only takes the ✓ of an agent that finished off, as looking at its tab does, and leaves a blue ● as it is: for a program that showed the agent without a view (feature mark-seen, checked first, since an older server would mark the agent as pending review).
Terminal window
cornercase agents close
cornercase agents close --worktree fix/login --check
cornercase agents close --workspace 7 --force --json
cornercase agents reopen --workspace 7
cornercase agents forget --workspace 7 --yes
  • agents close closes the tabs of a workspace (the one you are in, or --workspace or --worktree) that run an agent, whole, and keeps what each needs to start again, as the window’s close agents does. It refuses, with conflict, what the window would ask about: an agent that is working or waiting, one that cannot resume its conversation, or other panes in those tabs; --force closes anyway, and --check says what would close and closes nothing. It prints closed 4 agents in workspace 7; `cornercase agents reopen --workspace 7` reopens them.
  • agents reopen brings them back after the other tabs, a line per pane (pane 31 claude coder resumes, or starts over). It needs a window’s size, so it is refused when no window has ever attached; the roles of a running flow whose agent exited by itself (exited in flow runs) come back instead in the panes they were in, each in its own conversation when cornercase saw one, the orchestrator last, and that needs no window (tabs is empty). Every agent’s command must be on the server’s PATH, or nothing opens (failed).
  • agents forget drops them for good and ends a kept flow run, asking first on a terminal and needing --yes in a script.
  • --json prints the answers: agents-close gives project, workspace, tabs, agents (pane, tab, agent, role, status, resumes), stops (the other panes that go with them), run, closed (false for a check) and closed_agents; agents-reopen gives the new tabs, panes and run; agents-forget gives forgot and run. The requests are agents-close (workspace, check, force), agents-reopen and agents-forget (workspace); an older server refuses them by name.
  • status --json, watch and view carry closed_agents on a workspace that holds some, and flow runs lists a run whose agents are closed with state: "closed" and every role’s pane null; a flow run can also close them by itself once its pull request merges. See Close agents and reopen them later.
Terminal window
cornercase notify 'the release build is ready'
cornercase todo add review the login fix # prints the item's id
cornercase todo list
cornercase todo done 3 # checks it off, or back on
cornercase todo undone 3 # puts a done item back among the ones to do
cornercase todo edit 3 review the login fix again
cornercase todo move 3 --before 5 # or --last
cornercase todo send 3 --pane 5 # types it into the agent and checks it off
cornercase todo rm 3 # prints a number that restore takes
cornercase todo clear-done # the same, for every done item
cornercase todo restore 7

todo does what the TODO panel does. An item moves among its kind: before an item of the other kind it stops at the end of the ones to do (or becomes the first done one). done checks an item off or back on; undone only puts a done item back, and does nothing for one still to do. rm and clear-done print an undo number (--json prints the removed items with it); restore puts that removal back where it was. The server keeps the last 16 removals until it stops, and clear-done with nothing done removes nothing and prints no number. Over the socket these are the todo request’s edit, undone, move, clear-done and restore, listed as the todo-panel feature.

notify shows a toast in the window and sends a desktop notification through the terminal of every open window, like the one for an agent that needs you. A program that follows events --notices gets it too, as a message of kind notify naming the pane the command ran in.

todo send types an item’s text into an agent and presses Enter, exactly as send --enter does: the same target (--pane or --tab, else the pane the command runs in, else the one the window shows), the same refusals (an agent waiting for an answer, resuming, a flow role whose agent exited, showing a dialog, a panel, its shell mode or its feedback survey, a program that stopped reading; --force for the ones send --force lifts) and the same confirmation that the agent recorded the prompt. Once it did, the item is checked off and the command prints sent todo 3 to pane 5. A refused or unconfirmed send leaves the item pending, prints the reason and exits 1. When cornercase cannot confirm that kind of send at all (a / command, an agent it does not read), the text is sent and the command exits 0 with sent todo 3 to pane 5, but cornercase cannot tell whether the agent took it, so it stays to do; the item stays pending, and --json has "unconfirmed": true. An item edited while it is being sent is not checked off: the command prints sent todo 3 to pane 5, but it changed while it was sent, so it stays to do and --json has "checked": false. Only a pending item can be sent: a done one is refused until it is unchecked. The TODO panel’s ▸ button does the same from the window.

Terminal window
cornercase away # agents message you on Telegram or Discord
cornercase away --off # they stop

away turns on the away mode of every chat app paired, Telegram and Discord, as More ▴ › remote… › continue on Telegram (or on Discord) does: while it is on, an agent that needs you or finishes its turn sends you its question or its last message, and what you reply goes to it, until you turn it off. It succeeds when at least one of them went away, and fails when none could, saying where to set it up. An agent can run it for you when you tell it you are leaving.

cornercase update --json checks and installs from its own process and prints what it did as one line, so a program never parses sentences:

{"outcome":"updated","from":"0.13.39","version":"0.13.50","path":"/home/me/.local/bin/cornercase"}
{"outcome":"up-to-date","version":"0.13.50"}
{"outcome":"manual","version":"0.13.39","latest":"0.13.50","command":"brew update && brew upgrade cornercase"}
  • version is the cornercase on disk when the command ends, on the machine it ran on, so after manual it is still the old one. from (the version before) is there only for updated, path only for updated (the binary it replaced) and available (the one it would replace), latest (the release that is out) only for manual and available, and command (what to run by hand) only for manual. Keys that don’t apply are left out. New keys may be added.
  • updated and up-to-date exit with 0, and manual, when cornercase can’t replace itself here (Homebrew installed it, its folder isn’t writable, or the platform isn’t one it knows), with 6: nothing changed, and the line has the command to run. A failure prints nothing on standard output, the reason on standard error, and exits with 1.
  • It asks nothing and never restarts the server, with or without a terminal, and refuses --yes and --when-idle (status 2). Restart afterwards with cornercase restart --yes or --when-idle (below).
  • update --check --json installs nothing: it prints up-to-date, manual, or available (with version, latest and path, where it would install), and exits with 0 whatever it finds.
  • With --remote the line and the status are that machine’s, so a program can confirm the install there before it restarts that machine’s server. A cornercase there older than 0.13.53 refuses --json with status 2: run plain update, which exits with 1 when it can’t replace itself there.

A program that drives the server’s own update flow, such as a GUI’s update button, uses the requests update-check and update-install, the dialog’s own check and install, whose state is the update of status --app:

{"command": "update-check", "args": {}}
{"command": "update-install", "args": {}}
  • update-check asks GitHub whatever check_updates says, and answers the update object when it ends. A check already running is joined. A failure is failed with the reason, and the release found before is kept.
  • update-install installs the release found, and answers the update object when it ends, with installed true: restart to use it (restart or restart --when-idle). It is conflict when there is no release (ask for update-check first) or when cornercase can’t replace itself here (the message names the command to run). An install already running is joined, one done answers at once, and a failure is failed and can be asked again.
  • A development build, which never looks for updates, lists both as unavailable in contract and refuses them with unavailable.

There is no command for them: cornercase update (with --json for a program) does the same from a shell, and works without a server.

An agent that coordinates others may need a newer cornercase, for a command that was just released. A plain restart would stop every agent in the middle of its turn. --when-idle restarts the server only once no agent is working, in the same step it sees that, so none starts a turn in between:

Terminal window
cornercase update --when-idle --yes --timeout 3600
cornercase restart --when-idle --yes

The pane the command runs in doesn’t hold the restart, so an agent can run it as its last step: the restart stops it too, and its conversation resumes. Until then every window says a restart is pending, with a button that cancels it. cornercase restart has the details.

Terminal window
cornercase tour list --json
cornercase tour start todo --no-card
cornercase tour complete todo add

The tour request (action: list, start, next, back, skip, end, complete, reset, with tour, step and card) moves the guided tour and answers {"state", "tours"}: state is the app feed’s tour, and tours, filled for list, holds every tour as data, so another UI draws the same steps: id, title, docs (its docs page), and each step’s id, title, text, target (what it points at: new-project, projects, workspaces, tabs, pane, agents, issues, changes, files, todo, search, settings, usage, remote, queue, help or none), done (what completes it: {"kind": "next"} for a step that only explains, or an action such as project-opened, workspace-made, tab-opened, prompt-confirmed, panel with its panel, opened with its dialog, todo-added) offer (prompt, agents-section or null) and show (the section the window opens for the step: {"kind": "panel"} with its panel, issues, queue, search, keys, settings with its page (agents, accounts, flows, ui, remote, plugins), help-menu, remote-menu, or null). card: false moves the tour without drawing the window’s card or opening its sections. complete marks a step done, and moves on when it is the step on screen. A tour or step that does not exist is not-found, a move without a tour on screen is conflict.

Terminal window
cornercase usage
cornercase usage --json
cornercase usage --cached
cornercase usage --machine all --json

usage prints what the Limits tab of the Usage dialog shows, so a script or another app can read how much of your plan is left:

Claude Code · max plan updated just now
session (5h) 34% · resets in 2h 14m
week 81% · resets in 3d 4h
week · Opus 12% · resets in 3d 4h
extra usage: 12.34 USD of 50.00 USD
Codex
usage unavailable: codex did not answer in time

It asks the installed agents (Claude Code and Codex; both when neither is installed, each saying why it could not run) by running claude and codex on the server’s machine, the ones agent_commands names. That sends no prompt and costs no tokens, and each agent gets at most ten seconds. A probe already running, started by the dialog or by another usage, is waited for rather than started again. Nothing is asked between requests: a program that polls should use --cached, which answers at once with the last answer and its age and asks nothing. The command needs a running server, since the probes and their last answers live there. It exits 3, after printing every agent, when one could not be asked; that agent’s error says why (see Exit status).

With --json it prints {"agents": [...]}, one entry per agent with every key present (null when it has no value): agent and title, loading (a probe is running now), read_at (UTC) and age (seconds) of the last answer with numbers, plan, limited (false means the account has no plan limits, null that nothing was read yet), limits, extra (Claude Code’s extra usage or Codex’s credits, as text), notice (what the dialog shows instead of bars, such as not signed in · run codex login) and error. After a failed probe, plan, limits and the rest are from the answer before it, as old as age says. A limit has label (the dialog’s text), kind (the agent’s own name for it: Claude Code’s session, weekly_all or weekly_scoped, or Codex’s primary or secondary), scope (the model or bucket it applies to, null for the whole plan), percent, severity (normal, warning or critical; read it leniently) and resets_at (UTC, or null). kind and scope together name a limit from one answer to the next. With accounts, an agent has one entry for its usual login and one per account, which adds account (its folder name) and label (the name you gave it, or System for the usual login); the default account’s entry (the usual login’s when that agent has no default account) has active: true. These keys are left out when there is nothing to say, so an answer without accounts is the same as before.

It is the request {"command": "usage", "args": {"cached": false}}. An older server answers that it has no usage command.

--machine NAME asks one of your machines instead, through your server: it prints a line with the machine’s state and when it was read, then its agents as that machine gives them, with its own accounts. --machine all prints this computer’s agents, then each machine’s. It exits 3 when a machine couldn’t be read, or an agent here or there couldn’t be asked. With --cached, the machines aren’t asked either: you get the last answer your server read from each.

With --json, a machine adds machine, and all adds machines, one per machine in the order of config.json, each with its agents:

{"agents": [...],
"machines": [{"name": "vps", "state": "linked", "seen": "2026-10-31T16:00:00.000Z",
"read_at": "2026-10-31T16:04:12.000Z", "error": null, "agents": [...]}]}

state and seen are the link’s, as machines gives them; read_at is when your server read that machine’s answer, null if never; error is why the last try failed, or why the machine is down, or, with no read_at, why it was never read (still connecting, its cornercase is older than this one, not read yet). A machine that is down answers the numbers it gave last. With none, --machine NAME fails with why, while --machine all still answers this computer’s and the other machines’ agents and lists that machine with its error and no agents. An unknown name is not-found.

An agent whose account can be told apart has identity, the same text on every machine for the same account of the same provider, so another app can list an account seen on two machines once. It is a fingerprint: it holds neither the email nor the organization, though whoever knows both can check them against it. Only Claude Code gives one, for a claude.ai login; Codex, an API key, Bedrock and Vertex don’t, and rows without it are never merged.

The request is {"command": "usage", "args": {"machine": "all"}}. contract lists the feature machine-usage: an older server ignores machine and answers for this computer, so check it first, as --machine does.

Terminal window
cornercase recap
cornercase recap yesterday --language Spanish
cornercase recap week --fresh --json
cornercase recap --dossier yesterday

recap prints the Recap panel’s summary: now (the default), yesterday (the last day with agent activity) or week. A current result is printed at once, and a now that no longer matches what is open is written again; otherwise the command waits for the agent that writes it. The text starts with a line such as yesterday · fri 31 oct · Claude Code · 14 conversations · 41k tokens · 2 h ago, and names each conversation project › workspace › tab and each pull request #212.

  • --fresh writes it again. --agent, --account, --model, --effort and --language change the settings for that run only, and write it again.
  • --dossier prints the dossier the agent would read, with no agent run.
  • Nothing to sum up prints why and exits 0. A run that fails prints the last good text, then recap unavailable: and the reason, and exits with 3.
  • With --json it prints range, day, label, from, to, zone, written_at, age, agent, title, account, model, effort, language, tokens, conversations, text, places, dossier, loading, progress, empty, error, outdated and changed, every key present (null when it has no value, false and [] for the last two). outdated is true when a now no longer matches what is open and changed lists the ids of the places that changed; asking for now again writes it again, so you meet them after a run that failed. text keeps the ids ([c3], [p1]), and places maps each to its project, workspace, tab, agent, conversation, the pane it was last seen in and that server’s boot and, for a pull request, its number and address. Each place also has status (the status its conversation had when the recap was written, open when its pane reported none, null when it was closed) and checks (a pull request’s checks then, null unless read from an open workspace).
  • To follow a conversation’s place to the pane it is in now, also after restart or agents close and agents reopen moved it, look in status --json for the pane with the place’s agent and conversation, as the panel’s links do. A null conversation matches nothing, and opencode’s is always null. A pane’s agent can be null while nothing reports its state (Gemini CLI with its window title off, for one), and then its conversation alone names it. Without a match, try the place’s pane while its boot is the one status --json gives, since ids start again with every start of the server, then its workspace and project by their path. An older server gives its panes no conversation key.
  • It is the request {"command": "recap", "args": {"range": "yesterday", "fresh": false, "dossier": false, "agent": null, "account": null, "model": null, "effort": null, "language": null, "zone": null}}. A run of that range already going is waited for when the options are the same and refused with busy when they differ. An older server is refused by the contract feature recap.
  • events reports {"event": "recap", "state": "started" | "finished" | "failed", "range", "agent", "error"} to every reader that did not filter by --pane.
Terminal window
cornercase bot agents --json
cornercase bot new prs --agent claude --about "Review my open pull requests" --json
cornercase bot about prs --json
cornercase bot memory prs --json
cornercase bot edit prs --memory "- squash merges"
cornercase focus --bot prs
cornercase bot list --json
cornercase bot say prs "which of my PRs are blocked?" --wait --json
cornercase bot history prs --after 12 --json
cornercase bot stop prs
cornercase bot setup prs
printf '%s' "$PASSWORD" | cornercase bot secret set prs campus-password
cornercase bot secret list prs --json
cornercase bot secret remove prs campus-password
printf '%s' '{"campus-user":"…","campus-password":"…"}' | cornercase bot secret give prs 3
cornercase bot secret decline prs 3

bot drives the bots: agents of your own, outside any project, that you talk to. One request, bot, whose args are an action (agents, new, list, edit, about, memory, show, remove, reset, seen, stop, setup, say, history, secret-set, secret-list, secret-remove, secret-get, secret-ask, secret-give or secret-decline) and its fields in entry, as queue has them: {"command": "bot", "args": {"action": "say", "entry": {"bot": "prs", "text": "hi", "wait": true}}}, and {"action": "list"} with no entry. contract lists the feature bots, and cornercase bot checks it before it asks, so an older server is refused by name (the running cornercase server has no bots).

  • agents answers {"agents": [{"agent", "title", "installed", "bot", "why", "accesses", "reads", "efforts", "models"}]}: each known agent, whether it can be a bot, why not (not yet, not installed) or what limits it (its sandbox cannot reach cornercase, a command can write outside its folder, its edits can leave its folder, its rules are unchecked on this system), the accesses it supports, reads (feature bot-reads: folder when cornercase access reads and writes only the bot’s own folder, left out when it reads anything: say it in the note under Access) and the efforts and models it suggests. Build a form from it rather than from a fixed list.
  • new (name, agent, model, effort, account, access, follow, about; with a non-empty about, new also starts the bot’s setup turn and answers state thinking, feature bot-setup), edit (bot, and the same, with about too: it writes bot.md, an empty one empties it, and a server without the feature bot-about ignores it, so bot edit --about checks it first; an empty model, effort or account clears it) answer the bot: id, name, agent, model, effort, account, access, state (idle or thinking), held, unread, last (kind, the first 200 characters of text and at of the last bot or you line, or null), folder, created, routines (how many routines the bot has) and next (UTC seconds of the next run of its routines, or null; feature bot-routines). list answers {"bots": [...]}.
  • bot names a bot by id, or by name ignoring case; an unknown one is not-found. A name that is empty, over 40 characters or has a control character, an unknown agent, model, effort, account or access, and a message that is empty or over 20,000 characters are malformed; a name in use and the 51st bot are conflict; reset and remove while the bot answers are busy, and so is setup, which a bot whose bot.md is empty refuses as conflict.
  • about (bot) answers {"bot", "about"}: the text of the bot’s bot.md, what it is for, read when you ask (the bot rewrites it too); "" when it is empty or missing, and failed when it cannot be read. An edit form shows it and sends about with edit only when the person changed it. Check bot-about-read first, as cornercase bot about does: an older server refuses the action as malformed.
  • Memory (feature bot-memory): memory (bot) answers {"bot", "memory"}, the text of the bot’s memory.md, read when you ask, "" when it is empty or missing and failed when it cannot be read; edit takes memory, which replaces memory.md (an empty one empties it) and tells the bot’s conversation at its next message that the user changed it. cornercase bot memory and bot edit --memory check the feature first: an older server refuses the action as malformed, and the field as unknown-field only in a structured request; a legacy request has it ignored, and the edit succeeds without writing memory.md. A window’s editor should read it again before it saves, since the bot writes the file too, as cornercase’s own memory dialog does.
  • show (bot) shows that bot’s chat in the window, on the Bots page, as a click on its row does, and answers {"bot"}; status then reports it as shown_bot. It is what cornercase focus --bot sends, after checking the feature focus-bot.
  • Secrets (feature bot-secrets): secret-set (bot, name, value) saves one, replacing a saved one, and answers {"bot", "name", "saved"}; secret-list (bot) answers {"bot", "key", "secrets": [{"name", "saved"}]}, never a value (key is file); secret-remove (bot, and name or all) answers {"bot", "removed"}; secret-get (name) answers {"bot", "name", "value"} to the bot that asks, from its own turn, and to nobody else. A name is 1 to 40 characters of a-z, A-Z, 0-9, - and _, the same secret however its letters are cased; a value is 1 to 8,192 bytes of UTF-8, refused with its size (malformed, as an empty one), a bot keeps 20 (conflict for the 21st) and an unknown name is not-found. A refusal of who may ask, or of a file that cannot be read (the secrets of prs cannot be read), is failed. The value is never in a bot list, status --app, an event or the log. bot list and status --app’s bots have secrets, how many the bot has, and secrets_unreadable: true (left out otherwise) when its file cannot be read, so a bot with secrets: 0 and that flag is not one with none; saving and removing publish change: edited. cornercase bot secret set reads the value from standard input, never from an argument. Check bot-secrets first, as the commands do.
  • Asks (feature bot-asks): secret-ask (names, 1 to 4, about, 1 to 200 characters on one line, and replace) is answered only to the bot itself, from its own turn (a routine’s run while that run goes on, the chat while its turn runs; anything else is failed), at once, with {"bot", "ask", "names", "already"}: already: true with the waiting ask’s id for the same names asked again. A saved name without replace, a fifth waiting ask and passing 20 secrets are conflict; a bad name or about (control characters, direction marks, one of the bot’s values) is malformed; a chat file that cannot be written is failed and keeps nothing, so the bot can ask again. secret-give (bot, ask, values: name to value, a value for every name still missing and no other) saves them all or none and answers {"bot", "ask", "saved"}; secret-decline (bot, ask) answers {"bot", "ask"}; an ask that ended is not-found, and a bot’s connection is refused both (failed). bot list and status --app’s bots have asks ([{"id", "names", "about", "replace", "routine", "missing"}], routine null for the chat, names what was asked and missing the names a secret-give must still hold, left out when none waits), and the chat lines asks for a secret: …, secret saved: … and secret not given: … carry ask. A restart forgets the asks. cornercase bot secret give BOT ASK reads one JSON object from standard input, never a terminal. Check bot-asks first, as the commands do.
  • setup (bot) runs the setup turn again and answers {"bot", "line"} at once with its first line, the notice setting up; check bot-setup first, as cornercase bot setup does.
  • say (bot, text, wait) writes the you line and starts the turn, or holds the message while one runs, and answers {"bot", "line"} at once. With wait it answers {"bot", "asked", "line"} when that message’s turn ends, with its bot, error or notice line; the command exits with 3 unless it is a bot line.
  • history (bot, last, after) answers {"bot", "name", "lines"}: the chat’s lines, each with id (increasing per bot), at (UTC seconds), kind (you, bot, step, error, notice, started, finished or waiting) and text; a you line may be held, a step names its tool, and a bot line has its model, tokens and conversation. A setup turn’s first line is the notice setting up. A line of a routine’s run also has routine, the run’s queue id; its first line is a notice ↻ Label · 09:00, then its steps and a bot or error line. reset and seen answer {"bot"}, remove answers {"bot", "entries", "undo"} (the queue entries removed with the bot, as one removal that queue restore takes; entries is empty and undo left out when there were none), and stop {"bot", "stopped"}.
  • events reports {"event": "bot", "bot": ID, "line": {…}} for each chat line, steps included, {"event": "bot", "bot": ID, "state": "thinking" | "idle"} and {"event": "bot", "bot": ID, "change": "created" | "edited" | "removed"} to every reader that did not filter by --pane. A bot made with about reports created, thinking, the setting up line, its steps, its answer and idle. A program that shows a chat reads history once and follows the events.
  • status --app has a bots key, the same list as bot list, left out when there are no bots.
  • Chat apps (feature bot-chat-apps): new and edit take chat_apps (away, always or off; null leaves it, another value is malformed), and bot list and status --app answer it for every bot. It says when the bot’s answers reach a paired Telegram or Discord, see On Telegram and Discord. cornercase bot new and bot edit --chat-apps check the feature first.
  • Following (feature bot-follow): a bot that starts an agent is told when it finishes, see Agents it starts. new and edit take follow (a boolean; null leaves it), and bot list and status --app answer follow and following (the ids of the panes the bot follows). The started, finished and waiting lines have agent (kind, pane, workspace, project and the server’s boot, so a link can read closed after a restart), body (the last message, or the screen) and run (the routine run whose conversation owns the line); the answer to a report turn of a run carries run too. status, watch and view have bot on tabs and panes: the id of the bot that started them, left out when none. A request’s envelope has optional bot and bot_run, which the CLI fills from CORNERCASE_BOT and CORNERCASE_BOT_RUN (never under --remote); they only label what the request creates, and a bot’s own connection always tags with its own bot.
  • status has shown_bot, the id of the bot whose chat the window shows in place of the panes (feature shown-bot), next to shown_remote. It is left out when no chat shows, and so is it in watch snapshots and view lines, which carry the same report. It is window state, shared by every attached window and not saved: after a restart the window shows the panes. The window’s Bots page with no chat chosen is not reported: shown_bot is left out, and shown keeps naming the place the window goes back to.
  • A program that draws a chat itself says so with view-set --bot, so the answers it shows are not counted unread or told.
  • Routines (feature bot-routines): queue add with bot (a bot’s id or name, with repeat or at and prompt, and none of project, workspace, worktree, issue, source, flow, cleanup, agent, mode, accounts or fresh) schedules the bot’s own work, as Queue work for later tells; a bot’s entry has place.bot, and a run ends answered with its session. A cornercase-access bot’s connection may add, edit, pause, resume, remove and run only its own bot’s entries, and restore only a removal of its own: anything else, and clear-started, is refused with exit 1, code failed and a bot can only schedule and change its own queue entries; queue list stays open.
  • A bot’s own commands run with CORNERCASE_BOT set (and queue add with no --project, --workspace or --worktree means that bot): kill-server, restart and update exit with 2 there (a bot cannot stop its own server), and so does config export --to (a bot cannot have cornercase write to a file), and so do cornercase with no command, remote to a machine and proxy (a bot cannot attach as a window), and so does a command that would act on the pane it runs in without a --project, --workspace or --pane (a bot runs in no pane), and so do --remote and CORNERCASE_REMOTE (a bot works on this computer only: it cannot act on another machine), plugin other than list, status, actions and logs, machines add, edit, remove, update, hide and show, and every tunnel command. Each line of requests --follow - is checked the same way.
  • The server also refuses, with exit 1 and code failed, what a cornercase-access bot types beyond a prompt to an agent (above), every request that a decision table closes to it (keys, input, flow-run and the flow writes, plugin-run, plugin-popup-close, stop-process, stop-port, changes-discard, worktrees-remove, free-builds, free-merged-builds, agents-forget, group-delete, the account and profile writes, config-pair, forum-server and the tunnel-* writes), flow-import and flow-save without check, close-agent and agents-close without check, close of anything but a pane or tab the bot started, machines set, remove and update, anything relayed with machine, start in a mode that never asks, open inside the bots’ folder or of a .code-workspace file, what stops or replaces it (restart-when-idle and update-install, and kill-server and restart, which fail with the same text: a bot cannot stop its own server), and clone (a bot cannot clone a repository). A cornercase-access bot’s connection may send only requests: a window’s messages (Hello, input and the rest) are answered Rejected with a bot cannot attach as a window and the connection is closed. It tells a bot’s commands by their process, not by CORNERCASE_BOT alone, and it adds no field or request to the contract. See what a bot can see and do.
  • The server refuses four more things to a bot’s connection, with exit 1 and code failed: bot new with an access other than cornercase and bot edit with an access (a bot cannot change a bot's access), bot say to, and any bot edit of, a bot with full access (a bot cannot write to a bot with full access), config writes (set, project, secret, remove) and config-import with apply (a bot cannot change cornercase's settings), and a view or view-set that names a bot, or a view-set --visible of a view that still names one (a bot cannot show a bot's chat in a view; --bot '' clears it and is allowed).
Terminal window
cornercase context
cornercase context --pane 4 --json
cornercase context --tab 3 --cached
cornercase context --pane 4 --json --boot 4242-1700000000

context prints what the Context dialog shows for an agent’s pane, so a script can see what fills its context before it compacts. Without --pane or --tab it reads the pane it runs in; a tab means its agent’s pane.

Claude Code · Opus 5.5 read just now
251.9k of 1M tokens · 25%
System prompt 2.7k 0.3%
System tools 4.9k 0.5%
MCP tools 8.5k 0.8%
Memory files 19.7k 2.0%
Messages 206.2k 20.6%
Free space 715.1k 71.5%
not loaded: MCP tools 199.9k · System tools 19.0k
memory files:
~/code/web-shop/AGENTS.md 8.5k

For Claude Code it starts a second claude on the server’s machine (the one agent_commands names) that loads the same conversation in the same folder, account and model. It sends no prompt and spends no tokens, starts your MCP servers a second time, turns the hooks off and waits up to 8 seconds for the MCP servers, so a read takes 3 to 10 seconds. --cached prints the last answer with its age and starts nothing. The other agents answer their model and percentage with a notice; a pane that runs no agent exits with 1.

With --json it prints {"pane", "agent", "title", "model", "percent", "compacted", "loading", "read_at", "age", "breakdown", "notice", "error"} with every key present (null when it has no value). breakdown is null until a read worked, then {"model", "conversation", "total_tokens", "max_tokens", "percent", "auto_compact_at", "categories", "memory_files", "mcp_servers", "mcp_instructions", "skills", "messages"}: categories are {id, name, tokens, kind} with kind one of used, deferred, buffer and free (read it as a string: a newer Claude Code may add one), memory_files {path, kind, tokens}, mcp_servers {name, tools, loaded, tokens} (the tokens of the loaded tools), mcp_instructions {name, tokens} (the server’s display name, which is not always the name of mcp_servers), skills {total, included, tokens} and messages the tokens of the calls, results, attachments, assistant and user text, with the tools and attachment kinds that took the most. conversation is null when the pane had none yet and the numbers are those of a new one. When the read fails, error says why beside the numbers of the last good read, and the command exits with 3.

It is the request {"command": "context", "args": {"pane": 4, "cached": false}}. A pane that runs no agent is a conflict and an unknown pane not-found. An older server answers that it has no context command.

--boot BOOT reads only on that run of the server: one that restarted since refuses with status 4 and starts nothing (see Arrange).

Terminal window
cornercase pull-request
cornercase pull-request --worktree feat/login --json
cornercase pull-request --workspace 4

pull-request prints a workspace’s pull request (the merge request on GitLab) as its dialog shows it: its state, the rollup and every check, failed first, then pending, passed and skipped, each with its workflow (a GitLab job’s stage) and the link to its job. An agent can read why its checks fail and open the failed jobs’ logs with gh run view or glab ci trace:

pull request #482 open, checks failing
Returns page crashes on an empty address
https://github.com/acme/web-shop/pull/482
failed tests (ubuntu-24.04) CI https://github.com/acme/web-shop/actions/runs/1001/job/2001
pending tests (macos-15) CI https://github.com/acme/web-shop/actions/runs/1001/job/2002
passed lint CI https://github.com/acme/web-shop/actions/runs/1001/job/2003
passed review-bot
skipped deploy Pages https://github.com/acme/web-shop/actions/runs/1002/job/2004

From a pane it reads that pane’s workspace, elsewhere the one shown; --workspace ID or --worktree BRANCH picks another. It asks gh (or glab) at once, as opening the dialog does, even while cornercase waits after a failed read, and answers when that workspace was read. A read that fails exits with 1 and says why (gh is not logged in: run gh auth login, install gh, GitHub's CLI, to see them, gh’s own line). A workspace cornercase never asks about is answered at once, with exit 0 and null, saying why: pull requests are off in settings, it is not on a branch, its repository has no remote, or it is on the default branch. So is a branch without a pull request (no pull request for feat/x).

With --json it prints {"workspace", "branch", "pull_request", "reason"}, every key present. pull_request is the object status --json gives (number, title, url, state, checks, failed, conflicts, base, provider, stack) plus all_checks, a list of {"name", "workflow", "outcome", "url"} in the dialog’s order: outcome is failed, pending, passed or skipped, workflow is empty for a commit status and url for a check without a link. pull_request is null and reason says why when there is none. It is the request {"command": "pull-request", "args": {"workspace": 4}}, answered once gh has answered; an older server answers that it has no pull-request command.

Terminal window
cornercase ports
cornercase ports --worktree feat/login --json
cornercase ports --all

ports lists the TCP ports a workspace’s programs listen on, so an agent that just started a dev server can find its URL, and you can tell which localhost:5173 belongs to which worktree:

http://localhost:5173 127.0.0.1 node vite pid 48211 workspace 4, pane 12
http://localhost:6006 0.0.0.0 :: node storybook dev pid 48390 workspace 4, agent claude in pane 9
http://localhost:3000 127.0.0.1 node next dev pid 51007 workspace 4, cwd

A program belongs to a workspace when one of its panes started it (the shell, or anything started from it), or, in a workspace with a worktree of its own, when it works inside that worktree. A plain workspace shares its folder with the others, so only its panes count. agent claude in pane 9 means the agent in that pane, or a program it started, listens there; cwd means a program started elsewhere (another terminal, say) works in the worktree. Every TCP listener is listed, HTTP or not, with the URL to open: http://localhost:PORT when it listens on every address or on 127.0.0.1, http://[::1]:PORT when only on ::1, else the address it listens on.

From a pane it lists that pane’s workspace, elsewhere the one shown; --workspace ID or --worktree BRANCH picks another, and --all lists every port your programs listen on, with the workspace each belongs to, or none. Nothing listening prints nothing is listening on a port. cornercase’s own ports (such as browser access) are left out.

With --json it prints {"ports": [...]}, each with every key present (null when it does not apply): port, addresses, url, pid, program, args (the program’s command line), project, workspace, pane, via (pane, agent or cwd; null for no workspace) and agent (the agent’s name when via is agent), plus started, the process’s start as the server reads it, left out when unknown (ports stop can check it, below). It is the request {"command": "ports", "args": {"workspace": 4, "all": false}}, answered once the server has looked; an older server answers that it has no ports command.

The text shows each program with its arguments cut to 40 characters; --json keeps args whole. The Ports dialog in a workspace’s menu and in More ▴ shows the same list, its every port the one --all gives, and a machine’s workspace has one too, which asks the machine.

Terminal window
cornercase ports stop 5173
cornercase ports stop 3000 --pid 48211 --json

ports stop PORT stops the program of a workspace that listens on that port, as the dialog’s stop does: it checks that the program still holds the port, sends it SIGTERM, waits up to three seconds for the port to be released, then sends SIGKILL. Only that process gets the signals, never the shell or agent that started it. It prints stopped node (pid 48211) on port 5173, killed … when it ignored SIGTERM, or that it is still running, and exits 1 in that last case. It refuses a port no program listens on, and one held by a program of no workspace (the ones only --all lists), so it never stops a program outside your workspaces. When several programs listen on the port, --pid says which. With --json it prints {"port", "pid", "program", "outcome"}, outcome being stopped, killed or still-running; it is the request {"command": "stop-port", "args": {"port": 5173, "pid": null}}. A program that listed the port first can add "started" with the value ports --json gave it (a process’s start as the server reads it, left out when unknown): the request is then refused with conflict when the program on that port started at another time, so a pid reused since the listing is never stopped.

Ports published by Docker (docker run -p, docker compose up) are held by Docker’s own process, not by the docker command in your tab, so they belong to no workspace: on macOS they show only with --all, and on Linux, where Docker’s proxy runs as root, not at all. A program of another user, or one in a container or another network namespace, is not seen either.

Terminal window
cornercase tunnels
cornercase tunnel open 5173
cornercase tunnel close 5173
cornercase tunnel forget 5173
cornercase --remote devbox tunnel open 5173 --json
cornercase --remote devbox tunnel hold 5173
cornercase --remote devbox tunnel hold 5173 --local 5174
cornercase --remote devbox tunnel hold --reverse 9222
cornercase tunnel close --reverse 9223
cornercase --remote devbox tunnel orders
cornercase --remote devbox tunnel failed 3000 "the user said no"

A tunnel forwards a port of the server’s machine to the computer of a window opened with cornercase remote, and the window holds it, so these commands drive what the windows attached to that server hold. tunnels lists them: 5173 → localhost:5174 up, 3000 down: Could not request local forwarding., 4000 opening, 3000 closed, with (window 3) added when several windows hold tunnels (and (hold 9) for a tunnel held by tunnel hold, 9223 ← localhost:9222 up (reverse hold 4) for a reverse one). With no window and no program taking tunnel orders attached it says no window holds tunnels for this server: open one with `cornercase remote` from the computer that should listen, or have a program there run `tunnel orders`, and with windows or such programs but no tunnel open, no tunnels.

tunnel open PORT asks every attached window and every program that takes tunnel orders (tunnel orders, below) and waits until each says whether it came up (at most 45 seconds), printing port 5173 is tunnelled to localhost:5174 for each. It exits 1, saying why, when neither a window nor such a program is attached (tunnels are held by windows or by programs, never by a command) or none came up (could not tunnel port 5173: Permission denied). The window shows a toast, a program tunnelled port 5173 to localhost:5174, with a close button. tunnel close PORT closes it in every window that holds it (closed the tunnel of port 5173) and exits 1 when none does, unless a program takes tunnel orders (below), which is always told; the tunnel stays listed as closed, because windows remember their tunnels per machine. tunnel forget PORT removes it (forgot the tunnel of port 5173), with the same exit status. A port is 1 to 65535, or the command exits with status 2.

With --json they print {"tunnels": [...], "windows": N, "takers": N}, each tunnel with every key present: port, local (the port on the window’s computer, null before there is one), state (opening, up, down or closed), error (ssh’s last line when down, else null), holder (the number of the holder’s connection, which keeps several holders’ tunnels apart) and kind (window, or hold for a tunnel held by tunnel hold); a reverse hold also has "direction": "reverse", left out for every other tunnel. windows is how many windows hold tunnels for this server, and takers how many programs take tunnel orders (an older server leaves it out). They are the requests tunnels, tunnel-open, tunnel-close and tunnel-forget ({"port": 5173}), tunnel-hold ({"port": 5173, "local": 5174}), tunnel-orders ({}) and tunnel-failed ({"port": 3000, "error": "…"}); an older server answers that it has no such command. tunnel-hold, tunnel-close and tunnel-forget also take "direction": "reverse" for a reverse hold (for tunnel-hold, port is the port on the machine and local the port of the computer that holds it). A reverse close or forget is not-found when no reverse hold lists the port, whether or not programs take tunnel orders, and tunnel-open refuses "reverse" as malformed. An older server drops direction, so check the feature tunnel-reverse first, and read direction before treating a hold entry as a forward tunnel: a reader that ignores it takes a reverse hold for a forward one of the machine’s port.

status --json has the same entries as tunnels (left out while there are none), and each entry of its machines the tunnels of that machine (see Machines’ workspaces), and events sends {"event": "tunnel", "port", "local", "state", "error", "holder"} to a reader that did not ask for one pane, with the state closed once a tunnel is closed and gone once it is forgotten, its window leaves or its hold ends; a hold’s events carry "kind": "hold", and a reverse hold’s also "direction": "reverse".

tunnel open PORT --machine NAME tunnels a port of a linked machine to this server’s computer instead: the server holds it with its own ssh, no window is needed, and it prints port 5173 of vps is tunnelled to localhost:5174 once it is up (it exits 1 with ssh’s reason when it can’t come up, and when no machine has that name). tunnel close PORT --machine NAME (or forget, the same here, since nothing is remembered) ends it. tunnels lists these after the windows’ tunnels, 5173 of vps → localhost:5174 up (this server), and with --json under machine_tunnels, each with machine, port, local, state (opening, up or down), error and registered (true once the machine lists it as a hold, left out before); status --json has the same machine_tunnels, left out while there are none. The requests take "machine": "vps"; an older server drops the key, so --machine checks the feature tunnel-machine first, and a program should too.

tunnel hold PORT is for a program with no window, such as another interface for cornercase. It needs --remote DESTINATION (it exits with 2 without it), because it runs on the computer that should listen: it starts its own ssh -N -L to that machine, waits until it is up and prints one line, {"port": 5173, "local": 5174, "url": "http://localhost:5174"}, then holds the tunnel until it ends. When it ends it prints one more line, then exits: {"ended": "closed"} or {"ended": "forgotten"} when tunnel close PORT or tunnel forget PORT is run on the server (exit 0), and {"ended": "server-stopped"} or {"ended": "server-restarted"} when the server it registered with stopped or restarted (exit 7: hold it again once the server is back). The tunnel-hold request’s stream carries the close and forget lines (feature tunnel-hold-ended); a server that was not restarted after an update says nothing on a close or a forget, and the hold exits 0 without the line. It exits 0 with no line when it is killed (SIGTERM, SIGINT or SIGHUP) or when what reads its output leaves (on Windows it does not notice that, since it writes nothing while it holds), and 1 when ssh fails, before or after the tunnel was up, or the connection to the server is lost with no message; it is not retried, and it remembers nothing. The server lists it with kind hold, and windows does not count it, so tunnel open still needs a window, or a program that takes tunnel orders (below). If it fails before the server counts it (its ssh or the local port), it tells the server, so a tunnel open that waits for it fails with that reason. Killed with SIGKILL, it leaves its ssh until the connection drops. --local N is the port of this computer to listen on when PORT is taken here, as a window’s tunnel takes the one it had before: a program that remembers its holds passes it, and any free port is taken when N is taken too (the line’s local says which).

tunnel hold --reverse LOCAL [--there PORT] is the other direction, for a program on the computer whose port LOCAL should be reachable on the machine’s 127.0.0.1 (an agent there reaching a browser’s DevTools port, say). It needs --remote DESTINATION (status 2 without it, and with a PORT or --local, or --there without --reverse) and starts its own ssh -N -R 127.0.0.1:THERE:localhost:LOCAL. THERE is a free port the machine’s ssh server picks, or --there PORT, which fails at once, with status 1 and ssh’s remote port forwarding failed for listen port PORT, when PORT is taken there. Once it is up it prints one line, {"port": 41234, "local": 9222, "url": "http://127.0.0.1:41234", "direction": "reverse"} (port on the machine, local here), and ends as tunnel hold PORT does, with the same last line and statuses: tunnel close --reverse 41234 or tunnel forget --reverse 41234 run on the server (without --reverse they never touch it, nor does --reverse touch a forward tunnel of the same number) end it with exit 0, and 1 when ssh fails. It checks the feature tunnel-reverse before sending anything. Programs that take tunnel orders are not told of a reverse close or forget, a reverse hold never answers a tunnel open, and nothing but the computer that owns the port can open one. It listens only on the machine’s loopback, which every program and user of that machine can reach (and every address under GatewayPorts yes in its sshd_config).

tunnel orders is for the same kind of program, when scripts and agents on the server’s machine should be able to ask it for a tunnel. It needs --remote DESTINATION too (status 2 without it) and takes no --json: it prints one line once the server counts it, {"tunnels": [], "windows": 0, "takers": 1}, then one line per order for as long as it runs, {"order": "open", "port": 3000}, or close or forget in place of open; several such programs each get every order. tunnel open 3000 on the server then asks it and waits: the program answers by holding the port with tunnel hold 3000, which settles the request with the hold’s line, or with tunnel failed 3000 "the user said no" ({"port", "error"} as the request tunnel-failed), which fails it with could not tunnel port 3000: the user said no; tunnel failed prints reported that port 3000 could not be tunnelled (with --json, that port’s list) and exits 0 even when no request waits for that port. A program that already holds the port can ignore an open. On close or forget it stops a hold it is still starting and updates what it remembers; its holds of that port end by themselves. The server cannot know what such a program holds or remembers, so tunnel close and tunnel forget are never refused as unknown while one listens. When the last one leaves, a request that waited only for it fails with no program answered. It exits 0 when its output reader leaves or the server stops, and 1 when the connection is lost; a connection cannot both hold a tunnel and take orders.

Terminal window
cornercase processes
cornercase processes --pane 12 --json
cornercase processes --workspace 3 --interval 2000

processes lists what every pane runs, as the Processes dialog does: for each pane the processes under its shell, each with its CPU and memory, then cornercase’s own use and the total:

pane 12 npm 98.0% 812 MB
4200 zsh 0.0% 4 MB
4210 npm run dev 0.1% 60 MB
4211 └ node vite 97.9% 740 MB
cornercase 0.8% 85 MB
total: 1 pane, 3 processes, cpu 98.8%, 897 MB

CPU is the share of one core over --interval milliseconds (100 to 10000, default 1000: the command takes that long), so it can pass 100%. Memory is each process’s footprint, the figure the tab rows show. By default it lists every pane; --pane ID, --workspace ID or --worktree BRANCH narrow it, and then leave cornercase’s line out. The text sorts the panes by CPU, highest first; --json keeps the sidebar’s order.

With --json it prints {"interval", "total", "panes", "cornercase"}. total has cpu, memory, panes and processes. Each pane has pane, tab, workspace, project, program, agent, foreground (the pid of its foreground program when it is not the shell), pid (its shell), cpu, memory and processes, each process with pid, parent, name, args, started, cpu and memory, in tree order; a figure the server cannot read is null. started is only to be passed back to stop. It is the request {"command": "processes", "args": {"pane": 12, "interval": 1000}}, answered once the server has measured; cornercase contract lists it.

Terminal window
cornercase processes stop 4211
cornercase processes stop 4211 --started 81240 --json

processes stop PID stops a program of a pane and everything it started, as the dialog’s stop does: SIGTERM, up to three seconds, then SIGKILL to what still runs. It prints stopped node (pid 4211) and 2 programs it started, killed … when they ignored SIGTERM, or that something is still running, and exits 1 in that last case. It refuses with conflict a pane’s shell (cornercase close --pane ID closes the pane instead), cornercase itself and any process of no pane, and with not-found a pid that is not running; --started refuses a pid that another program reused since the list. With --json it prints {"pid", "program", "pane", "outcome", "processes"}, outcome being stopped, killed or still-running; it is the request {"command": "stop-process", "args": {"pid": 4211, "started": null}}. Both commands work with --remote.

Terminal window
cornercase worktrees list
cornercase worktrees list --project 2 --json
cornercase worktrees size --worktree feat/login
cornercase worktrees free-builds --worktree feat/login --check
cornercase worktrees free-builds --worktree feat/login
cornercase worktrees free-builds --merged --check
cornercase worktrees free-builds --merged
cornercase worktrees remove --path ~/.cornercase/worktrees/web-shop/feat-login --check
cornercase worktrees remove --path ~/.cornercase/worktrees/web-shop/feat-login --delete-branch

worktrees list prints every worktree on disk as the Worktrees dialog lists it, in its order: the leftovers first (prunable, repository gone, unknown to git), then the merged ones, then the rest, the oldest first. Each shows its project and branch, its folder, when it last changed, its size with the part in build folders and, under it, what removing it would lose or stop, in the words of the dialog’s confirmation:

web-shop › fix/login ~/.cornercase/worktrees/web-shop/fix-login 3 days ago 2.4 GB (2.1 GB of builds) merged workspace 7
nothing uncommitted or unpushed
web-shop › feat/gift-cards ~/.cornercase/worktrees/web-shop/feat-gift-cards 2h ago 1.1 GB (900 MB of builds) workspace 9
3 files changed
2 commits not pushed
codex running in it; they stop
3.5 GB in 2 worktrees · 2.1 GB of builds idle 7+ days
2.1 GB of builds in 1 merged worktree: cornercase worktrees free-builds --merged

The last line adds up the build folders of the merged worktrees the dialog lets you free, with the command that frees them; it carries --project ID when the list had one, and starts with cornercase --remote … when the list came through --remote, so copying it never frees another machine’s worktrees. It is left out when no merged worktree holds builds and with --no-sizes.

It covers the worktrees of the open projects and those that closed projects left in the worktrees folder; --project ID lists one project’s (it must be at a repository’s root, else it is refused). It removes nothing. Measuring walks every worktree, two at a time, which takes a while with a big node_modules or target/; --no-sizes answers without it. A worktree that could not be checked or measured says so, and the command exits 3 after printing the rest.

With --json it prints {"worktrees": [...]}, each with path, kind (linked, prunable, repository-gone or unknown-to-git), project_name, repository, branch, project and workspace (their ids when it is open in cornercase, else null), last_changed (UTC), changed and unpushed (null when it was not checked), merged, no_commits, upstream_gone, lock (as close --check gives it), running (the programs of its workspace), outside (processes working in it that cornercase did not start), other_tabs, removing, run_role (it goes with its flow run’s workspace), safe, risks, error, size (as worktrees size --json, null with --no-sizes) and size_error. safe is true when removing it loses no uncommitted file and stops no program: it was checked, has no changed or untracked file and no lock, and nothing runs in it. Commits not pushed stay on its branch, so they do not make it unsafe; deleting the branch too loses them unless it is merged at that commit. risks lists what the dialog’s confirmation would say, empty when nothing. It is the request {"command": "worktrees", "args": {"project": null, "sizes": true}}; cornercase contract lists the operation worktrees, and an older server answers that it has no such command. To remove what it lists, see worktrees remove.

worktrees size measures a worktree, as the Worktrees dialog does: the bytes removing it would free, and the part in build folders, the folders git ignores whose names are on the project’s list (node_modules, target, .next, .turbo, dist, build, .venv and __pycache__ unless config project --builds changed it):

2.4 GB ~/.cornercase/worktrees/web-shop/feat-login (2.1 GB of builds)
1.9 GB node_modules
180 MB packages/web/.next

The target is a workspace with a worktree of its own (--workspace ID, --worktree BRANCH, or the one the command runs in), or any linked worktree by --path, open in cornercase or not. A plain workspace has no worktree of its own and the main checkout is not one: both are refused. A walk of a big tree takes a second or more.

worktrees free-builds deletes those folders and keeps the worktree, its branch, its files and its uncommitted changes. --check prints would free 2.1 GB in … and running: node, claude, the programs working in the worktree, and deletes nothing. Without --force it refuses (exit 1) while a program runs there or a build folder holds a git checkout of its own, naming them; the dialog only warns, but a script cannot read a warning, so tell the person first and pass --force once they agreed. A worktree being removed is refused whatever the flags, as its teardown may need those folders. The list is checked again when it deletes, so a folder git stopped ignoring is kept. A folder that could not be deleted, or was kept, is named and the command exits 3, after printing everything else. A flow run started with flow run --close-when-merged --free-builds does this by itself, without --force, once its pull request merged and its agents closed.

With --json, size prints {"path", "bytes", "builds_bytes", "builds": [{"path", "bytes"}], "nested"} (nested lists git checkouts found inside build folders), and free-builds prints {"path", "check", "bytes", "folders", "kept", "failed": [{"path", "error"}], "running"}. They are the requests {"command": "worktree-size", "args": {"workspace": 4}} and {"command": "free-builds", "args": {"path": "/…/feat-login", "check": true, "force": false}}, each with workspace or path (not both); an older server answers that it has no such command. cornercase contract lists the feature build-folders.

worktrees free-builds --merged frees the build folders of every merged worktree, the ones worktrees list adds up on its last line: a worktree whose branch is merged (or whose pull request is), that the dialog lets you free (not being removed or freed, not a flow run’s role worktree). --check says what would go and deletes nothing; --project ID takes one project’s worktrees. It never forces: a worktree where a program runs, or whose build folder holds a git checkout, keeps its builds and is named with why, and the command exits 3 after printing the rest (--check too). It cannot be combined with --workspace, --worktree, --path or --force (exit 2): free one worktree with --path … --force after telling the person. One worktree after another, one line each, then a summary; a merged worktree with nothing to free is left out, so a routine can run it every hour:

freed 25.5 GB in ~/.cornercase/worktrees/shop/issue-106: target 25.5 GB
freed 15.7 GB in ~/.cornercase/worktrees/shop/issue-143: target 15.7 GB
did not free ~/.cornercase/worktrees/shop/issue-156: cargo runs in it
freed 41.2 GB in 2 merged worktrees

With --json it prints {"check", "bytes", "worktrees": [...]}, each entry the free-builds answer of that worktree plus outcome (freed, freeable with --check, refused or failed) and why, and worktrees list --json gains "merged_builds": {"bytes", "count"} whenever sizes were measured (left out with --no-sizes). The request is {"command": "free-merged-builds", "args": {"project": null, "check": false}} (an older server refuses it by name, and a force field is an unknown field); cornercase contract lists the feature merged-builds for the merged_builds total.

worktrees remove --path FOLDER… removes what the Worktrees dialog removes, each worktree named by its folder as worktrees list prints it, open in cornercase or not. Each goes the dialog’s way: an open workspace stops its programs, runs its project’s teardown and goes; a closed project’s worktree runs that teardown too; a prunable entry leaves git’s list; a folder whose repository is gone or that git no longer knows is deleted.

Only a folder worktrees list knows is ever touched, compared by its real path. Anything else is refused for that folder, in words, and left alone: a repository’s main checkout, a project’s own folder, a plain folder, a folder inside a worktree, a link to any of those. A link to a listed folder removes that folder and leaves the link, but a worktree moved away with a link left where git records it is refused, since git would delete through the link: move it back or run git worktree repair. A folder holding another listed worktree or an open project is refused too, since that one would go with it unseen: remove the inner one first, or close the project. What the dialog cannot tick is refused as well: a worktree of a role of a live flow run (it goes with the run’s workspace, also when you name both), one being removed or closed, one whose build folders are being freed, also through worktrees free-builds, or a run’s workspace when that is happening to one of its roles. So is an open workspace whose folder git no longer knows: close it, then remove the folder.

--check prints what the dialog’s confirmation would name, stops nothing and deletes nothing:

web-shop › fix/login ~/.cornercase/worktrees/web-shop/fix-login
nothing uncommitted or unpushed
web-shop › feat/gift-cards ~/.cornercase/worktrees/web-shop/feat-gift-cards
3 files changed
2 commits not pushed
locked: on a usb disk
codex running in it; they stop
1 process outside cornercase: node
teardown runs first
removing it takes --force and --unlock

Without --check the folders are checked again the same way before anything stops. The dialog names a risk and lets you go on, but a script cannot read a warning, so a folder at risk is refused until you say so:

  • --force is needed when it has uncommitted files or could not be checked, when programs work in it (its workspace’s, in another tab or outside cornercase), when its files are all that is left (repository gone, unknown to git), when it holds commits on no branch, or when --delete-branch would lose commits. Commits not pushed on a branch that stays do not need it.
  • --unlock is needed for a locked worktree, --force or not, and does not imply --force.

--delete-branch deletes the branch checked out there once the worktree is gone, and a run’s workspace also deletes its roles’ branches. It follows the dialog’s rules: never the default branch or the main checkout’s, and only the branch still checked out when the removal starts, at the commit the check saw, so one switched or moved since is kept and named. A merged pull request covers a branch only at the commit it ended at: a commit made after the merge counts as lost.

The command waits until every removal has ended and prints one line per folder:

removed ~/.cornercase/worktrees/web-shop/fix-login and the branch fix/login
did not remove ~/.cornercase/worktrees/web-shop/feat-gift-cards: 3 files changed, codex running in it; they stop; add --force to remove it anyway
did not remove ~/code/web-shop: it is a repository's main checkout, which is never removed

It exits 3, after printing the rest, when some folder was not removed, its branch was kept or could not be deleted, its teardown failed, or only git’s entry went and its folder stays; with --check, when some folder or role cannot be removed or checked. So exit 3 does not mean the folder is still there: read its line. If the command goes away before the removals start, for example with Ctrl+C during the check, nothing happens; once they started they run to their end. The window shows no message, as for close --remove-worktree.

With --json it prints {"check", "folders": [...]}, one per --path, in order, each with path (the listed folder), outcome (removed, failed, refused, or removable with --check), why, needs (force, unlock: what removing it takes), removed_with (a role’s run’s workspace), branches (deleted), kept (branches kept, and why), warnings (a failed teardown, a role that stayed, a branch that could not go or, when a run’s workspace failed, the roles that had already gone), lines and lost (what the confirmation names, and in red with the branch deleted, whether you asked for that or not), unchecked (what could not be checked, its own folder’s or a role’s), teardown, roles (role, path, branch of the worktrees that go with it) and worktree (the row as worktrees list --json gives it). It is the request {"command": "worktrees-remove", "args": {"paths": ["/…/feat-login"], "check": false, "force": false, "unlock": false, "delete_branch": false}}, a path there must be absolute; cornercase contract lists the operation worktrees-remove, and an older server answers that it has no such command. It works with --remote, where each path is the machine’s.

Terminal window
cornercase stats
cornercase stats --json
cornercase stats --share
cornercase stats --machine all
cornercase stats --cached --machine all --json

stats prints the parallel-work headline, the 24 h / 7 days / total table and a text heatmap (·░▒▓█). With a server it includes numbers still in memory; without one it reads stats.json. An older server that has no stats command says to update cornercase and restart it.

--json prints an object with since (UTC), windows (24h, 7d, total) and blocks (newest first). Each window has agents, prompts, turns, agent_seconds, busy_seconds, most_at_once, waited_seconds, tokens (in, out, cache_read, cache_write) and by_agent (claude, codex, gemini, opencode). Durations preserve milliseconds as fractional seconds. Busy time and most-at-once span all kinds; the per-agent counters contain starts, prompts, turns, working/waiting durations and token kinds. Every key is present, even when zero. Each block gives agent_seconds. merged_pull_requests is null unless the server has read your merged pull requests (see Usage and stats); otherwise it has 24h, 7d, total, complete (false when a count is a lower bound) and accounts (provider, host, login, error). The text form adds a merged PRs row, with a + after an incomplete number; a server is needed for it.

--share prints the same share link as Usage → Stats → share. Copy and post it yourself; anyone with the link sees the numbers on the card. See Usage and stats for the counting rules and privacy.

--machine NAME prints the stats of one of your machines instead, with a line above that says when it was read, and --machine all the sum of this computer’s and every machine’s, followed by the list of what was summed:

most at once: the largest peak of one machine, not a sum
summed from:
▭ this computer
● vps read 4 min ago
○ mini ssh: connect to host mini port 22: Connection refused · not summed

The numbers add up hour by hour. most_at_once is the largest peak of one machine, not a sum; busy_seconds adds up, so it counts machine-hours; merged_pull_requests stays only when every machine reads the same accounts. A machine that is down is summed from the numbers it gave last: its blocks move on by the whole days since read_at, while its 24h and 7d count as they were read. With --json, a machine adds machine (name, state, seen, read_at, error, as in Plan usage), and all adds machines, where a machine is in the sum when its read_at isn’t null. --machine needs a running server, which asks the machine. It is the request {"command": "stats", "args": {"machine": "vps"}}, with the feature machine-usage.

--cached with --machine asks nothing and answers at once from the numbers your server read last, so a program can show them while it asks again: run it first, then the same without --cached, and show the fresh answer when it comes. The answer is the same, with machine or machines saying when each machine was read and seen, its state and any error, and a copy’s blocks moved on by the whole days since read_at. Under all, a machine with no numbers yet is left out of the sum with the error not read yet; named alone, it fails, naming the machine and why. Without --machine, --cached changes nothing, since stats never waits. It is the request {"command": "stats", "args": {"machine": "all", "cached": true}}, with the feature stats-cached: an older server ignores cached and asks the machine, so check it first, as --cached does.

Terminal window
cornercase config
cornercase config --json
cornercase config --json | jq -c '.agents[] | select(.flows) | .name'
cornercase config models opencode
cornercase config search def ag
cornercase config set sidebar tree
cornercase config set fetch_minutes 10 counts false
cornercase config set issue_tabs github,linear
cornercase config set shell /usr/bin/fish shell.args -l
printf '%s' "$LINEAR_API_KEY" | cornercase config secret linear
cornercase config remove linear
cornercase config project ~/code/web-shop --setup 'npm ci' --teardown 'rm -rf node_modules'
cornercase config project ~/code/web-shop --builds 'node_modules .next'
cornercase config pair browsers --json

A bot’s connection is refused config writes and an applied config-import: they would let it change what counts as an agent.

config lists every setting of the Settings dialog, the connections (accounts and bots), each project’s setup, teardown and build folders and, with --json, what each agent can do. A setting that the dialog shows as a row has a key, the name of its config.json key (an agent’s mode and extra arguments are agents.claude.mode and agents.claude.extra, and the issue tabs are one list, issue_tabs; every choice of an agent’s mode, default included, is a value that start --mode and queue add --mode take), so a program can draw a form from the answer instead of knowing each row.

set takes KEY VALUE pairs and changes them as the dialog does: the same checks, the same live effects (browser access starts or stops, keep awake takes effect, the layout changes) and the same notices. Either every value is accepted and saved, or nothing is. On the command line the value is converted by the setting’s type: true or false (also on, off, yes, no) for a switch, a whole number, a comma-separated list for list, otherwise text.

A token is never an argument. secret KEY reads it from standard input (hidden on a terminal), checks it with its service exactly as the dialog does (a tracker’s token check, a bot’s getMe), saves it and answers with the account, never the token. remove KEY forgets a token, a bot, a paired chat (telegram.chat, discord.chat) or the paired browsers (browsers). A token that comes from an environment variable cannot be replaced or removed from here, as in the dialog. Pairing a phone stays in the window: it needs its QR code.

project sets what a project’s folder runs when a worktree is made and before one goes; --project ID or the folder names it, and an empty text removes the commands. Only a repository’s root has worktrees, so a folder that isn’t one is refused.

search finds settings as the search of the Settings dialog does, with the same matching and order: every word must start a word of a row’s label, section, tab, value or note. It prints one tab-separated row per result under a header (place, key, value, note, - for what is missing), or with --json {"results": [...]}, each with title, page, section, label, key (absent on a tab or a row with no key), shown, note and hidden, true for a row that does not show now, whose note says what it needs. No match prints the header alone and exits 0.

Over the socket, every other answer has the same shape and the request is {"command": "config", "args": {"action": "get"}} (or "set", "project", "secret", "remove", each with its entry; "search" takes the text as its entry, needs the feature settings-search and answers results):

{"command": "config", "args": {"action": "set", "entry": {"fetch_minutes": 10, "sidebar": "tree"}}}
{"command": "config", "args": {"action": "project", "entry": {"path": "~/code/web-shop", "setup": "npm ci"}}}
{"command": "config", "args": {"action": "secret", "entry": {"key": "linear", "value": "lin_api_…"}}}
{"command": "config", "args": {"action": "remove", "entry": "linear"}}
  • settings: for each one, key, page and section (where the dialog shows it), label, type (switch, number, text, choice, list or key), value and default (as JSON), shown (what the dialog shows as its value), note, choices (for a choice and the list: value, note, dangerous; for shell, a text, the shells found, offered as suggestions while any program is taken), field (the label of its edit field), question (the title of its pick), dangerous and restart. restart says the change only applies after a restart; none of today’s settings does. set takes strict JSON types: true, a number, a string, a list of strings.

  • connections: key (shortcut, linear, jira, plane, gitlab, asana, browsers, telegram, telegram.chat, discord, discord.chat), kind, label, note, state (missing, connected or refused), account (who it is connected as), from (saved or env) and env for a token from the environment, count for the paired browsers, field (what to paste) and removable. A token or a bot is set with secret, never through set.

  • projects: folder, key (as written in config.json), project (the id of the open project in that folder), repository, setup and teardown.

  • agents: each agent the default agent setting can name, in the order of its choices (auto aside): the agents cornercase knows, the others it can start, then your own from agent_commands. Each has name; title, for an agent cornercase knows (Claude Code), left out for the others; reads_status, true when cornercase reads its status by itself, so a routine can remove its workspace when it finishes (queue add --cleanup refuses the others) and wait can wait on it without OSC 7501 reports; flows, true when a flow’s role can run it (flow save --check names the others as a problem); models, the models the flow editor offers for it at once, as suggestions (any other is passed on as given, except that Vibe CLI takes no model: a role’s model for it is a problem, and so is start --model; an empty list offers none); catalogue, true when the agent keeps a list of models of its own that the flow editor reads when you pick a role’s model (opencode, from the models.dev list it caches): models is then only the start, and config models gives the whole list; and efforts, the levels start --effort and a role’s effort take, empty when it has no effort switch. reads_status and flows agree today but may not later, so read each for what it says. The text form leaves the agents out, and a server without the feature config-agents leaves out agents.

    Three of them:

    {"name": "claude", "title": "Claude Code", "reads_status": true, "flows": true, "models": ["opus", "sonnet", "haiku"], "catalogue": false, "efforts": ["low", "medium", "high", "xhigh", "max"]}
    {"name": "opencode", "title": "opencode", "reads_status": true, "flows": true, "models": [], "catalogue": true, "efforts": []}
    {"name": "amp", "reads_status": false, "flows": false, "models": [], "catalogue": false, "efforts": []}
  • revision, path (the config.json file), problem (why it cannot be read, when it cannot) and notices: what the dialog would have said for each change made.

revision goes up when a setting, a project’s commands or a connection changes, however it changed (the dialog, a request, or an edit of the file), and status --json, status --follow and view lines carry it as config.revision: a program that mirrors the session reads the settings again when it grows. It also goes up when the note under remote access or phone app changes (starting, ready at an address, waiting for an address, a port another program holds, not available, a browser connected, off), and set answers once the switch it changed has settled: the phone app’s note is its final one, and remote access says starting… until Tailscale answers, which moves revision again. Other notes that change by themselves, such as the keep-awake state, don’t move it.

A refusal has a code: not-found for a key that names no setting or connection, malformed for a value of the wrong type or one the dialog’s check refuses (the message is the dialog’s), conflict for what the current state blocks (a token set by an environment variable, Jira’s site and email missing, a folder that isn’t a repository, a config.json cornercase cannot read), and failed when the service refused a token. Changes made through set never write over a config.json that cannot be read.

Terminal window
cornercase config models opencode
cornercase config models opencode --json

It prints every model the flow editor offers for an agent, one per line: the agent’s models and, when its catalogue is true, the list it keeps (for opencode, the models.dev list it caches), read when you ask. An agent that offers none prints nothing. With --json it prints {"agent": "opencode", "models": ["deepseek/deepseek-v4-flash", "deepseek/deepseek-v4-pro"]}.

Over the socket it is {"command": "agent-models", "args": {"agent": "opencode"}}, answered once the list is read, while config itself answers at once. An agent the default agent setting cannot name is not-found, and the message names the ones it can. With --remote it reads that machine’s list. An older server refuses the request by name and leaves catalogue out; the feature agent-models says it has both.

Terminal window
cornercase config set remote true
cornercase config pair browsers --json
printf '%s' "$BOT_TOKEN" | cornercase config secret telegram
cornercase config pair telegram.chat --json
cornercase config pair discord.chat
cornercase config set phone_app true
cornercase config pair app --json
cornercase config pair app --routes --json
cornercase config pair app --new-certificate --json

config pair KEY does what the window’s dialog does, for a program that draws cornercase itself: for browsers what opening More ▴ › remote… › open in your phone’s browser does (From your phone), for app what Enter on pair a phone app does (The phone app), for telegram.chat and discord.chat what Enter on the phone row does (On Telegram, On Discord). The keys are the ones config remove takes. Nothing opens in the window.

It prints what the dialog draws, and again each time that changes: with --json, one line of JSON each, for your program to draw the QR code from url. Without --json it prints the same for a person to read.

{"url": "https://mac.tail1234.ts.net:8443/pair?t=0123456789abcdef0123456789abcdef", "lines": ["scan the code with your phone's camera.", "the phone needs the Tailscale app, logged in as ada@example.com."]}

url is null while there is none: while Tailscale starts, lines says so, and the next line has the address or, if Tailscale isn’t ready (logged out, say), is the last line and says why. On Discord a new line says what to change in the Developer Portal, or a failure. On either bot, a chat that can’t be saved isn’t paired: a new line says why, and the phone can try again.

The app key needs phone_app on (config set phone_app true): with it off the command fails with conflict, and with its port taken with unavailable. Its url is the app’s own code, wss://HOST:PORT/?code=CODE&also=HOST&name=NAME&fp=FINGERPRINT, with also= for each further address, the computer’s name percent-encoded and fp, the SHA-256 of the certificate cornercase presents, in base64url without padding (43 characters). The app opens it as a WebSocket over TLS and must accept that certificate only, whatever the address; it answers {"secret": "ID.SECRET"} and closes, and the command ends with {"paired": true}. The same port still answers plain ws://, for apps paired before. --routes does not wait: it prints one HOST:PORT per line, or with --json {"routes": [{"host": "192.168.1.20", "port": 47682}], "fingerprint": "…"}, the addresses the app can use now and the certificate it must find there. A paired app is a connection app.ID in config; config remove app.ID forgets it and closes its connections.

--new-certificate makes a new certificate first: every paired app is forgotten and its connections close, then the command goes on as above with the new code, and says once on standard error that the certificate is new. It goes with app only, and not with --routes.

Over the socket the routes are {"command": "app-routes"}, which an older server refuses by name, and a new certificate is {"command": "config-pair", "args": {"key": "app", "new_certificate": true}}, with the feature cli-tls.

It stays open while it waits, and its last line, the only one with paired, says how it ended:

  • {"paired": true} once a browser took the code, or {"paired": true, "chat": "@ada"} with the name of the chat that was paired, and status 0.
  • {"paired": false, "error": "…"} and status 1 once nothing can pair: Tailscale is not ready, remote access was turned off, the bot was removed or its token refused, or ten minutes went by without a phone. The error also goes to standard error.

What cannot start at all prints nothing and exits with 1, with the reason on standard error: remote access is off…, paste the bot's token first, Tailscale not installed, the port taken, or a key that cannot be paired. Over the socket these are refusals with a code: conflict for what you can change, unavailable for what you can’t from here (Tailscale not installed, the port taken), malformed for another key.

The code is dropped when the command ends, also when whoever reads its output goes, as for every command that follows a stream. A code works once, and the address holds it, so treat the line as a secret; cornercase never writes it to its log. A command or the window’s dialog that holds the same key shares that code: the same address shows in all of them, its ten minutes start again with each one that comes, a phone taking it ends them all, and it is dropped when the last one goes, so closing the dialog doesn’t stop a command, nor the reverse. Once paired, the window says so as it does for its own dialog, whether or not you are looking at it.

Discord has no code: the link adds the app to your account, and cornercase asks Discord for the owner while this runs or the dialog is open. With --remote the address is that machine’s, and the phone pairs with its cornercase.

Over the socket the request is {"command": "config-pair", "args": {"key": "browsers"}}, and each line above comes as {"ok": …} on that connection, which holds one pairing. A line of requests --follow refuses it, since it keeps a connection of its own.

For the developer of a phone app. A paired app runs commands at wss://HOST:PORT/cli, accepting only the certificate whose fingerprint its code holds (plain ws:// on the same port still works, for apps paired before), one WebSocket per command, with the secret in Authorization: Bearer ID.SECRET (without it, or with a forgotten one, the answer is 403 and nothing runs). Each message is one JSON object with exactly one key.

Direction Message
to the server {"argv": ["status", "--json"]}, first and once, within 10 seconds
to the server {"stdin": "a line"} (written with a newline), {"stdin_base64": "…"} (standard base64, padded) and {"eof": true}
from the server {"stdout": "a line"} and {"stderr": "a line"}, one per line without the newline
from the server {"exit": N}, exactly once and last, then a normal close

It runs cornercase ARGV as the command line does. N is the command’s status (128 plus the signal when a signal ended it on Linux and macOS, -1 when waiting failed). A protocol error, a refused command, a line past 16 MiB or a message past 1 MiB is one stderr line and {"exit": 2}. What may run is what a line of requests --follow - may run: the commands that ask the running server, so not the window, start-server, kill-server, update, restart, logs, remote, plugin list and the like; --remote and --remote-command are refused in any position. A command that follows something (events, surface) runs until the app closes the socket.

The server sends a ping every 15 seconds; after 45 seconds without hearing anything it kills the command and its process group, as it does when the app closes or the link breaks. A client that stops reading blocks the command, and the server’s memory does not grow. When the server stops or the phone app is switched off, the close is 1001 and there is no exit: the server ends the stream right after it; when the phone app is switched off, it then waits up to 2 seconds for the app to close its side. A forgotten app’s connections are cut without a close frame.

With forum mode on and the app in several of your servers, the setup waits for you to pick one. Discord’s row of status --app says so and lists them, as the dialog does:

{"platform": "discord", "ready": true, "away": false, "forum": {"on": true, "ready": false, "guild": null, "channel": null, "pending": "pick the server for the forum", "servers": [{"id": "1041234567890123457", "name": "home"}, {"id": "1041234567890123459", "name": "work"}]}}
Terminal window
cornercase config forum-server 1041234567890123459
cornercase status --app --follow | jq -c '.away[] | select(.platform == "discord") | .forum'

config forum-server ID is a click on that server in the Discord forum dialog: the forum channel is made there, Discord forum ready in <server> › #cornercase shows, and forum goes on to ready, with its guild and channel. servers is there only while picking is the step pending names, not while an earlier step is left, so whatever it lists can be picked.

It answers as soon as the pick is taken, before Discord is asked: with --json the server’s id and name, otherwise a line saying so. A forum that cannot be made keeps trying and may never be ready, so nothing waits for it. pending moves on to the step that makes the channel at once: follow status --app until ready is true. What stops it, such as a permission the bot lacks, is the note of discord_forum in config, and if the app left that server, pending asks for the pick again and the list comes back.

Over the socket it is {"command": "forum-server", "args": {"id": "1041234567890123459"}}, and the id is text, as in servers: Discord’s ids don’t fit a JavaScript number, so a number is malformed. An id that isn’t listed is refused with not-found, which names the ones that are, and a wrong moment with conflict, which says why: no bot, no paired phone, forum mode off, or no pick waiting, with the step left or what failed. An older server refuses the request by name, and contract’s operations lists it on one that has it; pending naming the pick with no servers also means the server is older, and only its window can pick.

Terminal window
cornercase config export --to team.toml
cornercase config import team.toml
cornercase config import team.toml --only agents,worktrees
cornercase config import - --yes < team.toml
cornercase config import team.toml --preview --json

config export prints the settings you can hand to a colleague, as the TOML text that copy my setup copies in the settings, or writes it to the file --to names, readable only by you (inside a bot --to is refused with status 2; without it the settings are printed). Standard error says what it left out (tokens, bots, paired chats, browsers and phone apps, accounts and profiles, jira_email, remote access, the phone app and keep awake, and each project that has no git remote) and, after a !, every place where a setup, an argument or a prompt looks like it holds a secret.

config import shows on standard error what the file would change, section by section, with the same notes as Settings › Import, then asks Import these settings? [y/N]. Reading standard input (-), or with no terminal to ask on, it imports only with --yes. --only takes some of the sections: agents, issues, worktrees, interface and repositories. Either the ticked sections are all saved, or nothing is: a file from a newer cornercase’s format, a value the settings refuse or two repositories matching one project leave config.json as it was, and the command exits with 1 and the reason. A setting this cornercase does not know is skipped and named, not refused.

config import --preview prints that same preview and exits 0, without asking and without saving anything. On standard output it is the text an import shows before the question; with --json it is the preview a program can draw, each section’s changes and notes. It works when reading standard input and when there is no terminal, so it needs no --yes. A file that is not a setup, a newer format, a value the settings refuse, two repositories matching one project, or a project that stopped being a repository still exits with 1 and the reason, and nothing is saved. --preview and --yes cannot be used together. Show the preview, then import the sections you want with config import FILE --only agents,interface --yes.

Over the socket, config-export answers text, the counts of settings and repositories, left_out and warnings. config-import takes the text, sections (every one when left out) and apply:

{"command": "config-export", "args": {}}
{"command": "config-import", "args": {"text": "version = 1\n[interface]\nsidebar = \"tree\"\n", "sections": ["interface"], "apply": false}}

Without apply nothing is saved and the answer is the preview: sections, each with its id, its changes (key, label, from and to, as the dialog shows them; a repository’s setup and teardown are a change each, repositories.setup and repositories.teardown, labelled with the project’s folder and holding the whole script) and its notes, then the notes that belong to no section; each note has a kind (risk, secret, missing, connect, repository or unknown) and its text. With apply it saves the sections and answers as config does, with the notices. An import is refused with malformed for a file that is no setup, a newer format or a value the settings refuse, and conflict for a project that stopped being a repository or a config.json cornercase cannot read; a preview is refused for the same reasons, but the last, so what it shows can be imported.

Terminal window
cornercase machines --json
cornercase machines add vps ana@vps.example.com --icon server
cornercase machines edit vps --folder '~/src'
cornercase machines retry
cornercase machines hide vps
cornercase machines show all
cornercase machines update mini --json

machines lists the machines of Settings › Machines, each with the state of the link your server keeps to its server, and changes the list with the Settings tab’s own checks. It needs no window. Over the socket it is one request, with an action and its entry, and every action answers the whole list:

{"command": "machines", "args": {"action": "list"}}
{"command": "machines", "args": {"action": "set", "entry": {"name": "vps", "new_name": null, "icon": "server", "destination": "ana@vps.example.com", "folder": null, "create": true, "command": null, "shown": null}}}
{"command": "machines", "args": {"action": "remove", "entry": "vps"}}
{"command": "machines", "args": {"action": "update", "entry": "mini"}}
{"command": "machines", "args": {"action": "retry", "entry": null}}
{"command": "machines", "args": {"action": "hide", "entry": "vps"}}
{"command": "machines", "args": {"action": "show", "entry": null}}
{"here": {"icon": "▭", "version": "0.12.225",
"memory": {"total": 17179869184, "available": 6442450944, "read_at": "2026-10-29T10:00:00.000Z"}},
"machines": [{"name": "vps", "icon": "☁", "destination": "ana@vps.example.com", "folder": "~/code",
"state": "linked", "version": "0.12.225", "server_version": "0.12.225", "seen": "2026-10-29T10:00:00.000Z",
"error": null, "updating": false, "problem": null,
"memory": {"total": 34359738368, "available": 9878424780, "read_at": "2026-10-29T09:59:40.000Z"}}]}
  • state is connecting, linked, unreachable or older. version is the cornercase installed there (for older, the old one) and server_version the one its server runs, which differ until that server restarts.
  • seen is when the link was last up, as a UTC time, or null; error is why it is down (what ssh said, cornercase not found there, this computer, the same server as another machine, or what a failed update printed last); updating is true while an update runs; problem is what is wrong with the entry in config.json, which then gets no link. A machine that is not shown has state unreachable and "shown": false (written only then, as command is only when set), and no link: retry, update and --machine for it are not-found, saying so (`vps` is hidden here, so it has no link). A server that knows the feature machine-shown takes command and shown; cornercase machines add --command C --hidden and edit --command C check it first.
  • retry_at is when a link that fell tries next, as a UTC time in the form of seen, for a card that counts down like the window’s reconnecting in 4 s. It is one moment per failed try: it stays put until that try fails, and a time that has passed means the try is under way. retry, this computer waking up or changing network, and an edit of a machine that is down try at once and move it to that moment. It is left out while the link is linked or connecting, and while it waits on a person: state says why when it is older, and error when cornercase is not found there, or it is this computer or the same server as another machine. The time is on the clock of the server that answers, as seen is. An older server never sends it: check the machine-retry-at feature before reading a machine with no retry_at as one that waits on a person.
  • set takes the machine’s name and what changes: new_name, icon (the glyph or its name), destination, folder, command (what runs cornercase there for a window opened there; "" clears it) and shown (false keeps it on the list without a link); a new machine needs a destination, and gets ☁ and ~/code unless you give them. create set to true only adds, and a name already listed is a conflict; false only edits, and an unknown name is not-found; null does either. A value the rules refuse is malformed, and a name or destination another machine has is a conflict, with the same texts as the form.
  • remove takes the name; the machine’s server keeps running there. retry takes a name, or null for every machine, and tries those links now. retry and update of a machine whose entry has a problem are not-found, with the problem.
  • hide takes a name, or null for every machine, and turns its shown off: its link ends and its server keeps running there. show turns it on and links it again. A machine already hidden or shown is no error and nothing is written; an unknown name is not-found. A server that knows the feature machine-hide takes them; cornercase machines hide|show NAME|all checks it first.
  • update takes the name of an older machine and answers once cornercase update ended there: the list, or failed with what it printed last. It is a conflict while one runs for that machine, and for a machine that isn’t older.
  • memory is how much memory a computer has, in bytes: total, available (what the system can give a new program, the file cache included) and read_at, when it was read, as a UTC time. here.memory is this computer’s, read as the list is asked for. A machine’s is its last reading, asked only when something needs it: --machine auto, the auto of a dialog’s run on row, and every 30 seconds while Settings › Machines shows or a queue entry waits for room; it is left out until it was read, and for a machine on a cornercase without the feature memory, which never reports it. Check the memory feature before taking a missing memory to mean it is unknown.
  • Unknown names are not-found. cornercase contract lists the operation machines and the feature machines, and the app stream carries the same rows as machines.
Terminal window
cornercase remote --known --json
cornercase remote --remember me@10.0.0.5 --command '~/bin/cornercase'
cornercase remote --forget devbox

remote --known reads your computer’s list, the one the machines command shows when it addresses this computer’s server (with --remote vps it shows vps’s own list instead), and the machine button of a window offers the same machines (cornercase remote): remote --known prints them, {"machines": [{"name": "devbox", "destination": "devbox", "command": null}]} with --json, in the order of the file, each with its --command, and "unreached": true until a window has connected to a machine a program added (left out otherwise). --remember adds a machine, not shown, or replaces its --command (none clears it) and --forget takes it off. They read and write this computer’s list with no server and no ssh, so CORNERCASE_REMOTE changes nothing for them and --remote is refused. A destination that isn’t one word, or starts with -, exits with 2, and forgetting a machine that isn’t listed writes nothing and exits with 1. A window that is open sees the change at its next connection, or when it is opened again; a window that reconnects never writes its command over the list. Pass a machine on as cornercase remote DESTINATION --command COMMAND, or --remote DESTINATION --remote-command COMMAND for a command, leaving out the command flag when command is null.

Terminal window
cornercase status # after what is here, each machine and what it has
cornercase status --json | jq '.machines[] | {name, projects: [.projects[] | {name, repo, paired}]}'
cornercase focus --machine vps --workspace 4 # pick workspace 4 of vps as the one shown
cornercase focus --machine vps --tab 9 --json # pick tab 9 of vps and print what is picked

Your server reads what each linked machine has, so status lists it after the projects of this computer:

machine vps ☁ linked
project 1 web-shop /home/ana/web-shop paired with project 3 (shown)
workspace 2 main /home/ana/web-shop (shown)
tab 5 claude (shown)
  • A machine’s project is paired with a project here when both are clones of the same repository, whatever address each one was cloned with: git@github.com:acme/web-shop.git, https://github.com/acme/web-shop and an ssh alias from that machine’s ~/.ssh/config are all github.com/acme/web-shop, taken from the upstream remote, else origin, else the first one.
  • A machine that is down keeps what it last sent, and says unreachable · seen 2 min ago. Paths are the machine’s, in full. While a machine’s workspace is picked, nothing of this computer is marked (shown).
  • In status --json, each project has remotes (name, url, without passwords or tokens) and repo, that identity, both left out when it has no remotes. machines has one entry per machine that has sent what it has: name, icon, state, seen, retry_at (as in machines, so a failed try sends a line of status --follow), boot (its server’s, not yours) and its projects, as projects gives yours, with machine on each project and workspace, group always null, and paired, the id of the project here it pairs with, or null, and its tunnels, as that machine’s own tunnels lists them (with its own holder numbers, other programs’ and windows’ holds included), left out when it has none; a machine that is down keeps the last ones. Its ids are the machine’s own: use them with focus --machine, never with --pane, --tab or --workspace alone. shown_remote (machine, boot, project, workspace, tab, path) is the machine’s workspace picked with focus --machine or a click on its row, and its stream says how the window’s view of that tab is doing: connecting until the machine sends its first screen, live, or down while the machine or that connection is down. stream is left out while no window is open, since the tab is only streamed for a window. status --follow carries them too, and both are left out when there is nothing to say.
  • focus --machine NAME --workspace ID (or --tab ID) picks that workspace or tab of the machine as the one shown, and with --json prints its shown_remote. The window shows it as a click on its row does, with the machine’s tab in the pane area, and status reports it as shown_remote and (shown). Your server doesn’t pass that tab’s screen on: to draw it in a UI of your own, open it on the machine with cornercase --remote DESTINATION view, surface and input, with the machine’s destination from machines and the ids status gives under machines. It takes no --view, --pane, --project, --worktree or --reveal. A machine not listed, one whose entry has a problem (such as a destination another machine has), or an id it doesn’t have, is not-found; one that has sent nothing yet is unavailable. --boot BOOT (machine_boot over the socket) is the boot of the machine’s entry the ids came from: a machine whose server restarted since is refused with stale-boot (status 4) and nothing is picked; check the machine-boot feature first. Over the socket it is {"command": "focus-machine", "args": {"machine": "vps", "item": {"workspace": 4}}}. Check the machine-workspaces feature first.
  • To open, rename or close a machine’s tab, or split or close one of its panes, as + Tab, a tab’s × and ⋯ and the prefix key’s menu do in the window, ask the machine the same way: cornercase --remote ana@vps.example.com new-tab --workspace 4, rename --tab 9 logs, close --tab 9, split --pane 12 --down, close --pane 12, each with --boot and the machine’s boot. Moving the focus between the panes of a view of your own on the machine is focus --view VIEW --pane ID: it keeps the machine’s window on its own tab, but which pane of a tab is focused is shared, so the window’s focus moves too when it shows that tab. focus --pane ID alone also shows that pane’s tab in the machine’s window.
  • To rename, close or remove a machine’s workspace, as its × and ⋯ do in the window, ask the machine itself with --remote and its own ids: cornercase --remote ana@vps.example.com rename --workspace 4 docs, close --workspace 4, close --workspace 4 --remove-worktree --check to see what removing it would lose, then close --workspace 4 --remove-worktree (with --force or --unlock as Arrange says). Give each one the machine’s boot from status --json with --boot (over the socket, boot in the request), so a machine that restarted refuses (stale-boot, status 4) instead of acting on another workspace that got the same id. The same goes for the panes of a machine’s tab, by the ids its view lines and surface frames give: mark, move-pane, account restart --pane, context, send, input and paste-file take --boot too, so a prompt, a paste or a file never reaches the agent that took the pane’s id after a restart. To fold one of its agents as its ▾ does, send cornercase --remote ana@vps.example.com collapse --pane 9 --boot BOOT (or expand --pane 9), with the pane’s id under the machine’s entry: the fold is kept on the machine, so its own window shows it too.
Terminal window
cornercase start claude --issue '#482' --project 2 --machine vps --focus
cornercase new-workspace notes --project 2 --machine vps --json
cornercase flow run Quick --prompt 'Fix the login form' --project 2 --machine vps

start, new-workspace and flow run take --machine NAME (any case), and your server sends the request to that machine’s server, which does it as if the command ran there, as the window’s run on row does. Over the socket it is the machine field of the same requests, and of start-with (what start sends with --model, --mode or --effort): {"command": "start", "args": {"agent": "claude", "project": 2, "issue": "#482", "machine": "vps"}}.

  • The ids are the machine’s: project and workspace as status --json lists them under machines (paired gives the project here it pairs with), and so are the ids answered. The agent, its modes, the accounts, profiles and trackers, the flows and the prompt template are the machine’s too.
  • The answer is the machine’s, with machine added: {"project": 2, "workspace": 7, "tab": 11, "pane": 12, "machine": "vps"}. focus selects what started in this window once the machine lists it, as a click on its row would: a flow run’s orchestrator, an agent’s tab, a new workspace. Picking anything else before then leaves it alone. With focus, a machine that hasn’t sent what it has yet is unavailable (try again), and --view is malformed: what a machine shows is the window’s.
  • Errors: a machine not listed is not-found, one that isn’t linked unavailable, with why. The machine’s own refusals keep their code, and the request carries the boot of what the machine last sent, so one that restarted in between answers stale-boot and starts nothing. A machine that takes too long gives up with failed and it did not answer in time, after 10 minutes for a start, a flow or a workspace with a worktree and 15 seconds for a plain workspace; what still runs there goes on. A command the machine’s refusal says to run names the machine: --machine vps after the command’s words when it takes one (start, new-workspace, focus, flow run, stats, usage), there after any other, cornercase status as it is; with --remote, --remote comes first.
  • Its boot: --boot BOOT takes the boot of the machine’s entry in status --json, the one you read its ids in (machine_boot over the socket, an optional string in args of start, start-with, new-workspace and flow-run, and of focus-machine). Your server compares it with what the machine last sent before sending anything: a machine that restarted since is refused with stale-boot (status 4) and nothing is sent or started, and one that has sent nothing yet is unavailable. The machine itself refuses if it restarted after that. Send "contract": 1 too to read the code, and check the machine-boot feature first, as the command does. Without machine it is malformed: send boot for this server’s run.
  • No waiting: wait, until and timeout with machine are malformed. placed (--placed) goes to the machine as it is, so a start there answers once its tab is open; the window’s dialogs send it, so they close while the agent there asks whether to trust the folder. Follow the agent on the machine with cornercase --remote DESTINATION wait and its ids, but after placed only once the launch there is over, as Start an agent says: wait and send before then fail or reach the wrong place. status --json here lists that pane under machines, and its status turns working when the agent has taken its prompt.
  • An older server would ignore machine and start the work on this computer, so check the machine-start feature first, as the command does.
  • auto as the machine of start, start-with and flow-run (--machine auto, any case) lets your server pick, as the window’s auto does: this computer, or the linked machine that has the project (found by its repository, as paired is) and the most free memory once what it needs is counted, this computer on a tie. A machine on a cornercase without the feature memory, or whose memory couldn’t be read in the last minute, is left out. The ids are this server’s, since the machine isn’t known yet: the project is project, else workspace’s, else the caller’s, and a machine gets the start in its own clone of it (a workspace given here only stands for its project there, as in the dialogs). A start needs the a start needs of Settings › Machines (default_memory), a flow run its flow’s memory or the same default. The server first asks the machines whose reading is over 30 seconds old, waiting at most 8 seconds. For 5 minutes after a start, what it counted stays taken on the machine it went to, so starts in a row spread out; a start sent to a machine by its name counts nothing. The answer is the one of a start here or there, with machine when it went to one, and auto, what it picked and why ("auto": "auto → torre (11.3 GB free)"), which the command prints on standard error. When no machine has room the request is refused with the code no-room and why (no machine has 6 GB free (best: mac, 4.1 GB)), nothing starts, and the command exits with status 8. machine_boot with auto is malformed. Check the machine-auto feature first, as the command does: an older server would look for a machine named auto. A machine can’t be named auto.
Terminal window
cornercase plugin status
cornercase plugin status --json
cornercase plugin actions
cornercase plugin actions --context pane --json
cornercase plugin run acme.notes note --pane 5
cornercase plugin run acme.notes note --worktree feat/x
cornercase plugin run acme.notes browse
cornercase plugin popup-close
cornercase plugin windows --json
cornercase plugin install acme/notes --preview --json
cornercase plugin install acme/notes --commit "$commit" --yes
cornercase plugin update acme.notes --preview --json

plugin status prints what Settings › Plugins shows, asking the running server. The text gives the revision, then each plugin’s state (on, off or cannot-run), its label and note, and each service (running with its pid, stopped with the seconds until it starts again, or starting). With no plugin it says so. When plugins.json cannot be read it prints why, instead of an empty list. --json prints the plugin-list answer, with hidden characters escaped as in plugin list --json. plugin list still reads the files and works with no server, and has no service states.

plugin actions lists what the plugins you turned on add to the menus, in the order the menus show them (your plugins in the order of plugins.json, then each manifest’s actions), for one kind of row (--context project, workspace, tab or pane), for the plugins’ buttons (--context button) or all of them. The text is a tab-separated table under a header, plugin, action, contexts, title, so cut and awk can read it.

plugin run runs one on what you name (--pane, --tab, --workspace, --worktree or --project) the way its menu entry does: in the workspace’s folder (the project’s for a project), with the ids of what you named in the environment, stopped after 5 minutes, its output in the plugin’s log. It waits for the action, prints how it ended and exits with 1 when it failed. Nothing changes in the window: no toast, no focus. A workspace being removed or closing, and a project closing, are refused, since the action would run in a folder being deleted.

An action offered on its plugin’s button runs without naming anything, as the button does: on what the window shows, in its workspace’s folder, with CORNERCASE_CONTEXT=button. Any other action needs a target. A popup action opens its popup in the window and plugin run waits until it closes, then prints how its program ended; with no window attached it fails (no window is attached), since nobody could see it. While a dialog or another popup is open in the window it fails at once with conflict (a dialog is open in the window, a popup is already open), so it never replaces what you are doing there. plugin popup-close closes the open popup as its × does, and fails with not-found when none is open.

A program that draws cornercase itself adds --view ID (a view of its own):

  • A button action with no target runs on what that view shows, wherever the window is: CORNERCASE_CONTEXT=button, the view’s ids and its workspace’s folder (the project’s with no workspace open, your home folder with no project). --pane, --tab, --workspace, --worktree or --project still say what it runs on, for the actions offered there, and any other action still needs one.
  • A popup action opens as long as that view lives, with no window attached too, so someone who only uses that program can open one. While no window is attached its size comes from the view, and follows view-set; a view without a size opens it at width×height, or 80×24. A window that attaches sizes it as usual, and the view takes over again when the last window leaves. Your program draws it and types into it with surface --popup and input --popup, and it is still one popup for everybody: a window shows it too, and a dialog or another popup makes it fail with conflict.
  • If the view goes away, the popup stays open at the size it has, as it does when the last window leaves, and plugin run goes on waiting. A program that comes back finds it in status --app’s popup, then shows it again or closes it with plugin popup-close, since no other popup opens until then.
  • A view that closed is not-found, a server without plugin-run-view is refused up front, naming the update, and without --view nothing changes.

A program that installs or updates a plugin for the user shows the preview itself and confirms the exact commit: plugin install SOURCE --preview --json fetches the plugin, installs nothing, asks nothing and needs no terminal, and prints one object with id, name, version, description, repo, url, ref and subdir (the same keys plugin list --json has in source, null when absent), the full commit, permissions, download (url and sha256 for this machine, or null), build (the argv of each build step, empty when a download applies), runs (what it runs once on, in the preview’s order: entry is service, window, action with title and contexts, or hook with on, each with its command), replacing (null for a new plugin, else the installed commit and whether it is enabled) and lines, the lines the terminal preview prints. Progress (fetching …) goes to standard error. Once the user approves, plugin install SOURCE --commit COMMIT --yes installs only if the source still gives that commit; otherwise it exits 1 and installs nothing. Unlike SOURCE@COMMIT, which pins the plugin there for good, the plugin keeps following its branch or tag. plugin update ID --preview --json (an ID is required with --json) prints the same object plus "up_to_date": false, or only {"id", "commit", "up_to_date": true} when nothing changed, and plugin update ID --commit COMMIT --yes updates to exactly that commit. A preview exits 0; a refusal (an unknown ref, a plugin linked or installed from another address, a commit that changed) exits 1 with the reason on standard error; a wrong combination of options (--preview with --yes or --commit, --json without --preview) exits 2.

Actions are named by plugin id and action id, and listed with a revision that goes up each time the plugins change (counted from the server’s start, so send boot too). plugin run refuses a revision the plugins moved past, conflict, as a menu opened before the change does nothing, so an action whose command or contexts changed since you listed it never runs by surprise. Left out, --revision is the current one, which plugin actions --json also prints.

The requests behind them are plugin-list, plugin-actions and plugin-run. {"command": "plugin-actions", "args": {"context": "pane"}} answers revision and actions (plugin, name, action, title, contexts, placement, job or popup, and for a popup width and height when the manifest gives them; context may be button). {"command": "plugin-run", "args": {"plugin": "acme.notes", "action": "note", "revision": 3, "item": {"pane": 5}}} takes every field, the item as close and focus do (left out for a button action, to run it on what the window shows, or on what a view shows with "view": 21 beside command, as for the other requests that take one), and answers when the action ends (for a popup, when it closes):

{"plugin": "acme.notes", "action": "note", "context": "pane", "project": 1, "workspace": 2, "tab": 3, "pane": 5,
"ended": "exited", "code": 0, "signal": null, "error": null, "ms": 41, "log": "/…/plugins/state/acme.notes/plugin.log"}

ended is exited (with code), signal (with signal), timeout or error (it could not start), and for a popup closed (its × or plugin popup-close closed it first); a popup’s program ended by a signal has signal null and the signal’s name in error. error is null exactly when it exited with 0, so plugin run exits with 1 for a popup closed by hand. An action that ran and failed is an answer, not a refusal. A group, or an action run on a kind of row it isn’t offered for, is malformed; a plugin that is unknown, off or cannot run, an action it lacks, or an id that names nothing is not-found. A client that leaves before the action ends gets no answer, and the action runs to its end.

plugin status --json prints this answer with those same escapes. plugin-list answers what Settings › Plugins shows: revision, problem (why plugins.json cannot be read, or null) and plugins, one row per plugin with id, enabled, state (on, off or cannot-run), error, Settings’ label and note, source, log, manifest, services and button, there only for a plugin with a button (title, icon and actions, the ids of its button actions in order). A service is running (with its pid), stopped (with restart_in, the seconds until it starts again) or starting. Processes a plugin keeps running in each local window belong to those windows, so the server can’t tell; a program that keeps them running itself reads their state from plugin windows. Turning plugins on and off, installing and updating stay with cornercase plugin, which works on the files; a program shows an install or an update with plugin install SOURCE --preview --json instead (below). Through --remote the same commands, plugin list --json, enable, disable, remove and logs act on that machine’s plugins, so a program can manage another machine’s plugins with no ssh of its own. {"command": "plugin-popup-close", "args": {}} closes the popup as its × does. An older server refuses each of these requests by name, and a plugin-run without item as malformed.

A program that draws cornercase itself runs this for as long as its window is open:

Terminal window
cornercase plugin windows --json

What each plugin that is on declares as [[window]] then runs beside your window, as it does beside cornercase’s own: it starts what is wanted, picks up within a second a plugin turned on or off or a changed manifest, starts again what stops (after 1, 2, 4… up to 60 seconds) and keeps the files plugin remove reads to wait for them. Two programs run two copies, as two windows do, and each process inherits this command’s environment.

It reads the plugins of this machine and sends no request, so it needs no server and works with any server. With no server, with no plugin that has a window process, or with a plugins.json it cannot read, it keeps running and waits. A restart of the server doesn’t touch it, and neither does an update: it stays the old version until you start it again, and what it starts meanwhile gets the new binary as CORNERCASE_BIN.

Each change is one line. With --json it is an object with plugin, id, state (running or stopped), pid and restart_in, the seconds until it starts again, null once it won’t because the plugin was turned off or lost that entry:

{"plugin":"acme.notes","id":"panel","state":"running","pid":4242,"restart_in":null}
{"plugin":"acme.notes","id":"panel","state":"stopped","pid":null,"restart_in":1}
{"plugin":"acme.notes","id":"panel","state":"stopped","pid":null,"restart_in":null}

Without --json it says the same in words, such as acme.notes panel: stopped, restarts in 2s, after a first line that says what it does. plugin logs ID says why one stopped.

It stops them all and exits with status 0 when it gets SIGTERM, SIGINT, SIGHUP or SIGQUIT (on Windows Ctrl+C, taskkill without /f, or its console closing), and when the reader of its standard output leaves, even if it has nothing to print. So give it a pipe: closing the pipe ends it, and so does your program dying. Its output ends once everything has stopped.

SIGKILL can’t be caught, and it is what Rust’s Child::kill sends: on Linux and macOS what the command runs then keeps running, and nothing restarts it, as when a window is killed that way. Close the pipe or send SIGTERM instead. On Windows a process killed that way takes what it runs along, but a reader that left is noticed only at the next line it can’t write, so end the command yourself, or start it in a Job object that kills it with your program.

Window processes run on the machine that shows the window, so --remote is refused with status 2, and so is a line of requests.

--json prints a command’s answer as JSON. These fields are kept stable; new ones may be added.

Command Fields
status version, boot (which start of the server this is, see Contract and compatibility), caller (your pane’s id, or null), shown (the ids of what the window shows), groups (id, name, collapsed, icon, colour), projects (id, name, custom_name, path, group, active, collapsed, workspaces), each workspace (id, name, custom_name, path, branch, worktree, behind, pull_request, run_dir, run (end, reached, and exited, the names of the roles whose agent exited by itself, left out when none), active, collapsed, tabs, post, shared, the files it shares with each other workspace of its project (workspace, count and files, at most 100), there only when there are some, so never while the shared_files setting is off), each tab (id, name, custom_name, status, active, layout, panes), each pane (id, path, program, agent, conversation, status, background_shell, dialog, survey, at_prompt, model, context, active, caller, resumes, resuming, title, parent, subagents, role, held_sends, draft, held_from, held_queued, collapsed, there only while it is true, accounts, the account its shell was given for each agent ({"claude": "work"}), there only when it has one, account_restart, there only while it is "waiting", compacted, there only while it is true: the agent’s conversation was compacted and context comes back with its next reply, pid, the process id of the pane’s shell, there only while it is known, and memory, there only while memory is on, and since, when the agent took its status as the server saw it, an RFC 3339 time in UTC such as 2026-11-28T10:46:03.123Z, there only while the pane has a status: it moves only when the status does, so a client can show “waiting for 12 min” as soon as it connects, and starts again when the server restarts). conversation is the id of the conversation the pane’s agent is in, the one the places of a recap give, or null: until the agent has one, for most agents until its first prompt, and always for opencode, which has none to give. pid is the shell’s, not the program’s in the foreground: an agent or a server runs under it. memory is in bytes, what the shell and every program under it use, the figures the tab’s memory adds up (see Memory). It is off by default, and only measured every 2 s for the tabs on screen: a pane you can’t see gives the last figure it had, or none. status --follow and watch send it with each line but never a line only because it changed, so a line’s figure can be minutes old; ask status --json for the one now. account_restart is "waiting" while it waits for its turn to end to restart on it. held_sends is how many messages send is holding until the person in that pane is done typing, draft is whether that pane has text a person typed and has not sent yet, held_from is the pane that sent the first held message (null for a sender outside a pane, or with nothing held) and held_queued is true once wait turn covers the newest one (see Talk to a pane). subagents is how many subagents the agent started that still run (a number, 0 for shells and agents without a reader); role is the role the pane plays in a flow run (orchestrator, coder…), or null outside one; title is what the program last set as its title (OSC 0 or 2), as a terminal tab shows it, or null; it can change several times a second while an agent works, and status --follow sends it at most every half second. pull_request is null, or the pull request of the workspace’s branch: number, title, url, state (open, draft, merged or closed), checks (failing, pending, passing, or null without checks) and failed, the names of the checks that failed, conflicts (true while GitHub says it has merge conflicts with its base; its pull_request workflows don’t run until they are resolved, so checks covers only what ran), base, the branch it merges into, or null, provider (github or gitlab; a server older than this reports an empty one) and stack, null outside a GitHub stack, else number, base, this pull request’s position (1 is the bottom) and the stack’s size, and layers from the bottom, each with number, title, url, state, checks, conflicts (always false once merged or closed) and review (approved, changes_requested, review_required or null). On GitLab the pull request is the merge request: number is its number in its project (the 486 of !486), checks sums up the jobs of its latest pipeline, and conflicts is GitLab’s has_conflicts. run is there while the workspace runs a flow: end (pull_request or commits, what the flow delivers) and reached (for pull_request, true once the branch has a pull request that is open, a draft or merged, or once the orchestrator marked its own pane for review; for commits, only that mark counts. The mark counts until the worktree moves to another branch). post is there while the workspace has a post in Discord’s forum mode: its url (https://discord.com/channels/<server>/<post>) and archived, true once the workspace’s agents were closed and the post archived (reopening them unarchives it), or once Discord refused to tag a post it archived after a week without messages (the next message unarchives it). Groups, projects, workspaces and tabs come in the order of the sidebar. colour is a group’s palette index (0-255) and icon its symbol; custom_name is the name given in cornercase, or null when the item takes its folder’s, branch’s or program’s; collapsed is whether a project or workspace is folded. layout is how the tab’s panes are split: {"leaf": PANE}, or {"split": {"dir": D, "ratio": R, "first": …, "second": …}}, where dir is right (side by side) or down (one above the other) and ratio is the share of the first side, from 0 to 1. active is whether it is the active one of its parent; status is working, waiting, pending, done, idle or null; background_shell is true while the agent’s turn is over but a shell it started in the background still runs (its status stays working); dialog is true while a Claude Code agent shows a dialog, a panel or its shell mode instead of its input box; survey is true while it shows its feedback survey above its input box; resumes is true when the pane’s agent conversation comes back after a restart; resuming is true while it is coming back, and the pane takes no input; parent is the id of the pane it was started from (by start, new-tab or split run inside that pane, or a flow’s orchestrator), or null when it has none or that pane closed; at_prompt is whether the pane’s shell sits at its prompt, with nothing else running in it, so it is false whenever an agent runs, whatever the agent shows. While keep awake is on, keep_awake has held (whether the computer is being kept awake now), by (the tool holding it) and unavailable (why it can’t be, on this machine); see Keep the computer awake. theme says where the colours of the terminals’ programs come from: from and scheme (see Colours for programs). config is {"revision": N}, which goes up whenever a setting changes. Each project’s remotes and repo, and machines and shown_remote, are in Machines’ workspaces. collapsed_sections lists the sidebar sections that are collapsed (projects, workspaces, agents), there only while one is.
update, update --check outcome (updated, up-to-date, manual, and available with --check), version, from, latest, path, command: see Updates from a program.
status --follow One object per line: what status prints, plus revision.
queue show ID The entry as queue list has it, plus result (at, text, cut, written, agent, branch, pull_request, conversation), messages (null without --conversation), earlier and note: see Queue work for later.
status --app revision (with --follow), version, boot, todos, queue, away, update, keep_awake, tour, popup (while one is open), machines (while you list some) and accounts_revision (once the accounts have changed), see Follow the rest of the app.
config forum-server id and name of the server picked, see Pick the forum’s server.
status --panes panes: one object per pane, with the columns of --panes as keys, in their order: pane, tab, workspace, project, program, agent, status, background_shell, dialog, at_prompt, model, context, caller, shown, active, tab_name, workspace_name, branch, worktree, project_name, path, survey, resuming, parent, subagents, role, held_sends, draft, account_restart, pid, memory, compacted, since. Every object has every key, null where there is no value.
open, new-workspace, new-tab, split, setup, start project, workspace, tab, pane: the ids of what was made (for open, the project’s shown workspace, tab and pane), and projection when --focus --view moved a view. open on a .code-workspace file answers group, name, projects, missing, failed and projection instead, see Import a VS Code workspace.
focus revealed with --reveal; with --view, the project, workspace, tab and pane the view shows now, and its projection; with --machine, the shown_remote of status.
send, wait pane, and, once a wait ended, ended (idle, done, pending, waiting, working, shell, text or quiet) and line for a --text match. start --wait adds ended and line too.
wait --any, wait --all panes: one entry per line of text, each with pane, tab when it was given as a --tab, ended (as above, or closed) and line for a --text match.
flow list flows (each with name, origin, path, description, roles, problems, check, flow, edited and default, in the user’s order, and for a flow of yours changed when it has one), broken, hidden (the deleted built-in flows, like flows) and builtins. See Manage flows.
flow run run (the run’s id), project, workspace, branch, members and run_dir, and projection when --focus --view moved a view.
flow delete, flow hide, flow restore name, origin, deleted, hidden, changed.
flow sync machines: per machine machine, sent, kept, same, failed and error. See Manage flows.
flow default name (the flow, null once cleared) and changed.
flow order names (the flows of the scope in their new order) and changed.
flow runs version, boot, runs (with --follow, each line also has revision), see Follow a flow run.
flow messages One object per line: run, workspace, seq, time, from, to, kind, text, bytes, edge.
flow files workspace, run, dir, files (name, path, bytes, modified) and more.
flow save (the flow-save request) name, origin, path, saved, problems, own_problems, check.
usage agents: agent, title, loading, read_at, age, plan, limited, limits (label, kind, scope, percent, severity, resets_at), extra, notice, error, and identity when known. With --machine, machine or machines (name, state, seen, read_at, error, agents). See Plan usage.
plugin status The plugin-list answer: revision, problem and plugins (id, enabled, state, error, label, note, source, log, manifest, services, button). See Plugins.
plugin-list (a socket request) revision, problem and plugins: id, enabled, state, error, label, note, source, log, manifest, services (id, state, pid, restart_in) and button (title, icon, actions). See Plugins.
plugin install --preview, plugin update ID --preview id, name, version, description, repo, url, ref, subdir, commit, permissions, download, build, runs, replacing, lines (and up_to_date); an up-to-date plugin: id, commit, up_to_date. See Plugins.
plugin actions revision and actions: plugin, name, action, title, contexts, placement, width, height.
plugin windows One object per line and change: plugin, id, state, pid, restart_in. See Window processes beside your own window.
plugin run plugin, action, context, the ids it got (project, workspace, tab, pane), ended, code, signal, error, ms and log.
search matches: pane, tab, workspace, project, place, who, source (prompt, reply or screen), line, text, written; and capped. See Find where something was said.
read pane and text. With --last-message, also agent (claude, codex, gemini or opencode), written (when the agent wrote it, in UTC, such as 2026-10-08T19:56:37.241Z) and turn_over (true once the agent stopped working, as --until turn-over sees it; missing while cornercase doesn’t know yet).
read --last-message with several targets panes: the individual read --last-message answers above, or entries with error and the requested pane or tab id.
read --pending null when nothing is pending, else pane, agent, source (question or permission), tool and command (a permission’s tool and, for a shell, its command; else null), questions (each with header, question, multi_select, free_text and options, each with number from 1, label, description and selected) and open. selected and open are null. With several targets, panes, where nothing pending is {"pane": N, "source": null} and a failure has error.
read --messages pane, agent, conversation (the id status shows for the pane, null when unknown), messages (oldest first, each with id, role (user or assistant), text and written, null when the record has no time) and more_before (true when the conversation has messages before this page). Every key is always there.
events One object per line, see Follow events: time, event, project, workspace, tab, pane, and agent, from, to, program, kind, parent (for an opened pane started from another pane), token, status, place, message, panes, sound, machine, subagent (for notice), kind, message and panes (for message), text (for clipboard) or count (for bell and dropped) depending on the event.
changes One object per line, see Follow a workspace’s changes: boot, stream, revision, scope, mode, state, error and workspaces.
files list boot, stream (null without --follow), revision, workspace and folders: see Browse and read a workspace’s files.
files read boot, stream, revision, workspace, path, file, kind, bytes, modified, language, text and image (format, width, height, data).
files search workspace, query, mode, names (path, indices), files (path, lines), matches and capped.
paste-file pane, path, bytes and paste; with undo, pane, path, removed and why: see Paste a file from another machine.
held pane, held_sends, held_from, held_queued and after_draft: what is held now, and whether --send-now left the Enter to the person: see Talk to a pane.
changes-mode stream, scope, workspace and mode.
changes-file workspace, mode, the file (path, old_path, status, added, removed, fold, viewed, staged, digest), styles and hunks.
changes-gap workspace, path, hunk, styles and lines.
changes-base workspace, base, default and branches.
changes-viewed workspace, path and viewed.
changes-discard workspace, path, old_path and status.
changes-stage workspace, path, old_path, status and staged.
changes-merge-check workspace and checks: with, base, clean, conflicts (path, kind, message), left_out and error.
surface One object per line, see Stream a tab’s terminals: boot, session, surface, revision, tab, cols, rows, layout, dividers, styles, hyperlinks and panes; for --view, also view and projection. With --patches, later lines carry base and only the changed panes.
view One object per line, see A view of your own: what status --follow prints, plus view (id, projection, active, cols, rows, shown, controls, visible, and bot while it shows a bot’s chat) and each tab’s controller.
view-set The view: id, projection, active, cols, rows, shown, controls, visible, claims, and bot while it shows a bot’s chat.
go The ids it went to (project, workspace, tab, pane), and projection with --view.
input pane, bytes (what was written) and skipped: event (its position from 0) and why (mouse, release, or key for a press cornercase has no encoding for) of each event that was not sent. With --follow --json, one such line per request, with events, or pane, error and events for one that wasn’t sent.
scroll pane and scroll: total, offset and rows, as in a frame.
selection pane and text (absent when nothing is selected).
resize surface, tab, cols and rows.
redraw surface and tab.
link pane and link: null when the cell holds no file, else path (canonical), inside (in the pane’s workspace), workspace, relative (inside only), lines (first and last, absent without lines), and row, start and end, the cells the path takes (end excluded).
ratio, move-pane tab and layout, the tab’s split tree as status --json gives it.
group-new group, the new group’s id.
group-style group, icon, colour, and icons and colours, the sets to choose from.
removal-check workspace, path, branch, changed, lock, roles and teardown, as close --check --json prints them.
todo list todos: id, text, done.
todo rm, todo clear-done todos: the items removed, and undo, the number todo restore takes (none when nothing was removed).
todo send pane, as send gives it, todo, the item checked off, and checked (whether the item was checked off) and unconfirmed (true when it was sent but stays pending).
config revision, path, problem, settings, connections, projects, agents and notices: see Settings.
config models agent and models: see An agent’s models.
machines here (icon, version, memory) and machines: name, icon, destination, folder, state, version, server_version, seen, retry_at, error, updating, problem and memory (total, available, read_at). See Machines.
contract version, contract, boot, operations (name, available, and reason when it is not), features and streams (name, version). See Contract and compatibility.
Status Meaning
0 Done.
1 An error or a timeout; the message says which.
2 Wrong usage, such as an unknown option.
3 A partial answer: usage, issue list, files list, worktrees list, worktrees free-builds (--merged when a worktree kept its builds or could not be freed), worktrees remove, and read --last-message and read --pending with several targets printed their whole answer, but an agent, a machine, a tracker, a folder, a worktree or a pane in it failed, clone --file made the clone but couldn’t write a file, input --follow couldn’t send some of its lines, a line of requests --follow failed, or a folder of the .code-workspace file given to open was gone or couldn’t start its shell. Each says why in its error (issue list also names failed trackers on standard error). With --json, the output is a complete answer whenever the status is 0 or 3.
4 A command given --boot named another run of the server (with --machine, of that machine’s server): it restarted since, so its ids may name other items now. Nothing was done or printed; read status again.
5 The cornercase on the machine --remote reached is older than this one, or too old to say its version, so nothing was sent. Update it from here with cornercase --remote DESTINATION update (add --remote-command PATH if you gave one): the message gives the command for an older release, and the update of the JSON line below gives it for both. A --remote-command wrapper that exits with 5 passes it through too. cornercase remote exits with 5 too when the other machine is the older one.
6 update found a newer release that this cornercase can’t install itself (Homebrew installed it, its folder can’t be written, or the platform isn’t one it knows): nothing changed, and it printed the command to run (command with --json). update --check exits with 0 instead. Through --remote, a cornercase there older than 0.13.53 exits with 1 for it.
7 tunnel hold: the server it registered with stopped or restarted. Its last line says which: {"ended": "server-stopped"} or {"ended": "server-restarted"}. The tunnel was not closed or forgotten, so hold it again once the server is back.
8 start or flow run with --machine auto found no machine with the free memory the start needs: nothing was started, and the message says the best one, such as error: no machine has 6 GB free (best: mac, 4.1 GB). Try again later, or name a machine.

With --json, status 5 also prints one line of JSON on standard output, and the message goes to standard error as error: …:

{"error":{"code":"older","message":"`vps` runs cornercase 0.13.19 and this computer 0.13.22. Update it from here with `cornercase --remote vps update`","destination":"vps","there":"0.13.19","here":"0.13.22","update":["cornercase","--remote","vps","update"]}}

destination is what --remote was given, there the other machine’s release (null when its cornercase is too old to say), here yours, and update the command that updates that machine from here, as words to run without a shell (with --remote-command when you gave one; replace cornercase with your own path if you run another). view, surface and requests --follow take no --json and print nothing on standard output; contract --json gives the facts.

A command that follows something until it ends (events, status --follow, status --app --follow, changes list --follow, files list --follow, files read --follow, flow runs --follow, flow messages --follow, surface, view and config pair) also ends with 0, without a message, soon after whatever reads its output is gone: the program it prints into exited or closed its end, or the ssh running it on another machine was killed or lost its connection. A terminal that closes ends it like any program, and one printing into a file or /dev/null runs until it ends by itself.

input --follow and requests --follow end when their standard input ends, once the last line is answered, or when what reads their answers is gone (input --follow with --json); while they wait for the next line they notice neither that nor a stopped server, until that line comes.

Some messages you may meet:

Message Meaning
`<host>` runs cornercase <version> and this computer <version>. Update it from here with … --remote reached an older cornercase (status 5). Run the command it gives.
no cornercase server is running Start cornercase first, or cornercase start-server without a window; the other commands never start one.
this request is for the cornercase server started as … A command given --boot named another run of the server, which restarted since (status 4). Nothing was done; read status again, since its ids may name other items now.
… would ignore --boot and act on whatever has that id now … The server comes from a release without boot, so nothing was done. Restart it so it runs the version you installed; the message says how.
no cornercase server is running on `<host>` --remote reached the machine, but no server runs there; only start-server starts one.
could not reach cornercase on `<host>`: … --remote couldn’t connect, or the connection ended; the end of the line is what ssh said.
the running cornercase server is too old for cornercase … The server comes from a release without these commands, or without this one. Restart it: cornercase kill-server (it closes all its terminals), then cornercase.
the running cornercase server (…) has no … command The command is newer than the server. Restart the server so it runs the version you installed.
this cornercase server has not started its session yet … A server started without a window has no size to give a new terminal, and hasn’t restored your session yet. Run cornercase start-server, or open a window with cornercase.
the agent in pane … is waiting for an answer … send refused to type into an agent’s question or permission prompt.
the agent in pane … shows a dialog, a panel or its shell mode … send refused to type into a Claude Code dialog, panel or shell mode. Read the pane, close it and send again, or pass --force.
the agent in pane … shows Claude Code's feedback survey … send refused to type while Claude Code’s survey would take a digit as its answer. Dismiss it with cornercase keys --pane … 0 and send again, or pass --force.
pane … is … in a flow's run, and its agent exited … send refused to type into the shell of a flow role whose agent exited. cornercase agents reopen --workspace … starts it again; --force does not lift it.
pane … is restarting or resuming its agent … send refused to type while the pane’s agent comes back in its conversation after a restart, or while its conversation moves to another account. Wait until status no longer shows it resuming, or pass --force.
no message is held in pane … held found nothing to act on: the message may just have gone out. Nothing was done.
the person in pane … had a draft in its input when they chose send now … send --enter was held while a person typed, and they chose send now with a draft: your text is in their input after it and goes out with their Enter. Don’t send it again.
not confirmed: the prompt may not have been submitted … send --enter pressed Enter, but the agent recorded no new prompt. Read the pane before sending it again.
the … agent in pane … has not written a message yet read --last-message found the agent’s record, with no message in it.
pane … runs …, and cornercase reads what an agent asks only from Claude Code's records … read --pending on a pane without Claude Code. Read its screen instead.
the program in pane … is not reading its input … Over 16 MiB sent to the pane are still waiting for its program to read them, so send and keys stop adding more.
the program in pane … is not reading its input … so nothing was sent input found over 16 MiB waiting for the program. With a code it is busy.
pane … is … now; read its latest frame and try again and other conflict messages The terminal’s size changed since your frame, a cell is outside it, the pane’s program scrolls itself, or nothing is selected to copy. Nothing was done.
timed out after … The --timeout passed; the rest of the message says what the pane was doing.
the restart was cancelled in the window … Someone pressed cancel on the window’s notice while restart --when-idle waited; the server keeps running.
cornercase hit a bug, see server.log cornercase hit a bug while it handled the command or waited for it. Your shells keep running; see this message in troubleshooting.

The commands and the server don’t have to come from the same release (through --remote the other machine must run this version or a newer one): after cornercase update, a command of the new version talks to the server still running the old one, and the other way round. A program of your own, such as another UI for cornercase, can rely on the same rules, through the commands or straight through the socket.

Terminal window
cornercase contract
cornercase contract --json
cornercase 0.12.137
contract 1
boot 4242-1700000000
commands 78 (78 available)
stream events 1
stream watch 1
stream surface 1
stream view 1
stream app 1
stream changes 1
stream flow-runs 1
stream flow-messages 1
stream files 1
stream config-pair 1
stream tunnel-orders 1
features boot, structured-errors, strict-fields, views, host-events, theme, notices, surface-patches, config, close-unlock, sound, issues, todo-panel, changes, agent-folds, accounts, account-login, account-switch, issue-names, account-restart, tour, close-agent-tabs, queue-undo, focus-reveal, popup-terminal, files, shared-files, build-folders, machines, machine-usage, stats-cached, machine-workspaces, machine-start, queue-routines

--json prints an object with:

  • version: the server’s release.
  • contract: the version of the rules on this page, an integer starting at 1. It goes up only when something that was there changes meaning or shape, never when something is added.
  • boot: which start of the server this is. It changes on every start, cornercase restart included, since ids start again from 1. It is the same value as CORNERCASE_SERVER in the panes and boot in status --json.
  • operations: every request the server takes, by name, with available. A server with start-server among them can be started without a window; one without it needs a window before it opens terminals. One that is not available on this server has available: false and a reason; the others keep working.
  • features: what a request can ask for (below): boot, structured-errors, strict-fields, views (the view field and --view; a client checks it before sending a view to a server), host-events (the host field of events, which an older server would ignore; a client checks it before sending it) theme (the theme request and start-server’s theme; check it before sending colours), notices (a view’s visible, the notices field of events and the go request; check it before sending them), surface-patches (the patches field of surface; an older server ignores it and sends complete lines, so check it before asking) config (the config request and config.revision) close-unlock (the unlock field of close, which an older server ignores and then refuses with the lock’s message; check it before sending it), sound (a notice’s sound field: an older server never sends it), issues (the issue and source fields of start and flow-run, which an older server ignores and then starts the agent without the issue; check it before sending them), todo-panel (the todo request’s edit, undone, move, clear-done and restore; an older server refuses them as malformed, so check it before sending them), changes (the changes requests and the changes count of status), agent-folds (the pane item of collapse and expand; an older server refuses it as malformed, so check it before sending it), accounts (the account-* and profile-* requests and the profile field of start, start-with, new-tab and flow-run, which an older server ignores and then starts the agent with its own login; check it before sending it), account-login (the check field of account-list and each account’s login; an older server ignores check and answers without asking, so check it before sending it), account-switch (the account-rename and account-use requests and the accounts field of start, start-with, new-tab, flow-run and the queue’s add and edit, which an older server ignores and then starts with the default accounts; check it before sending it), accounts-revision (accounts_revision in status --app, which is left out until the accounts change: an older server never sends it, so check it before relying on it to list them again), issue-names (the workspace_name field of start, start-with and flow-run, which an older server ignores and then names the workspace after the issue; check it before sending it), close-agent-tabs (close-agent only closes tabs and never removes a worktree; check it before sending close-agent, since an older server removes an agent’s own worktree), queue-undo (queue remove returns undo data, and the queue accepts clear-started and restore; check it before removing anything, since an older server removes without undo), focus-reveal (the reveal field of focus, which an older server ignores and then only shows the pane; check it before sending it), and popup-terminal (the popup field of surface and input; an older server refuses surface and input with popup alone for their missing tab or pane, but takes input with popup and pane as input to pane pane, so check it before sending popup), files (the files-* requests, the files stream, home in status and ~/ in open, which an older server takes as a folder named ~; check it first), shared-files (shared in each workspace of status and the changes-merge-check request), settings-search (the search action of config), flow-issue-prompt (the prompt field of flow-run together with issue; an older server refuses the two as malformed, so check it before sending both), start-issue-prompt (the prompt field of start and start-with together with issue, added after the issue’s prompt; an older server refuses the two as malformed, or, without issues, ignores issue or answers unknown-field, so check it before sending both), start-folded (the folded field of start, start-with and flow-run, which an older server ignores and then starts the agent expanded; check it before sending it), machines (the machines request and the machines key of status --app), machine-usage (the machine field of stats and usage, which an older server ignores and then answers for itself; check it before sending it), stats-cached (the cached field of stats with a machine, which an older server ignores and then waits for the machine; check it before sending it), machine-workspaces (remotes, repo, machines and shown_remote in status, and the focus-machine request; see Machines’ workspaces), machine-start (the machine field of start, start-with, new-workspace and flow-run, which an older server ignores and then starts the work on this computer; check it before sending it; see Start work on a machine; the placed field of start and start-with came with it, which an older server ignores and then holds its answer until the agent has its prompt; check it before sending that too), queue-routines (the repeat, flow and cleanup fields of queue add and queue edit, and queue pause and queue resume; an older server takes a routine as a one-off entry, so check it before sending them), plugin-run-view (the view of plugin-run; an older server with views refuses it as malformed, so check it before offering a plugin’s buttons in a view), flow-run-view (the view of flow-run; an older server with views refuses it as malformed, so check it before sending a view with a flow run), open-code-workspace (a .code-workspace file as the path of open, which an older server refuses as not a folder, and the into field of open, which an older server ignores and then opens the folder outside the group; check it before sending into; see Import a VS Code workspace), against-base, machine-retry-at (a machine’s retry_at, which an older server never sends; see Machines), machine-hide (the hide and show actions of machines, which an older server cannot read; see Machines), notice-subagent (a notice’s subagent field: an older server never sends it; see Follow events), mode-default (default as the mode of start-with and of queue add and edit, meaning no mode arguments: an older server refuses it in start-with and, in queue, captures the mode chosen in settings instead, so queue add --mode default checks it first; see Start an agent), flow-close-when-merged (the close_when_merged field of flow-run and the flow-close-when-merged operation: an older server drops the field and then starts a run that never closes its agents, so flow run --close-when-merged checks it before sending it), flow-free-builds (the free_builds field of flow-run and flow-close-when-merged: an older server drops it and then never frees, so flow run --free-builds and flow close-when-merged --free-builds check it before sending it), fresh-branches (the fresh field of start, start-with, new-workspace, flow-run and the queue’s add and edit, which an older server drops and then branches from HEAD; --fresh checks it before sending it; --no-fresh checks nothing on this server, and a machine older than this refuses either value as unknown-field), notice-messages (the message events of events --notices, the server’s notices without a token: an older server never sends them; see Follow events), prompt-unsent (unsent and warning in the answers of start and start-with whose agent never took its prompt, unsent on queue entries, and the queue-unsent notice: an older server sends none, so check it before taking a missing unsent to mean that the prompt was taken), surface-wrapped (a pane’s wrapped in surface lines: an older server never sends it, so check it before taking a missing wrapped to mean that no row goes on), account-login-tab (the request of that name, and a view with account-add: an older server refuses the request by name and a view on account-add as malformed, so check it before sending either), config-agents (the agents list of config: an older server leaves it out) tunnels (the requests tunnels, tunnel-open and tunnel-close, and tunnels in status), tunnels-remembered (the state closed, a closed tunnel staying listed, kind and tunnel-forget: check it before reading a close as the port leaving the list), tunnel-hold (the request of that name: an older server refuses it by name), tunnel-orders (the requests tunnel-orders and tunnel-failed, the stream of orders and takers in the tunnel answers: an older server refuses the requests by name; check it before sending either), tunnel-reverse (the direction of tunnel-hold, tunnel-close and tunnel-forget, tunnel hold --reverse and --reverse on close and forget: an older server drops direction and would hold or close a forward tunnel of that port, so check it before sending it), queue-results (the queue-show request, and started and result_at on the queue’s entries: an older server refuses queue-show by name), agent-models (the agent-models request and catalogue in config’s agents: an older server refuses the request by name and leaves catalogue out), flow-not-run (a run’s not_run in flow runs; an older server never sends it, so check it before taking a missing not_run to mean every stage ran since the last change), flow-stopped (a run’s stopped in flow runs; an older server never sends it, so check it before taking a missing stopped to mean the run moves) machine-tunnels (each machine’s tunnels in status, status --follow and view: an older server leaves them out), machine-boot (the machine_boot field of start, start-with, new-workspace, flow-run and focus-machine, which an older server ignores and then starts or shows whatever has that id on the machine now: check it before sending it), flow-exited (exited on a role of flow runs and in a workspace’s run, and agents reopen bringing back a role whose agent exited: an older server leaves the keys out and refuses the reopen), tunnel-hold-ended (the ended line a tunnel-hold stream gets before a close or a forget ends it: an older server sends none), merged-builds (the merged_builds total of worktrees list --json: an older server leaves it out), cli-endpoint (the server serves the command line to a paired phone app at /cli; pair a phone), cli-tls (the phone app’s listener speaks TLS, its code carries the certificate’s fingerprint, app-routes answers fingerprint and config-pair takes new_certificate: an older server would drop that field and show a code with the old certificate, so a client checks it before sending the field, as config pair app --new-certificate does; pair a phone), status-since (a pane’s since in status, watch and view: an older server leaves the key out, so the since column of --panes is then -, or null with --json), paste-then-send (paste in paste-file’s answer and after_paste in send: an older server drops the field and holds the send, so send --after-paste checks it first), paste-undo (undo in paste-file and its answer: an older server refuses it as a paste without a file, or with unknown-field when the request carries contract or boot, so paste-file --undo checks it first), issue-search (query and after in issue-list, and next and search in its sources: an older server drops them and lists the first page unfiltered, or answers unknown-field when the request carries contract or boot, so issue list --query and --after check it first), issue-list-all-projects (all_projects in issue-list, and project in its sources and issues: an older server lists one project’s issues, or answers unknown-field, so issue list --all-projects checks it first), message-flow-exited (the flow-exited message and its run and role), message-failed (failed: true on a flow-merged message whose free of the builds failed: an older server never sends it, so check it before taking a missing failed to mean the builds were freed), held-after-draft (send now and held --send-now paste the message after the person’s draft and leave its Enter to them, and held answers after_draft; an older server sends both as one line, so check it before telling the person their line stays), and bots (the bot request, its events and status --app’s bots; cornercase bot checks it, so an older server is refused by name), bot-about (the about field of bot edit, which an older server refuses as an unknown field; bot edit --about checks it first), shown-bot (shown_bot in status: an older server never sends it, so check it before taking a missing shown_bot to mean the window shows the panes), bot-routines (bot in the queue’s add and edit, which an older server refuses as an unknown field; place.bot and the state answered in queue entries; the routine of a bot’s chat lines; routines and next of the bots; entries and undo in bot remove‘s answer; queue add --bot and queue list --bot check it first), bot-reads (reads in bot agents: an older server leaves it out), bot-setup (bot new with a non-empty about starts the bot’s setup turn and answers state thinking; the notice setting up; the setup action of bot, which cornercase bot setup checks first), bot-about-read (the about action of bot, which an older server refuses as malformed; cornercase bot about checks it first), bot-secrets (the secret-* actions of bot and secrets in the bots’ list, which an older server refuses as malformed or leaves out; cornercase bot secret checks it first), bot-asks (the secret-ask, secret-give and secret-decline actions of bot, asks in the bots’ list and ask on a chat line, which an older server refuses as malformed or leaves out; cornercase bot secret ask, give and decline check it first), bot-chat-apps (chat_apps in bot new and edit, which an older server refuses as an unknown field, and in the bots’ list, which an older server leaves out; --chat-apps checks it first), bot-memory (the memory action of bot, which an older server refuses as malformed, and the memory field of bot edit, which it refuses as unknown-field in a structured request and ignores in a legacy one, so the edit succeeds without writing memory.md; cornercase bot memory and bot edit --memory check it first), focus-bot (the show action of bot, which an older server refuses as malformed; cornercase focus --bot checks it first), memory (here.memory and each machine’s memory in machines, which an older server never sends), machine-auto (auto as the machine of start, start-with and flow-run, their auto answer and the code no-room: an older server looks for a machine named auto and refuses, so --machine auto checks it first), view-bot (the bot field of view and view-set and of a view’s lines, which an older server drops; --bot checks it first), queue-when-free (the when and machine fields of the queue’s add and edit and its first action, wait, machine, first, waiting and there in its entries, and the queue-waiting and queue-pull-request messages: an older server knows none of them, so queue add and queue edit with --when or --machine, and queue first, check it first), section-folds (the section of collapse and expand and collapsed_sections in status: an older server cannot read a fold without an item, so --section checks it first), and pending-question (the request of that name, read --pending: an older server refuses it by name, so read --pending checks it first), view-no-claim (no_claim in view and view-set, claims in a view’s lines: an older server would drop the field and size the tab, so --no-claim checks it first) mark-seen (seen in mark: an older server would drop it and mark the agent as pending review, so --seen checks it first) read-messages (the request of that name, read --messages: an older server refuses it by name, so read --messages checks it first) and flow-account (the request of that name, each role’s account and a run’s account_change in flow runs: an older server refuses the request by name and leaves the keys out, so flow account checks it first).
  • streams: the formats of what the server streams, with their versions: {"name": "events", "version": 1} for events {"name": "watch", "version": 1} for status --follow {"name": "surface", "version": 1} for surface and {"name": "view", "version": 1} for view, whose lines are watch format 1 plus view, and {"name": "app", "version": 1} for status --app, {"name": "changes", "version": 1} for changes, {"name": "flow-runs", "version": 1} and {"name": "flow-messages", "version": 1} for flow runs and flow messages, {"name": "files", "version": 1} for files list --follow and files read --follow, and {"name": "config-pair", "version": 1} for config pair and {"name": "tunnel-orders", "version": 1} for tunnel orders.

A server from before contract says the running cornercase server (…) has no contract command, or that it is too old: it knows none of the rest of this section, so don’t send it ids you kept from before.

  • Fields are only added, never renamed or removed. Read answers leniently: ignore keys you don’t know, and don’t depend on their order (events lines come out with their keys sorted).
  • A new behaviour that must not be ignored gets a new request name, which an older server refuses with has no … command rather than doing something else.
  • contract goes up when something that was there changes. Additions show in operations, features and streams instead.
  • The format of each stream has its own version. Format 1 of events is the one described in Follow events, format 1 of watch the one in Follow the whole state, format 1 of surface the one in Stream a tab’s terminals, format 1 of app the one in Follow the rest of the app, format 1 of changes the one in Follow a workspace’s changes.

A request through the socket is JSON: {"command": "status", "args": {}}, its args named after the command’s options; the repository’s tests/fixtures/control/ holds examples of what goes over the socket. It is answered with {"ok": …} or {"error": "…"}. A request that also carries "contract": 1, or "boot": "…", gets errors with a code instead:

{"error": {"code": "not-found", "message": "there is no pane 9; `cornercase status` lists them"}}
Code Meaning
unsupported The server has no such request, or the request’s contract is newer than the server’s. Nothing was done.
malformed The request is not one: a plugin action run on a group or on a kind of row it isn’t offered for, its arguments don’t have the expected types, a setting’s value is of the wrong type or one the Settings dialog refuses, or it names a view and takes none (`stats` takes no view).
stale-boot The request’s boot is not this server’s, or its machine_boot is not the boot of what that machine last sent: it restarted since, and the ids you hold may name other panes now. Nothing was done.
no-room auto as the machine of start, start-with or flow-run found no computer with the free memory the start needs; the message says the best one, or why each was left out. Nothing was started.
not-found A plugin that isn’t on or an action it doesn’t have, no group, project, workspace, tab, pane, view, surface or changes stream has that id, a file has no change or a hunk no gap, changes-mode names a stream another connection opened, a branch doesn’t exist, no setting or connection has that key, the tab has no divider at that path, or the URL given to clone is not a git repository. A view is gone once the connection that opened it closes.
unknown-field A field this server doesn’t know, named by its path, such as args.bogus. Nothing was done.
unavailable The request is listed in operations with available: false, with the reason as its message. A development build turns off update-check and update-install; a release turns off none.
busy The pane’s program isn’t reading its input: 16 MiB are waiting for it. Only input answers this; send and keys keep answering failed. Nothing was sent. For clone, a clone into that folder, or into one inside or around it, is already running.
conflict The request doesn’t fit the current state: a plugin action listed at another revision of the plugins, the pane’s terminal has another size, a cell is outside it, the program scrolls itself, nothing is selected to copy, nothing is held in the pane given to held, or it is resuming its agent, or, for send and todo send, the pane is a flow’s role whose agent exited, or, for update-install, no release found or a cornercase that can’t replace itself, a workspace for changes or changes-merge-check isn’t in a git repository, a with of changes-merge-check in another project or in the same folder, a connection already follows changes, a file changed since the digest changes-discard or changes-stage was given, or, for config, a token set by an environment variable, a project folder that isn’t a repository or a config.json that cannot be read; or a row moved before one of another workspace or project, a pane moved to another tab, or where its tab has no room; or an issue of a tracker that is not connected, a place to choose for an issue that isn’t tied to a repository, or tracker settings that changed during the lookup; or, for clone, a folder that exists and isn’t empty; or, for run-setup, a workspace that is not a worktree, a project with no setup or a setup already running. Read the latest state and try again. Nothing was done.
failed Anything else.

The message is the text the command would print. Text that is not JSON at all gets the plain form, {"error": "…"}, since the server can’t tell what the request asked for. Without contract or boot, a field the server doesn’t know is ignored, as it always was; with them it is refused, so a newer option never passes for done on an older server. Either one set to null counts as not sent. A contract newer than the server’s is refused with unsupported, so a client written for later rules learns it at once instead of being read under older ones. The cornercase commands themselves send neither, so what they print doesn’t change, except that the commands that take --boot send boot when you give it, and contract with the machine’s machine_boot when you give it with --machine.

With boot set to the value from contract or status, a request kept across a restart is refused before it acts on an id the new server gave to something else.

The socket takes one request at a time per connection: send the next once the previous one is answered (input --follow and requests --follow send through one connection this way). Each message is framed as its length, 4 bytes little-endian, then its postcard encoding: a request is variant 4 followed by the JSON text (its length as a varint, then its UTF-8 bytes), an answer variant 5 in the same form. events sends one answer per event and ends with variant 2, 3 or 4 (its panes closed, the server stopped, or it restarted); watch, the request behind status --follow, answers with the state and then sends it again in the same form after each change, until variant 3 or 4, and app, the request behind status --app --follow, does the same with the rest of the app’s state; surface does the same with a tab’s frame, and ends with variant 2 when the tab closes (or its view does); view sends the state, with the view in it, and holds the view open until the connection closes. A request for a view carries its id as view next to command, once contract lists the feature views. Only your own user can connect. Nothing needs to be sent before the request.

An agent only knows what is in its context, so it doesn’t know about these commands until you tell it. cornercase ships a short set of instructions as an agent skill (a SKILL.md in the repository); install it for Claude Code, Codex and other agents with:

Terminal window
npx skills add usecornercase/cornercase-terminal --skill cornercase -g

Only the skill’s name and description stay in the agent’s context; the rest loads when a task needs it. cornercase skill prints the copy that matches your version; for an agent without skills, put that text in your AGENTS.md or CLAUDE.md. cornercase never installs it by itself, for the same reason it installs no hooks: it doesn’t write into your agents’ setup.

The instructions tell agents to use the commands only when you ask them to open tabs, run something in another pane, or start and coordinate agents; to learn the syntax from cornercase --help; to find panes with status --panes rather than walking the tree; never to steal focus, run kill-server or close what they didn’t open; not to answer another agent’s permission prompt without asking you; to read a pane before sending again after a timeout or a prompt that was not confirmed; to keep their --timeout under their own command timeout; to read several agents’ answers in one read --last-message call; and to restart or update cornercase only when you ask, with --when-idle.

Variable Use
CORNERCASE 1 in every pane. The commands work there; only opening the window inside cornercase is refused.
CORNERCASE_PANE The id of the pane a shell runs in. The commands use it to know where they run.
CORNERCASE_BOT In a bot’s commands only: the bot’s id. The command line refuses what would act on a pane it does not run in, and the panes it starts are tagged with the bot.
CORNERCASE_BOT_RUN In the commands of a bot’s routine run, or of the turn that reports an agent that run started: the run’s queue id.
CORNERCASE_RUN_DIR In the panes of a flow run only: the folder where the team keeps its files.
CORNERCASE_REMOTE Send the commands to the server of this machine, through ssh, as --remote does (the flag wins). Set it for one program, not in a shell’s rc file: panes see it too, though servers never hand it to them.
CORNERCASE_SERVER Which server started the shell, the boot of contract. A server only takes CORNERCASE_PANE as the pane a command runs in when this is its own, since every server numbers its panes from 1.
CORNERCASE_SOCKET Which server to talk to, as for every cornercase command. Panes don’t get it: a shell inherits the server’s environment, so cornercase in a pane finds its own server anyway, and setting it would also move config.json and the session (see Files and environment).

As before, only your own user can reach the server’s socket. But whoever reaches it can type into every shell (except a bot with cornercase access, whose connection the server refuses for a pane that runs no agent), and change your settings and tokens, so a coding agent that can run cornercase can run anything in any pane, and run commands outside its own sandbox through another pane. Keep the socket out of reach of agents you sandbox: run them in a container or under another user without access to it, or don’t give them a shell inside cornercase.

cornercase queue add --at 'in 2h' --agent claude --prompt 'Fix the login form' schedules work and prints its persistent id. Use --issue URL_OR_KEY for an issue, --workspace ID for a tab, or --worktree BRANCH for a worktree. --at 'claude reset' and --at 'codex reset' use the next five-hour plan reset. queue list --json, queue edit ID --at TIME, queue remove ID and queue run ID inspect and manage it. --every 'day 09:00' (or 2h, 'weekday 09:00', 'monday 09:00', at least 30 minutes apart) makes a routine that starts its agent, or a --flow, in a new worktree from the up-to-date default branch each time, --cleanup removes that workspace when it finishes if nothing would be lost, and queue pause ID and queue resume ID stop and restart it. --fresh or --no-fresh on a one-off entry that makes a worktree keeps the choice with the entry (the fresh field, shown by queue list --json); without either, the entry follows fresh_branches when it runs, and a routine is always fresh and refuses --no-fresh. Over the socket, queue add and queue edit take repeat, flow and cleanup, and queue list and status --app give a routine’s repeat, next, paused, flow and cleanup, each run’s routine, and the states removed and kept. See Queue agents for formats and flags. Queued launches accept folder trust prompts automatically.

queue remove ID and queue clear-started print an undo number, or with --json answer {"entries": [...], "undo": 7}. clear-started removes every started entry in one request, and also the runs of a routine that ended (removed, kept, failed or missed), and leaves pending entries, starting runs and the routines themselves alone; an empty clear prints nothing, or {"entries": []}, without consuming history. queue restore 7 puts that removal back with its captured fields, state and ids in their original order. The last 16 nonempty command removals stay available until the server stops, independently of the window’s undo notice. A number works once; an unknown, used or evicted number is not-found.

A bot’s own work is queued with queue add --bot ID (see Routines); queue list --bot ID lists only that bot’s entries.

queue add --when free adds an entry that waits for room instead of a time: it starts, in turn, on this computer or the linked machine with the project and the free memory it needs (its --flow’s memory, else default_memory); --machine NAME waits for that machine only, and auto is the default. queue first ID puts it at the head of the line, and queue run ID starts it now on the computer with the most free memory, without counting what it needs. Over the socket, add and edit take "when": "free" and machine, and the action first takes the entry ({"action": "first", "entry": 9}, answered {"id": 9}). In queue list and status --app, such an entry has wait ("free"), machine ("auto" or a name), first once it was put at the head (a number; the highest goes first), and, while it waits and once the server tried it, waiting: position (its turn, from 1), why (needs 6 GB · best: torre 4.1 GB, or behind queued agent 7), since (UTC seconds) and needs (bytes, left out for one behind the first). Its at is when it was added. Once it started on a machine, there gives the machine and that machine’s workspace and tab ids, as status lists them under it. An entry with a time refuses when, one that waits refuses at and repeat, a bot’s refuses both, and --machine without --when free is wrong usage. Check the queue-when-free feature first, as the commands do.

Over the socket, these use the queue request and the queue-undo feature (the routine actions and fields, pause, resume and add with repeat, need queue-routines), with the following args:

{"action": "remove", "entry": 5}
{"action": "clear-started"}
{"action": "restore", "entry": 7}
{"action": "pause", "entry": 3}
{"action": "resume", "entry": 3}
{"action": "add", "entry": {"repeat": "day 09:00", "flow": "Quick", "cleanup": true, "prompt": "…", "zone": "Europe/Madrid"}}

A routine has repeat (30m, 2h, 3d, day 09:00, weekday 09:00, monday 09:00; the same text --every takes, at least 30 minutes apart), and optionally flow (a flow’s name, with no agent or mode) and cleanup. cleanup is refused for an agent whose reads_status is false in config’s agents: cornercase cannot tell when it finishes. It does not take at, issue, workspace or worktree. The entries of queue list and the queue of status --app give a routine’s repeat, next (its next time, left out while it is paused), paused, flow and cleanup, and each of its runs’ routine (the routine’s id) and the new states {"state": "removed"} and {"state": "kept", "pane": 7, "server": "…", "reason": "2 uncommitted"}; paused, cleanup and the other new fields are left out when empty, so absent means false. pause, resume and run on a routine answer {"id": 3} (run also answers {"id": 3, "run": 8}, the new run’s id). remove on a routine answers it with its runs and one undo. The additive queue-routines feature advertises all of this.

restore answers {"entries": [...]} without a new undo number. The new commands check the feature first so an older server cannot silently remove an entry without undo.

What an entry’s agent did. Each time a queued agent or a routine’s run ends a turn, when its pane closes and right before a routine removes its workspace, cornercase keeps the agent’s last message (at most 4 KiB), the branch and the pull request as they were. queue list and status --app give each entry that started started (UTC seconds) and, once it kept a result, result_at, and never the text. cornercase queue show ID [--json] prints the entry’s state, when it started, the branch, the pull request and the last message, and --conversation adds the whole conversation, oldest first: it exits 3, after printing the rest, when the agent no longer has its record. The queue-show request takes {"id": 7, "conversation": true} and answers every key below, null when there is nothing; an unknown id is not-found. It needs the queue-results feature.

{"command": "queue-show", "args": {"id": 7, "conversation": true}}
{"id": 7, "state": "removed", "started": 1794474060, "result_at": 1794476460, "label": "Review the open pull requests",
"result": {"at": 1794476460, "text": "Reviewed #480 and #482.", "cut": false, "written": "2026-11-12T09:41:00.000Z",
"agent": "claude", "branch": "routine/review-20261112-0900", "conversation": true,
"pull_request": {"number": 482, "title": "Fix the login", "url": "https://github.com/acme/shop/pull/482",
"state": "open", "checks": "passing"}},
"messages": [{"role": "prompt", "text": "…", "written": null, "cut": false},
{"role": "reply", "text": "Reviewed #480 and #482.", "written": "2026-11-12T09:41:00.000Z", "cut": false}],
"earlier": false, "note": null}

The answer also has the entry’s other fields as queue list gives them. result is null when nothing was kept, messages is null without conversation or when the record cannot be read (note says why, and result.conversation is false), and messages holds the newest 1,000 prompts and replies, each cut at 32 KiB (cut), with earlier true when older ones were left out. The conversation is read when asked, so the answer can take a moment; it never carries the agent’s file paths. The remove, clear-started and restore answers carry started and result (with its text) in the entries they return. Every queued prompt is sent with this sentence after it, which is not stored in the entry: “When you finish, end your last message with a short summary of what you did and what is left to do.”