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.
pane=$(cornercase new-tab --name tests -- cargo test)cornercase wait --pane "$pane" --until shell --timeout 900cornercase read --pane "$pane" --lines 40These commands never start a server, except start-server. Without one, they say no cornercase server is running and exit with status 1.
Start without a window
Section titled “Start without a window”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:
cornercase start-serverpane=$(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.
On another machine
Section titled “On another machine”--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:
cornercase --remote devbox status --jsoncornercase --remote devbox events --notices --host --jsonArguments 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.
Ids and where commands act
Section titled “Ids and where commands act”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 worktreegroup 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 asclose,send,readorevents, can say which run of the server the id is from, with--boot, which lists them. - Every pane’s shell has
CORNERCASE_PANEset to its id. Inside a pane, commands act on that pane, its tab, workspace and project unless you name another one;(you)marks it instatus. Run from anywhere else, they act on what the window shows, marked(shown). - A pane opened by
start,new-tab,splitorsetuprun inside another pane remembers that pane as its parent, marked(parent 5)instatus(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)instatussays 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 BRANCHnames 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/loginmade it, socornercase close --worktree fix/login --remove-worktreecan take it down without reading its id fromstatus. 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,readandwaitwork 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,goand the--focusoption. Whoever is looking at the window keeps seeing what they were looking at while a script opens tabs next to them. With--view IDthey 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.
Commands
Section titled “Commands”| 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.
cornercase status # the tree abovecornercase status --json # the same, as JSONcornercase status --panes # one line per pane, for scriptscornercase status --panes --json # the same, as JSONcornercase status --follow # the whole state as JSON, again after each changecornercase status --app # the TODO list, queue, away, update and keep awake as JSONcornercase status --app --follow # the same, again after each changeEach 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.
One line per pane
Section titled “One line per pane”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 since4 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.508Z5 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 --jsongives:trueorfalse, 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 andreadkeeps 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
$7stays the status. --panes --jsonprints{"panes": [...]}, one object per pane with the columns as keys, in the same order, andnullwhere the text shows-.
# the agents that wait for an answercornercase status --panes | awk -F'\t' '$7 == "waiting" { print $1 }'
# each pane with its agent and status, skipping the headercornercase 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/logincornercase status --panes --json | jq '.panes[] | select(.branch == "fix/login" and .agent != null) | .pane'Follow the whole state
Section titled “Follow the whole state”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:
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 --jsonprints, plusrevision, a number that grows with every line, exceptcaller, which is alwaysnull: find your own pane withCORNERCASE_PANEorstatus --jsoninstead. It is always JSON, with--jsonor 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.
revisiononly compares within oneboot, 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,selectionand 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 whatstatus --jsonshows 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.
Follow a workspace’s changes
Section titled “Follow a workspace’s changes”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.
cornercase changes list # the workspace you are in, uncommittedcornercase changes list --every --follow # every project's uncommitted changes, as JSON linescornercase changes list --worktree fix/login --mode commits --jsoncornercase changes file src/main.rs --json # one file's diffcornercase changes gap src/main.rs --hunk 1 # the unchanged lines before its second hunkcornercase changes base origin/main # compare Commits and All with another branchcornercase changes viewed src/main.rs # mark it viewed; --clear clears itcornercase changes stage src/main.rs # put its changes in git's index, as git add doescornercase changes unstage src/main.rs # take them out of the index; the file keeps themcornercase changes discard src/main.rs # put it back as in the last commit; asks first, --yes for scriptscornercase changes discard src/main.rs --digest 550a7a517a389403 --yes # only the version you sawcornercase 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 copycornercase changes merge-check --with 12 --json # only the merge with workspace 12changes(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 higherrevision; 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 withstatus --follow.- A summary has
boot,stream(its number, forchanges-mode),revision,scope(projectorevery),mode(uncommitted,commitsorall),state(loading,readyorfailed, witherror) andworkspaces: each withproject,workspace,base(what Commits and All compare with,nullin Uncommitted),added,removedandfiles. A file haspath,old_path(for a rename),status(modified,added,deleted,renamedoruntracked),added,removed,fold(open,lockfile,binaryorlarge: lockfiles show their lines, binary and large files have none),viewed,staged(no,partlyoryes: how much of the file is in git’s index; only in Uncommitted and Every project, left out in Commits and All) anddigest. Summaries have ids only; the names are instatus. - 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 (seeagainst_basebelow). - The mode belongs to the stream:
changes-modechanges 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 getsnot-found, which is whycornercase changeshas no command for it (start anotherchanges list --mode …instead). A secondchangeson one connection is refused withconflict. 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-fileanswers a file’shunks:old_start,new_start,contextandlines, each withkind(context,removedoradded),oldandnewnumbers (nullwhere 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 astext),emphasis(the words that changed, as[start, end)pairs in characters oftext) andsyntax(runs ofstyleandtext, left out where the line isn’t highlighted).stylesis 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 itsraw, or itstextwhen it has none: a tab ofrawis always four characters oftext, so a selection made intextmaps back toraw.cornercase changes file Makefile --json | jq -r '.hunks[].lines[] | .raw // .text'prints the lines with their tabs.changes-gapanswerslineswith theiroldandnewnumbers,text,rawandsyntax, as inchanges-file, for the lines between hunkhunkand the one before it (hunkis the index inchanges-file’shunks, counted from 0, so hunk 0 has no gap).changes-basewithout arguments listsbranches, thedefaultbranch and the currentbase; withbaseit sets it (the default branch goes back to following the default) and withclearit clears it.changes-viewedsets a mark with the file’sdigest, or clears it withclear: 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-discardtakes the file’spathand the Uncommitteddigestyou 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 withconflictif the file changed since that digest, andnot-foundif the file has no change. It answersworkspace,path,old_pathandstatus. The window shows no message. One sent while another runs in the same repository can fail on git’s index lock.changes-stagetakes the file’spathand the Uncommitteddigestyou saw, and puts its changes in git’s index, asgit adddoes; withstagedset tofalseit takes them out instead (stagedistruewhen left out). The file keeps its changes either way. It is refused withconflictif the file changed since that digest, andnot-foundif the file has no change. It answersworkspace,path,old_path,statusandstaged. The window shows no message. One sent while another git runs in the same repository can fail on git’s index lock.changes-merge-checkmerges a workspace’s work, committed or not, in a scratch copy withgit merge-tree(git 2.38 or later) and answersworkspaceandchecks, one per merge:with(a workspace) orbase(a branch) for what it was merged with,clean,conflicts(path,kindsuch ascontents,modify/deleteoradd/add, and git’smessage),left_out(untracked files over 1 MiB, or past 8 MiB in all, which the check left out) anderror(cleanis 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;withchecks only that workspace of the same project,baseonly that branch, and the two together aremalformed. An unknown branch is that entry’serror, not a refusal; a workspace outside a git repository, awithin another project and awithin the same folder areconflict. No checkout, index, branch or object of the repository changes.cornercase changes merge-checkprintsinto main merges cleanly, orwith workspace 12 feat/dark-mode 1 conflictand a line for each conflicting file, and exits with status 3 when any check has anerror(conflicts are an answer, not a failure);--jsonprints the answer.cornercase changes sharedprints the files the workspace shares with each other workspace, or{"workspace": 11, "shared": [...]}with--json; it readsstatus, where each workspace hasshared(see the table below).cornercase changes viewed,stage,unstageanddiscardread the file’sdigestjust before they act, so they act on the version there at that moment, but only when--digestis absent. A UI that showed a diff passes thedigestit showed with--digest, and the command then reads nothing and sends that one (discardwithout--yesstill reads the file, only to form its confirmation question, and asks first). A file that changed since is left alone:stage,unstageanddiscardfail with theconflictmessage, andviewedsets a mark that only applies to the version seen. Forstage,unstageanddiscardit is the Uncommitteddigest(Every project’s is the same); one from--mode commitsorallis refused as changed.digestis a string of 16 hexadecimal digits that changes whenever the file’s change does.status --jsonalso gives each workspacechanges(files,added,removedandmode), 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.
Browse and read a workspace’s files
Section titled “Browse and read a workspace’s files”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.
cornercase files list --workspace 3 --json # the workspace's root: name, kind, size, modified, hidden, git statuscornercase files list src docs --workspace 3 --json # several folders in one answercornercase files list '~/code' --json # any folder on the server's machinecornercase files list src --workspace 3 --follow # a JSON line again whenever the folders changecornercase files read src/main.rs --workspace 3 --json # text, an image as base64, or what else it iscornercase files read notes.txt # the text, as it iscornercase 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
--workspaceor--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 listanswersworkspaceandfolders, one entry per folder you asked for (the root with none):path,dir,entries,more(truewhen entries were left out: at most 10,000 per folder) anderror(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 hasname,kind(file,folderorother: a device, a pipe, a socket or a link to nothing),link,hidden,bytes(files only),modified(UTC) andstatus(modified,added,deleted,renamed,untrackedornull: what is not committed yet, as the tree marks it; a folder isaddedwhen everything in it is new andmodifiedwhen it holds changes). Entries come in the tree’s order, folders first. What git ignores and.gitare left out, and hidden files are listed: hide them yourself withhidden. The text output is a table with a header line,.for the root and-for nothing.files readanswerspath,file,kind,bytes,modified,language,textandimage.kindistext(the whole file, up to 8 MB, with thelanguagethe viewer highlights it with),image(told by its first bytes, up to 32 MB:imagehasformat,width,heightanddata, the file in base64),binary,too-large(with itsbytes; nothing of it is sent),folderormissing. Only regular files are read, so a link to a device answersbinary. 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 searchanswers the panel’s search, in the workspace only. With--names(the panel’s name mode),names: the best 200 files, ranked, smart-cased, each withpathandindices, the characters of the path that matched. By text (the default),files: each withpathandlines(number,textandranges,[start, end)pairs in characters of the text), at most 1,000 matches in all. Both haveworkspace,query,mode,matchesandcapped. The text output is one path per line for names, andpath:line:textfor text, asgrep -nprints it. It walks the files fresh each time and stops when your command goes away.--followonlistandreadkeeps 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 throughssh. The first line is the answer as it is now, withboot,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) andfiles-search(workspace,query,mode:textornames). Without--follow, one answer. Queries and file contents never reach the server’s log. status --jsongiveshome, the server’s home folder, so a client shows~/…for paths there as the window does.
Follow the rest of the app
Section titled “Follow the rest of the app”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:
cornercase status --appcornercase status --app --follow | jq -c '[.revision, (.todos | length)]'todos: the items astodo list --jsonhas them, in the panel’s order.queue: the entriesqueue list --jsonhas, prompts included, withstartedandresult_atonce an entry started and kept a result, never the result’s text, andunsent: truewhile a started entry’s agent did not take its prompt.away: one row per chat app,telegramthendiscord, each withready(paired, and the bot’s token not refused) andaway. Discord’s row also hasforumonce forum mode is on or a forum is saved:on,ready,guildandchannel(ids, as text) andpending, the setup step still left, ornull. While that step is picking a server, it also hasservers, each withid(as text) andname, whichconfig forum-server IDpicks from.update:release(versionand itsnotes, each with aversionandtext), ornonesaying why there is no release:disabled(a development build),off(check_updatesis off and nothing was checked),unchecked,up-to-dateorfailed. Alsochecking,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) andinstall_error.update-checkandupdate-installdrive it.keep_awake: as instatus --json, ornullwhile the setting is off.versionandbootare the server’s, as instatus.popup: while a plugin’s popup is open,plugin,actionand its size,colsandrows; left out otherwise.plugin popup-closecloses it, andsurface --popupandinput --popupshow it and type into it.machines: the rows ofmachines, there only while you list some. A line comes when a machine’s state changes or a failed try moves itsretry_at, not as itsunreachable · 8 scounts up or that time draws near, sinceseenandretry_atare times.accounts_revision: a number that moves each time the accountsaccount listnames 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 moveconfig.revision, so list again for either. Likerevision, it only compares within oneboot. An older server leaves it out too, so a client that stops asking on its own checks theaccounts-revisionfeature first.tour: the guided tour:active(thetourandstepids on screen, itsindexand whether the window shows itscard, ornull),offered(whether it was shown by itself already), andprogress, one row per tour with the stepsdoneand whether it isfinished. See Draw the tour.- It follows the rules of
status --follow: every line is the whole state and carries arevisionthat grows by one per line,revisiononly compares within oneboot, 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.
Follow a flow run
Section titled “Follow a flow run”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.
cornercase flow runscornercase flow runs --follow | jq -c '[.revision, (.runs | length)]'cornercase flow messages --worktree fix-login --followcornercase flow files --worktree fix-loginflow runsprints 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, addsstopped moving 50 min ago: …, orstopped moving 5 min ago: the orchestrator's agent exitedwhen the orchestrator’s agent is gone;--jsonhasstopped, the UTC time it stopped, left out while the run moves; checkflow-stoppedbefore 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 (closedonce its pane is gone;exitedfor a role whose agent exited by itself while its tab is still open, with a lineexited: coder; `cornercase agents reopen --workspace 7` brings it back, where-is a role not started yet;awaitedisworking, thenfinisheduntil 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, withstate: "closed"and every role’s panenull), 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, orended with stage 3 and 4 not run on the last changeonce the run ended).--followprints the same as one JSON line each time something changes, until the server stops. The request isflow-runs, a stream likestatus --app: every line is the whole state with arevision(seestatus --followfor 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, whichflow runanswers 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 withrole,pane,tab,status,closed,exited(true while the role’s agent has exited by itself and its tab is still open; left out otherwise; checkflow-exitedbefore reading a missing one as false), andworktreeandbranchfor a role with a worktree of its own; a role with no pane, after a restore that could not bring it back, hasnullfor 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; checkflow-not-runbefore reading a missing one as none),ended,messagesand, on a run that closes its agents once its pull request merges (see Start a flow),close_when_merged(left out otherwise) andstopped(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, asflow run --close-when-mergeddoes from the start. The request isflow-close-when-merged(workspace,off, both always written, andfree_builds, left out when false) and the answer hasrun,project,workspace,close_when_merged,free_builds(left out when false) andchanged: it sets the whole choice and never toggles it (without--free-buildsthe builds are kept,--offturns both off, andoffwithfree_buildsismalformed), so saying it twice changes nothing the second time. It refuses withnot-foundfor an unknown workspace andconflictwhen 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 saysthe agents of workspace 7 close once its pull request merges and none of them works,… already close …,… stay open after its pull request mergesor… already stay open …; with--free-buildsthe 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 infresh), 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 inrestarted, and comes back withcornercase agents reopen. Meanwhile the orchestrator is not woken and asendorkeysinto the team’s panes is refused withconflict, 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);keysto 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 isflow-account(runorworkspace, else the caller’s run;accountsas{"claude": "personal"};now, left out when false) and the answer hasrun,project,workspace,accounts,state(waiting,restarted,unchangedorcancelled),changed,restarted(the panes),skipped(eachpaneandwhy),cutandfresh(the roles whose turn was cut and those that started over; while it waits, what a restart would cut now). Withoutnowit answers at once; with it, once the team restarted, or withconflictwhen 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 inskipped. Every agent named is checked before any changes, so a refusal leaves the team as it was. It refuses withnot-foundfor an unknown run or account,malformedfor no account, an agent without accounts or arunoutside theworkspacegiven, andconflictwhen 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. Inflow runs, each role hasaccount, the account it runs on (left out for the agent’s own login and agents without accounts), and the run hasaccount_change(accounts,state,waitingormoving, andsince, UTC) while a change waits; the text addson personalto a role andrestarts on claude: personal once its team is idle. Checkflow-accountfirst; it is kept in memory only.- Stages here count from 0, the index in
flow.stages, unlike a loop’sback.to, which counts from 1 as in the flow’s file.stageis the stage the work is in (nullbefore the orchestrator sends anything),roundshas one number per stage (how many times its loop went back), andholderis the role that last got the work. A step is{"edge": …, "from": …, "to": …, "time": …}, whereedgeis{"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),fromis the role that held the work before (not the sender, which is always the orchestrator) andtimeis UTC.outsideis the last step outside the plan, andendedistrueonce the orchestrator’s pane is marked for review. Only what the orchestrator sends into a role moves the work, as in the diagram. flow messagesprints 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 IDor--worktree BRANCHnames the run (the one in the pane’s own workspace, else the shown one, by default); with no run there it says so.--followgoes on printing until the run ends. With--jsoneach message is one line:run,workspace,seq(counted from 1 for the run),time,from,to,kind(send,keys,readorwait),text(nullwhen there was none),bytes(the real size: a text is kept up to 32 KiB) andedge, the step along the plan it moved the work through (nullwhen 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 isflow-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 secondflow-messageson one connection isconflict.flow fileslists the files of the run’s folder, newest first, at most 200, as a table (name,bytes,modified,path;--jsonprintsworkspace,run,dir,filesandmore). 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 isconflict, and a folder that was deletedfailed. The request isflow-files, one answer. To read a file,cornercase files readwith itspath(see Browse and read a workspace’s files).
Stream a tab’s terminals
Section titled “Stream a tab’s terminals”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:
cornercase surface --tab 3 --cols 120 --rows 40cornercase 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,surfaceandrevision: the server’s start (see Contract and compatibility), therevisionof the lateststatus --followline sent before this one was drawn (0 if none was sent since the server started), this stream’s id (the oneresizetakes) and its own counter, from 1, up by one per line. A line from anotherbootis stale. To get a complete baseline again, run the command again: its first line is always complete.tab,colsandrows: what you asked for.layout: the tab’s whole split tree, as instatus --json, hidden panes included.dividers: each divider with itsdir, itspaththroughlayout(falsefor the first side,truefor the second), the region it divides (area) and its cells (line).panes: the panes the surface shows, each withpane(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,shapeasblock,bar,underlineorblock_hollow, andblinking, ornullwhen hidden or scrolled out of view),modes,scroll,colours,wrappedandlines.modes:mouse(none,press,press_release,button_motionorany_motion),mouse_encoding(default,utf8orsgr),alternate_screen,alternate_scroll,bracketed_paste,application_cursor,focus_eventsandkitty_keyboard(the flag bits). They are what you need to turn keys and the mouse into what the program expects.scroll:totalrows of history plus screen,offsetof the view’s first row, androwsin the view. What is under the view istotal - offset - rows. A pane scrolled up shows its history inlines.hyperlinks: the table the runs’hyperlinknumbers 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,bgandcursoras[r, g, b](OSC 10, 11, 12) andpalette, such as{"1": [255, 0, 0]}(OSC 4). Resolve a colour{"index": n}throughpalettebefore your own palette, and draw default-coloured cells withfgandbgwhen they are there. Your theme is never listed: only what the program set, until it resets it.wrapped: the rows, numbered as inlines, 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 tosize.colswith blanks first (linesleaves 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 featuresurface-wrappednever sendswrapped, 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 (hyperlinkis 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’stylenumbers index, shared by all the panes. Entry 0 is{}, the terminal’s default colours. Others havefgandbg(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 cellsunderline_style(double,curly,dottedordashed; a plain underline has none) andunderline_colour(likefg). A client that knows onlyunderlinedraws every style as a plain one. A selection made in a window shows asinverse.
Patches
Section titled “Patches”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:
cornercase surface --tab 3 --cols 120 --rows 40 --patchesA 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: therevisionit applies to, always the one before it. Apply a patch only whenbaseis therevisionof the last line you applied; otherwise ask for a complete line withcornercase redraw --surface ID, or connect again.stylesandhyperlinks: tables for this patch’s runs only. A run’sstyleandhyperlinkin 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 withpaneandcursor(always:nullis a hidden cursor), and only what changed ofactive,modes,scroll,colours({}once the program resets them),wrapped(the whole list,[]once no row goes on),copyandlines. A pane that is not listed did not change.copy:from,toandcount. Before you applylines, take rowsfromtofrom + count - 1of the pane as you held them and write them atto. 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 aftercopy.
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:
cornercase redraw --surface 4redraw 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×rowsthe 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’ssizecan differ from itsrect:linesandcursorfollowsize. Streaming a--tabdoesn’t resize anything. -
colsis 1 to 1000 androws1 to 500. A connection streams one tab;cornercase resize --surface IDchanges the size of one given with--tabin 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,--colsor--rowsis 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_colourandoverline, 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 inevents --host. -
against_base(featureagainst-base) is what the Changes panel’s All mode counts for a workspace:base(such asorigin/main),files,addedandremoved. 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: 0means counted and clean.cornercase statusprints it as16 files +640 −9 vs origin/main. A view’s lines also carrychanges(Uncommitted) for the workspace that view shows, and a hidden view (view-set --hidden) draws nothing, so it keeps no count running.
A view of your own
Section titled “A view of your own”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.
cornercase view --cols 120 --rows 40 > view.jsonl &id=$(head -n 1 view.jsonl | jq .view.id)cornercase new-tab --view "$id" --focus --name logscornercase surface --view "$id"viewhasid,projection,active,colsandrows(nullwithout a size),shown(theproject,workspace,tabandpaneit shows)controls(whether it sizes its tab’s terminals now) andclaims(falsefor a view opened with--no-claim). It starts on what the window shows, or on--tab,--workspaceor--project; the window doesn’t move. Each tab in the lines hascontroller: the id of the view sizing it, absent when the window does.--view IDworks onstatus,focus,open,clone,new-workspace,new-tab,split,setup,start,flow run,send,keys,held,read,wait,mark,rename,go,surfaceandplugin run,account add --loginandaccount login, also from separate commands. The view’s tab is their default, andfocus,--focusmove the view, not the window or the other views.focus --view --jsonprints the view’s new tab and itsprojection. 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 IDstreams the tab the view shows, at the view’s size, and follows the view to other tabs. It takes no--tab,--colsor--rows, and each frame carriesviewandprojection.view-set --view IDchanges it:--colsand--rows,--activeor--inactive,--hiddenor--visible(see below),--claimto size the tab it shows from now on, and--no-claimto 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 --hiddenandview-set --hiddensay its window is hidden or minimised, so agents there notify again, and--visiblesays 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-claimopens 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 andsurface --viewis 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--activeclaim nothing;view-set --claimmakes it claim like any view, andview-set --no-claimstops again. Its lines say"claims": false, and its text lineno claim.contractlistsview-no-claim, and the command checks it first: an older server would size the tab.view --bot IDandview-set --bot IDsay 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 carrybot.contractlistsview-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.
Drive a tab’s terminals
Section titled “Drive a tab’s terminals”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:
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-1700000000cornercase input --pane 12 --follow --json -cornercase scroll --pane 12 --up 10cornercase selection --pane 12 --from 0,3 --to 79,5 --copycornercase ratio --tab 3 --path second 0.3cornercase resize --surface 4 --cols 100 --rows 30cornercase link --pane 12 --cell 10,3inputtakes one JSON event per argument, sent in order (-reads one per line from standard input):{"key": {"code": "c", "mods": ["ctrl"], "kind": "press"}}(codeas forkeys;modsany ofctrl,alt,shift,super;kindpress,repeatorrelease),{"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": []}}(kinddown,up,drag,moved,scroll-up,scroll-down,scroll-leftorscroll-right;xandyare cells of the pane’s terminal, from 0, as in thelinesof 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
modesof 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: unlikesendandkeys,inputtypes into an agent’s dialogs and answers its permission prompts, because it is a person typing through another UI. Scripts and agents should keep usingsendandkeys, 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). scrollmoves the pane’s view through its history by--upor--downrows, or to--topor--bottom, and answers with itsscrollas 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 withinput;scrollrefuses withconflict.selectionwith--from X,Y --to X,Yselects between two cells of the pane’s view (columns and rows from 0, as inlines;--rectanglefor a block) and prints the text. Without them it prints what is selected,--clearremoves the selection, and--copyalso copies it through the window, as selecting there does, and prints what it copied (the answer’stext), so a program without a window can put it in the clipboard itself. The selection is shared with the window, which shows it asinverse, and with every client; the last one to change it wins.ratio RATIOsets the share of the first side of a tab’s divider, between 0 and 1.--pathnames the divider as thepathof a frame’sdividersdoes (firstorsecondat each level down; without it, the outermost). The terminals follow at once, with the window’s geometry. To open or close splits usesplitandclose.resizelays a runningsurfaceout at another size without starting it again;IDis thesurfaceof its lines. Its next line comes at the new size, with the nextrevision. 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, soresizerefuses it: change the view withview-set.link --cell X,Ysays which file a click on that cell of the pane’s view opens in the window (columns and rows from 0, as inlines), 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 printspath,path:12orpath:12-30, and nothing, with status 0, when the cell holds no file;--jsonalso says whether the file is inside the workspace. It opens nothing, and OSC 8 links are in the frame’shyperlinks, not here. Web addresses aren’t looked up: find them in the frame’s cells, joining the rows itswrappedlists.inputtakes--boot BOOT, also with--popup: a server that restarted since you read the pane’s id types nothing, with status 4 (see Arrange). With--followit 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--remotethrough onesshconnection. 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"}}; withoutpaneit goes to--pane. One process can type into every pane of a view. - Each request is all or nothing on its own. With
--jsonit prints one line per request: the answer withevents(how many of your lines it answers; blank lines are skipped) and eachskippedevent counted from the first line read, orpane,errorandeventswhen 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 --followends 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 eachinputafter the answer to the one before.- Requests on different connections aren’t ordered: send the next
inputafter the answer to the previous one, put several events in one request, or keep oneinput --followrunning. Unlike the other commands, these six log at debug level, since a program sends them as fast as someone types or drags.
Many commands through one process
Section titled “Many commands through one process”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:
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:
argsis the command line aftercornercase, read by the same parser, so every flag works and each command’s--helpstays the contract;stdinis what the command reads from-(text; for bytes use a file argument). Other keys are refused, so a typo never runssend -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 idnew-tabprints),stderr(its warnings) anderror(its message). Onlystatusis always there: emptyjson,text,stderranderrorare left out, and a status 1 or 3 may have noerror(its reason is instderror in itsjson). 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,logsand the plugin commands that work on the files need a process of their own and are refused with status 2, as arestart-server(it needs no connection, andrequestsneeds a running server: run it first),--remoteon a line and the commands that act on this machine (remote,skill,plugin windowsand 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 throughrequests. Lines aren’t ordered with other connections. - It ends when standard input ends, after the last answer (with 5, before the first line, when
--remotereaches 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 atstatus), 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
Section titled “A plugin’s popup”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:
cornercase surface --popupcornercase input --popup --pane 40 '{"key": {"code": "down"}}' '{"key": {"code": "enter"}}'surface --popupstreams 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 (colsandrows, which follow the window’s size, or with no window attached the size of the view it opened for), withpopupnaming it: its id (pane, the same as its pane’s), itspluginand itsaction;tabis 0,layoutnulland nodividers.--patchesworks as for a tab. It takes no--tab,--cols,--rowsor--view, andresizerefuses it. It ends when the popup closes, like a tab’s surface when the tab closes; for the next popup, run it again.input --popuptypes into the popup’s program, with the eventsinputtakes for a pane (mouse cells are the popup terminal’s, as in itslines). The answer’spaneis the popup’s id. Add--pane IDwith thepopup.paneof 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 withnot-found, so keys meant for one popup never reach the next. Without--paneit types into whichever popup is open.- Without a popup open, both fail with
not-found. Watchstatus --app’spopupto 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-terminalfeature doesn’t know--popup: it refusessurfaceandinputwithpopupalone, but typesinput --popup --pane IDinto paneID, if one has that id. Checkcontractbefore sending"popup": true.
Paste a file from another machine
Section titled “Paste a file from another machine”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:
cornercase --remote devbox paste-file --pane 12 ~/Desktop/shot.pngpngpaste - | cornercase --remote devbox paste-file --pane 12wl-paste --type image/png | cornercase --remote devbox paste-file --pane 12 --name error.pngcornercase --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 tosession.json(one folder per paste,0700; the file is0600), 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;--jsonprintspane,path,bytesandpaste, 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.pngbecomesScreenshot-2026-10-27-at-10.03.12-AM.png). A name without an extension gets an image’s own (png,jpg,gif,webp,bmporico), told by the first bytes, sopngpaste -givespasted.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 ofsend’s safeguards apply. -
A program on the socket sends
{"command": "paste-file", "args": {"pane": 12, "name": "shot.png", "data": "<base64>"}}and getspane,path,bytesandpasteonce the file is kept and the path pasted;sendtakes those ids as"after_paste": [7].datais standard base64, padding optional, line breaks ignored. It fails withmalformed(no pane, emptydata, not base64, over 32 MB),not-found(no such pane),busy(the program is not reading its input, or asendis between its paste and its Enter) orfailed(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 getsstale-bootwhen the server restarted. -
The pane then counts as having a draft, so a
sendwaits for it as for a person’s. To send the text that goes with the file, pass itspastetosend --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
sendstill 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
pathit answered topaste-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--jsonit printspane,path,removedandwhyand exits 0 either way;whyisunknown(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, orkeysor asendwrote 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) ornot-shown(the agent’s input does not end with the file, or shows a dialog).paste-fileanswers 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 answernot-shownand leave the file, so wait for the attachment to show and run it again.removed: truemeans 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>"}}(withoutnameordata, elsemalformed); check the featurepaste-undofirst: an older server refuses it as a paste without a file, or withunknown-fieldwhen the request carriescontractorboot. -
A program that types through
input --followshould wait forpaste-file’s answer before sending more, as the two travel on different connections and are not ordered.
Colours for programs
Section titled “Colours for programs”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:
cornercase start-server --theme dark.jsoncornercase theme light.json # the system switched to lightcornercase theme - < dark.json # read from standard inputcornercase theme # client colours, darkcornercase 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].palettemay go up to 256 entries; entries 16 and up are optional (absent ornullkeeps the default cube and greys). A theme that misses a part is refused (malformed, andcornercaseexits 1 before connecting). Over the socket the request is{"command": "theme", "args": {"theme": {…}}},{"args": {"clear": true}}or{"args": {}}to read;start-servertakes the same object asargs.theme. - The answer, and
themeinstatus --json,status --followand thestart-serveranswer, 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 --themeapplies 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.
surfaceframes 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.
Find where something was said
Section titled “Find where something was said”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.
cornercase search 'migration failed'cornercase search --json checkoutpane=$(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 text4 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
--jsoncappedsays 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.
--jsonprints{"matches": [...], "capped": false}, each match withpane,tab,workspace,project(the ids),place,who,source,line(nullwhen there is none),textandwritten(when an agent’s message was written, in UTC, ornull).- The text you search for is never written to
server.log. focus --pane ID --reveal TEXTgoes to the pane, scrolls it to the text and selects it, asEnteron a result in the window does.TEXTis what you searched for.--linetakes ascreenmatch’sline; leave it out for an agent’s message, which takes the newest place the pane shows the text.--jsonprintsrevealed, which isfalsewhen 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 IDthe 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 thefocus-revealfeature first: an older server ignoresrevealand only shows the pane.
Create
Section titled “Create”cornercase open ~/code/orders-api # prints the project's idcornercase open ~/code/orders-api --into 3 # the same, in group 3cornercase new-workspace experiments # a workspace in the project's foldercornercase new-workspace fix/login --worktree # a git worktree on branch fix/logincornercase new-workspace fix/login --worktree --fresh # from the up-to-date default branch, fetched firstcornercase new-tab --name server -- npm run dev # prints the new pane's idcornercase split --down -- tail -f server.log # splits the pane belowcornercase setup --worktree fix/login # runs its setup again, prints the pane's id once it is doneopenfinds a project that is already open instead of opening it twice.--into GROUPputs 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-workspaceadds to the project the command runs in (--project IDfor 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 fromHEADwhen 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 --worktreeandstart --worktreewait for it and answer an error naming the exit status if it fails, or saying so if its tab closes first;status --jsonshows a workspace’ssetupasrunningorfailed.close --remove-worktreeruns the project’s teardown first; if that fails the worktree is still removed and the command printswarning: …on stderr.- A branch that does not exist yet starts from the project’s
HEAD.--fresh("fresh": trueover 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 forHEADwhatever settings → Worktrees → new branches (fresh_branches) says. Both go onnew-workspace --worktree,start --worktreeandstart --issue,flow runandqueue 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.--freshneeds thefresh-branchesfeature, which an older server lacks and would answer by branching fromHEAD, so the command checks it first;--no-freshchecks nothing. new-tabopens the tab in the workspace the command runs in (--workspace IDor--worktree BRANCHfor another one).splitsplits the pane it runs in (--pane IDfor another one), and refuses a pane too small to split.setupruns the project’s setup again in a new tab of the worktree the command runs in (--workspace IDor--worktree BRANCHfor another one), as run setup in the workspace’s menu does: withCORNERCASE_ROOT,CORNERCASE_WORKTREEandCORNERCASE_BRANCHset, the workspace’ssetupreadsrunningand its failed mark is gone, agents started there wait for it, and the tab then becomes a shell. Typing the script into anew-tabdoes none of that. It answers asnew-workspace --worktreedoes, 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 toread, or that its tab closed before it ended. It refuses, with status 1 and the reason (conflicton 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: pressCtrl+Cin 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 readsworktreeandsetupfromstatus --jsonand the project’ssetupfromconfig.- After
--, the words of a command are joined with spaces and typed at the prompt once the shell is ready, assshdoes 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.--jsonprints every id:{"project": 1, "workspace": 2, "tab": 8, "pane": 9}. --focusalso shows what was made.--machine NAMEmakes the workspace on one of your machines instead: see Start work on a machine.
Import a VS Code workspace
Section titled “Import a VS Code workspace”cornercase open ~/code/work.code-workspace # prints the group's idcornercase open ~/code/work.code-workspace --focus # also shows its first projectcornercase open ~/code/work.code-workspace --into 3 # into group 3cornercase --remote devbox open '~/code/work.code-workspace' --jsonopen 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
--remoteit is the other machine’s, given by its absolute path or with~/, quoted so that your shell leaves it alone. --jsonprints{"group": 3, "name": "work", "projects": [4, 5], "missing": 1, "failed": 0}: the group’s id (nullwhen 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.logsays why). A folder on another machine (avscode-remote://address, a network path on Windows) is in neither count, as the picker’s message leaves it out. With--focus --viewit addsprojection.- 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
--jsonsays 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 GROUPimports 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}}, withoutintofor a group of its own. Check theopen-code-workspacefeature before sendinginto, 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.
Clone a repository
Section titled “Clone a repository”cornercase clone git@github.com:acme/orders-api.git ~/code # prints ~/code/orders-api in fullcornercase clone https://github.com/acme/orders-api # into the current foldercornercase --remote devbox clone git@github.com:acme/orders-api.git ~/codeclone 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, codefailed,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.gitfolder 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.
--jsonprints{"path": "/home/ana/code/orders-api", "project": 4, "workspace": 9, "tab": 12, "pane": 13}.--focusalso 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:
cornercase clone --list-ignored --from ~/code/orders-api --jsoncornercase --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.PATHgoes from the root of the repository that--from FOLDERis 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--jsonlists it underunwritten, 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.--jsonprints{"root": "/home/ana/code/orders-api", "files": [{"path": ".env", "size": 42, "mode": 384, "too_big": false}], "left_out": 0}, wheretoo_bigis a file--filerefuses. It reads this machine’s folder, so it needs no server, and--remotechanges nothing for it: the files are here even when the clone goes elsewhere.- On Windows,
--fileand--list-ignoredsay 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.
Start an agent
Section titled “Start an agent”cornercase start claude --worktree fix-login --prompt 'Fix the login form, then commit'cornercase start codex --prompt-file task.md --wait --timeout 1800git diff | cornercase start claude --prompt-file -cornercase start claude --worktree fix-login --placed --jsonstart 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,geminior 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. --namenames the tab,--promptgives the prompt and--prompt-filereads it from a file, or from standard input with-. Without a prompt, the agent just starts.--modelstarts it with that model, through the agent’s own flag (--model opus,--model gpt-5.5), replacing a model set in its arguments.--modepicks another of the agent’s modes, as settings → Agents lists them (--mode plan), instead of the one chosen there;--mode defaultstarts 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,defaultfirst.--effortsets how hard the agent thinks, through its own switch (--effort highfor Claude Code,-c model_reasoning_effort=highfor Codex,--reasoning-effort highfor 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 KEYstarts 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 BRANCHnames 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-48orENG-42, or the issue’s URL;--sourcepicks 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(theworkspace_namefield) says otherwise, and so is a tab unless--namedoes.--workspace-nameneeds a server with theissue-namesfeature, which the command checks first, since an older one would ignore it.--promptor--prompt-filewith--issueadd 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,startandstart-withtakeprompttogether withissue. That needs a server with thestart-issue-promptfeature, which the command checks first, since an older one refuses the two as malformed, or, older still (withoutissues), ignoresissueand starts the agent without it, or answersunknown-fieldto a request withcontractorboot.--waitthen waits likewaitdoes, and prints how it ended on a second line.--untilwith one ofwait’s states (idle,working,waiting,shell,turn-over) waits for that one instead.--placed("placed": trueover 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.waitandsendonly work once that launch is over, and the answer doesn’t mean it is. Until the agent runs,waitanswersruns no agent; until its prompt is typed,waitcan end onidle; andsendgoes to whatever reads the pane then, the shell, or the trust question, which it would answer.statushas no field for the launch, so read the pane there:agentisnulluntil the agent runs and reports, andat_prompttruewhile its shell still waits for it;agentwith the statusidleonly says it runs, since it may still be asking its question and its prompt may not be typed; and the statusworkingsays it took its prompt, so the launch is over. Onceagentis there,wait --until workingwaits for that. Without a prompt, or with an agent that reports no status, only its screen says so (read). Tosendorwaitright afterstart, leave--placedout: its answer then comes when the launch is over. It takes no--wait,--untilor--timeout(over the socket,waitortimeoutwith it ismalformed). An older server would ignore it and hold its answer, so check themachine-startfeature first, as the command does; it came withplaced.--folded("folded": trueover the socket) starts the agent collapsed in the agents section, ascollapse --panewould fold it: the agents it starts stay hidden under its row (▸ +n) until you expand it, andstatussayscollapsedfrom its first answer, even a--placedone. The fold belongs to that agent, as one made withcollapsedoes:expand --pane IDor 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 thestart-foldedfeature first, as the command does. With--machinethat check is of this server’s features: a machine running an older cornercase refuses the field withunknown-fieldonce it has reported its first snapshot, and before that may drop it and start the agent expanded.--machine NAMEstarts the agent on one of your machines instead, with that machine’s ids, agents, accounts and trackers; it takes no--wait,--untilor--timeout.--machine autopicks this computer or the machine with the project and the most free memory, with this computer’s ids. See Start work on a machine.
Accounts and profiles
Section titled “Accounts and profiles”cornercase account add claude work --logincornercase account login claude work --focuscornercase account list --jsoncornercase account use claude workcornercase account rename claude --system Personalcornercase start claude --account claude= --prompt 'fix the tests'cornercase profile new Work claude=work codex=workcornercase profile use Workcornercase 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.
cornercase account restart claude # every open claude on another account, onto the defaultcornercase account restart claude personal --pane 4 --jsoncornercase --remote vps account restart claude work --pane 9 --json --boot 4242-1700000000account 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).
Start a flow
Section titled “Start a flow”cornercase flow listcornercase flow run Quick --prompt 'Fix the login form'cornercase flow run 'Full issue' --prompt-file issue.md --worktree fix-login --jsoncornercase flow run 'Full issue' --issue ENG-42 --project 3cornercase flow run 'Full issue' --issue '#482' --prompt-file task.mdflow 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.
810 orchestrator12 coder14 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.--jsonthen adds, for each such role, itsworktree(the folder) andbranch; 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 (--worktreenames another), its prompt template (--promptor--prompt-filewith--issuereplace it with your own task and keep the issue’s branch and name, behind theflow-issue-promptfeature, which the command checks first), the workspace named after it (--workspace-name NAMEnames it otherwise, behind theissue-namesfeature) and, for an issue that isn’t tied to a repository,--project IDwhen 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
--worktreethat ismain,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,--jsonadds the view’sprojection, and the window and its Flow panel stay as they are (draw your own fromflow runs). A server without theflow-run-viewfeature is refused up front, naming the update. With--machine,--focustakes no--view. --close-when-mergedcloses the team’s agents, asagents closedoes (and tells programs that draw cornercase, as aflow-mergedmessage onevents --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-buildstoo (it needs--close-when-merged, a usage error without it, and a server that knows theflow-free-buildsfeature), the build folders of the run’s worktree and of its roles’ own worktrees are freed once the agents closed, asworktrees free-buildsdoes without--force(a program running there, or a git checkout inside, keeps them); theflow-mergedmessage 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, withfailed: truewhen something could not be freed), and--jsonhasfree_builds: true. A flow that leaves the commits is refused before anything opens, and a server without theflow-close-when-mergedfeature is refused up front, since it would start a run that never closes its agents.--jsonhasclose_when_merged: true, and the text form prints one more line on stderr namingagents reopen --workspace ID. With--machinethe 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 lackingclose_when_merged: true(orfree_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 thestart-foldedfeature, asstart --foldeddoes, and with--machinea machine running an older cornercase may likewise drop it and start the orchestrator expanded.--machine NAMEruns the flow on one of your machines instead: that machine’s flow of that name, with its agents and accounts.--machine autopicks this computer or the machine with the project and the most free memory, counting the flow’smemory. See Start work on a machine.--boot BOOT(also onflow list,export,import,save,delete,default,order,close-when-merged,messagesandfiles) says which run of the server the--project,--workspaceor--viewid is from, as Arrange says: one that restarted since refuses with status 4 and nothing runs, is saved or is listed. With--machineit is thebootof 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.
Manage flows
Section titled “Manage flows”cornercase flow list --jsoncornercase flow save draft.json --checkcornercase flow delete 'Quick mine'cornercase flow hide Quickcornercase flow restore Quickcornercase flow default Quickcornercase flow order Quick 'Full issue'cornercase flow sync Review --machine vps --jsonEach 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.
Issues
Section titled “Issues”cornercase issue sourcescornercase issue list --source github --assignee mecornercase issue list --closed --jsoncornercase issue list --query login --jsoncornercase issue list --source github --after 100 --jsoncornercase issue list --all-projects --jsoncornercase issue read '#482'cornercase issue people jiracornercase 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, orfrom LINEAR_API_KEY, followed byover the saved onewhen a saved token is there too but unused). In--json,fromisgh,savedorenv,envnames the variable, andshadowedistruewhen the variable hides a saved token.missing, with what is missing:token(connect it withcornercase config secret SOURCE, the token on standard input),siteandemailfor Jira (cornercase config set jira_site …),workspacefor Plane (plane_workspace), orrepository(the project isn’t a git repository, or for GitLab none of its remotes is ongitlab_url). An Asana token with several workspaces shows asfailinguntilasana_workspaceis 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.
Talk to a pane
Section titled “Talk to a pane”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.
cornercase send --pane 12 --enter 'Now add tests for it'cornercase send --pane 12 --enter --wait --timeout 900 - < next-step.mdcornercase 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+ccornercase keys --pane 12 ctrl+c --boot 4242-1700000000cornercase keys --pane 12 down entercornercase held --pane 12 --send-nowcornercase held --pane 12 --wait-turn --jsoncornercase read --pane 12cornercase read --pane 7 --lines 200cornercase read --pane 12 --last-messagecornercase read --last-message --pane 12 --pane 15cornercase read --last-message --pane 12 --pane 15 --jsoncornercase read --pane 12 --pending --jsoncornercase read --pending --pane 12 --pane 15cornercase read --messages --pane 12 --last 5 --jsoncornercase read --messages --pane 12 --before 41cornercase read --messages --pane 12 --after 42 --jsonsendpastes 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.--enterthen presses Enter once the screen settles.- With
--enter,sendto 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 withnot 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, sosendreturns then;--timeoutgives up earlier, with status 1. Grok Build queues that one Enter. Pressing Enter again sends the queued prompt now and cancels the turn, whichsenddoes not do. A compact command (/compactfor 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);--timeoutbounds it. In any other program,send --enterreturns once Enter is pressed. - From a flow’s orchestrator, a
sendthat 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 noton stderr, so stdout stays what a script parses, and in the answer’swarningwith--json. The same line, for every stage still owed, comes frommarkon the orchestrator’s own pane. - GitHub Copilot CLI’s
/and!lines and a lone?write no prompt record, sosend --enterreturns after Enter for them;? textis 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 withnot 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 withnot confirmed; usereadto inspect their result. Gemini has no calibrated input-box check, so read its screen before sending into a picker or dialog. --waitthen 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.--untilwaits for another ofwait’s states, asstartdoes.sendrefuses a pane whose agent iswaitingfor an answer to a question or a permission prompt: whatever it typed would answer it. Answer such a prompt withkeys, after deciding what the answer should be.sendalso 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 anxstops 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;--forcesends anyway.sendalso refuses a Claude Code agent that shows its feedback survey above its input box (How is Claude doing this session? (optional), then1: Bad 2: Fine 3: Good 0: Dismiss): one digit sent alone answers the survey instead of reaching the agent, sosend --enter 2, the answer to a numbered question, would be lost.cornercase keys --pane 12 0dismisses the survey without answering it; then send again.--forcesends anyway: a longer text hides the survey and goes to the input box, as when you type over it.sendalso refuses a pane whose agent is resuming its conversation after a restart (resuminginstatus): before the agent is back, text would land in front of the resume command or in the agent’s start-up. Wait untilstatusno longer shows it, or pass--force.keysis not refused.sendalso refuses a pane that is a flow role whose agent exited (exitedinflow runs), where the text would be typed into its shell, even with--force:cornercase agents reopen --workspace IDstarts it again in that pane. The refusal has the codeconflict, andtodo sendand the orchestrator’s own sends are refused the same way.held --send-nowand the window’s send now do not return the conflict: the refusal goes to the sender of the held message, andheld --send-nowreturns only what remains held. A pane outside a flow whose agent was quit takessendas any shell does;keysandinputare not refused.send,keysandheldtake--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) andtodo sendwait 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 orcornercase inputand not yet sent with Enter or dropped withEsc,Ctrl+CorCtrl+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 says1 message waiting from pane 40 · goes after yours, withsend 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--enterthen gets an error saying the message is in their input) andwait turn, which only says the person saw it: the bar stays, with the working icon andqueued: goes right after yours, and a new held message showswait turnagain. Either way the message goes out right after the person’s prompt.statusshowsheld_sends,held_from,held_queuedanddraftfor each pane.--timeoutbounds the wait and its error says whether the pane had a draft or recent typing;--forcesends at once. A file you pasted yourself withpaste-fileis such a draft, andsend --after-pastepasses 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.keysnever waits.heldis those two buttons, for a program that draws cornercase and its own bar. Give one of them.--send-nowsends the first held message at once, as--forcedoes, still after the Enter of a message sent just before it, soheld_sendsmay 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-turnonly 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-nowalso while the pane is resuming, when the window has no bar. It prints what is held now, and--jsonprintspane,held_sends,held_from,held_queuedandafter_draft,truewhen--send-nowleft the Enter to the person (check theheld-after-draftfeature: an older server sends both as one line).--pane,--taband--viewwork as forsend. 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 --followorview, which send a line when any of these change. Whileheld_sendsis above 0,held_fromis the pane that sent the first held message (nullfor a sender outside a pane; a pane since closed keeps its id, and ids last one run of the server), andheld_queuedistrueonce wait turn covers the newest one. The window then reads1 message waiting from pane 40 · goes after yours,3 messages waiting, the first from pane 40 · goes after yours, or without a sender2 messages waiting · goes after yours; and once queuedqueued: goes right after yoursor2 queued: the first goes right after yours, with no wait turn button. Whiledraftistrue, send now puts the message after the person’s line instead of sending both, so with theheld-after-draftfeature a client can say so before the click. keyspresses 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,f1tof12, or one character, each after any ofctrl+,alt+andshift+(shift+tab,ctrl+c,alt+x).- A program that draws the terminals itself should type with
inputinstead: 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 keepsendandkeys. readprints the screen as text.--lines Nprints the lastNlines 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)and1: Bad 2: Fine 3: Good 0: Dismiss: that is Claude Code asking you, not something the agent wrote.statusmarks it(survey open), andkeys --pane 12 0dismisses it. read --last-messageprints 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.--jsonaddswritten, when the agent wrote it, andturn_over. A program that shows it can followeventsfor the pane’slast message changedline and read it then, instead of reading it again and again.- With
--last-message, repeat--paneor--tabto read several agents in one call, using the ids fromstatus --panes. Each message appears under a header with its pane id, agent,turn_overandwritten; unknown metadata isunknown.--jsongives{"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 witherrorand the requestedpane(ortab, 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-messagefails, 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 --pendingreads it.read --pendingprints 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--jsonit is text (Database: Which database should the service use?, then1. Postgres - What the other services useand so on;permission: Bashand the command;nothing pending). With--jsonit 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 noquestions;nullwhen nothing is pending. Every key is always there.numberstarts at 1, in the order the agent shows the options, socornercase keys --pane 7 1 enteranswers with the first one.selectedandopenarenull: 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_textistrue: Claude Code always lets you type an answer instead.read --pendingreads only Claude Code’s records, and only whilestatussays the agent iswaiting: a tool that runs and one that waits for your permission look the same in the record. So it isnullwhile 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--paneor--tabas 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 thepending-questionfeature, and refuses an older server before asking.read --messagesprints 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 withsendare bothusermessages. Each message comes under a header with its id, its role (userorassistant) 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 Ngives the newestN(20 by default),--before IDtheNjust before that id, to page back, and--after IDevery message after it, or the newestNof them with--last. Without--json, a line on standard error names the--beforethat 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. Whenconversationin--jsonchanges (after a/clear, say) the ids start again. The text of each message comes whole. It takes one--paneor--tab, and fails as--last-messagedoes.
cornercase wait --pane 12 --timeout 600 # until the agent stops workingcornercase wait --pane 12 --until waiting # until it needs an answercornercase wait --pane 12 --until turn-over # until its turn is over, background shells or notcornercase wait --pane 7 --until shell # until the program endscornercase wait --pane 7 --text 'test result: (ok|FAILED)' # until a line matchescornercase wait --pane 7 --quiet 5 # until it writes nothing for 5 swait 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
waitkeeps waiting, and its timeout says that only a background shell is left.--until turn-overends there and printsshell; 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 idleand--until turn-overwaits 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 themturn-overends as the plainwaitdoes. - After a prompt reached the agent (through
start,send --enterorkeys … 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, andreadtells 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.
Several panes at once
Section titled “Several panes at once”cornercase wait --any --pane 12 --pane 15 --tab 9 --timeout 1800 # until the first of them stopscornercase wait --all --pane 7 --pane 8 --until shell # until both programs endRepeat --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.
--anyreturns as soon as one of them meets the condition and prints one line: the id you gave and how it ended, such as15 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.--allreturns once every one of them has met the condition, and prints one such line each, in the order you gave them (--paneones first, then--tabones). 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
--tabline 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--allgoes on with the others and--anyreturns 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.
--jsonprints{"panes": [...]}, one entry per line of text.
Follow events
Section titled “Follow events”cornercase events # everything, until the server stopscornercase events --pane 12 --pane 14 # only these panes, until they all closedcornercase events --host --json # also clipboard writes and bells of programscornercase events --notices --json # also the notices about agents, with their tokens, and the server's other noticescornercase events --json | while read -r event; do …; doneevents 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 2pane 14 opened in tab 15 from pane 12pane 14 claude none → idlepane 14 claude idle → workingpane 12 claude working → waitingpane 14 claude last message changedpane 14 claude working → shellpane 7 cargo exitedpane 7 clipboard 11 bytespane 7 bell 3 timespane 14 closedtab 15 closedworkspace 2 notice claude needs you in web-shop › main cc-3f2a9c-4machine vps notice claude on vps needs you in web-shop › main cc-3f2a9c-5notify the release build is readyworkspace 2 flow-merged pull request merged in fix-login: 3 agents closedworkspace 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,eventsends 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 ansshrunning it on another machine (see Exit status).--jsonprints one JSON object per line instead:event(status,last-message,exited,opened,closed),time(UTC, as in the server’s log), theproject,workspace,tabandpaneids it concerns, andagent,fromandtofor astatus(nullfor no agent),agentforlast-message,programforexited,kindforopenedandclosed, andparentfor anopenedpane started from another pane (left out when it has none).--hostis 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 putstextin the clipboard itself. Readers without--hostget none of it. Bells come at most one line a second per pane, with how many rang (count). A server without thehost-eventsfeature refuses--host; checkcontractbefore 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 statusonce 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 shellis exact. - A reader that falls far behind (over a thousand events waiting for it) loses events, and gets a line such as
12 events droppedwhen it catches up, so it knows to readstatusagain. 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.
Arrange
Section titled “Arrange”cornercase close --tab 9cornercase close --worktree fix/login --remove-worktreecornercase close --worktree fix/login --remove-worktree --checkcornercase close --worktree fix/login --remove-worktree --unlockcornercase close --agent --pane 12 --checkcornercase close --agent --pane 12cornercase close --agent --pane 12 --keepcornercase close --agent --pane 12 --keep --tabs 9,11 --stops 12,14cornercase close --workspace 5 --boot 4242-1700000000cornercase group new workcornercase group style 12 --icon '★' --colour 99cornercase group delete 12 --close-projectscornercase move --project 5 --into 12cornercase move --tab 9 --before 7cornercase move --worktree fix/login --lastcornercase collapse --group 12cornercase collapse --pane 12cornercase collapse --section agentscornercase expand --worktree fix/logincornercase collapse --pane 12 --boot 4242-1700000000cornercase move-pane --pane 4 --target 7 --place belowcornercase move-pane --pane 4 --target 7 --place below --boot 4242-1700000000cornercase rename 'review #42'cornercase rename --workspace 5 ''cornercase rename --workspace 5 docs --boot 4242-1700000000cornercase focus --pane 12cornercase mark --pane 12cornercase mark --pane 12 --reviewedcornercase mark --pane 12 --seencornercase mark --pane 12 --boot 4242-1700000000closetakes exactly one of--pane,--tab,--workspace,--worktreeor--projectand 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-worktreeremoves the worktree too and answers once it is gone. Without--force, a worktree with uncommitted or untracked changes is refused before anything stops;--forcethrows those changes away. A locked worktree (git worktree lock) is refused before anything stops, even with--force; the error gives the reason and thegit worktree unlockcommand to run, and--unlockdoes 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, useworktrees remove.close --remove-worktree --checkonly 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.--jsonprintsworkspace,path,branch,changed,lock(reason,path,role,pid,running, ornull),roles(role,path,branch) andteardown. Run it before removing a worktree you did not just make.close --agent --pane IDcloses 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-worktreeremoves a worktree), and--forceand--unlockare refused with--agent. It takes only--pane(a pane that runs no agent cornercase reads is refused withconflict).close --agent --checkonly says what closing would do, and stops nothing:--jsonprintspane,agent,project,workspace,removes(alwaysnull) andbranches(always empty), both kept for older servers,tabs,stopsandkeeps(panes withagent,project,workspaceandtab;keepsare the agents that keep running),run(the flow run that ends when its team closes),closed,warningandclosed_agents(the closed agents the workspace keeps). Without--check,--jsonprints the same once it is done, withclosedtrue. Run the check first when you did not start the agent yourself.close --agent --keepkeeps what it closes with the workspace’s closed agents, asagents closedoes, soagents reopen --workspace IDor the workspace’s▶brings the agent back in its conversation (a flow’s team with its run), andagents forgetdrops it; it prints the line to bring it back. Without--keepthe agent is closed for good, as with its×. A tab of the plan with no agent left in it closes without being kept.closed_agentsin the--jsonanswer is how many closed agents the workspace keeps now (featureclose-agent-keep).close --agent --tabs IDS --stops IDScloses only what a check confirmed. Give back the check’stabs(jq -r '.tabs|join(",")') to refuse the close when the agent has since started a tab that it would now close. Give back itsstops(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--tabsalone 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(featureclose-agent-bound).group new NAMEcreates a group with the next icon and colour, as new group does, and prints its id.group style IDsets--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--jsonalso lists both sets.group delete IDkeeps the group’s projects, outside any group; with--close-projectsit closes them and deletes the group once their shells have stopped.moveputs a group, project, workspace or tab (--group,--project,--workspace,--worktree,--tab)--beforeanother of the same kind, or--lastat the end of its list. A project moved before another joins that project’s group;--into GROUPputs it after the projects of that group and--ungroupafter 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.collapseandexpandfold or unfold a group, project or workspace (--group,--project,--workspace,--worktree), or an agent’s pane (--pane, refused withconflictfor 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 --foldedandflow run --foldedbegin with that fold already set.--section projects|workspaces|agentsinstead 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 (featuresection-folds).statuslists the collapsed ones incollapsed_sections.move-pane --pane ID --target ID --place swap|left|right|above|belowswaps 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.--jsonprints the tab’s newlayout. Over the socket the requests aregroup-new,group-style,group-delete,move,collapse,expand,move-paneandremoval-check, andclosetakesunlock; each change shows in the nextstatus --followsnapshot.renamerenames the tab it runs in, or the--tab,--workspace,--worktree,--projector--groupyou 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 listandworktrees sizetake--boot BOOT, thebootof thestatus --jsonyou read the id in, or of a machine’s entry there. Ids last one run of the server, so one that restarted since refuses, withstale-boot’s message and status 4, and nothing is done or printed (nothing closes, changes, folds, moves, starts, is sent, typed, pressed or pasted,contextstarts no secondclaude, 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 thebootyourself 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,--checkand--agent, every form ofcollapseandexpand(--group,--project,--workspace,--worktree,--pane,--section), and--tabofmark,contextandsend, and--popupofinput, included, and on a line ofrequests --follow, for that line only. Any other refusal says what it says without the flag, with status 1. A server from beforeboot(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 knowsboot. 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 listwithout--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 asunknown-field, where it would otherwise ignore it: restart it so it runs the version you installed.plugin runsends it with its revision lookup too, so a stale boot fails before anything runs.queue edittakes it asqueue adddoes.input --followends with status 4 on the first line a server refuses for it, and sends nothing after it. With--machine,start,new-workspace,flow runandfocustake thebootof that machine’s entry, whose ids they name (see Start work on a machine). A stream (events,surface,view,changes list,files listorfiles readandflow messageswith--follow, and a longwait) 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-ignoredrefuses it, since it needs no server.status, where the boot is read,flow runs,flow hideandflow restore,processes stopandports stop(a pid and a port are the system’s), and the ids that survive a restart, such astodo doneandqueue remove, take none.focusshows a pane, tab, workspace or project, as picking it in the search does.--revealalso scrolls a pane to a text and selects it (see Find where something was said).--machine NAMEpicks a workspace or tab of a machine as the one shown instead, whose tab the window shows from the machine (see Machines’ workspaces).--bot BOTshows that bot’s chat on the Bots page, as a click on its row does (featurefocus-bot).markmarks the agent in the pane it runs in, or in the--paneor--tabyou name, as pending review: its tab shows a blue●until it is marked--reviewedor the agent starts working again on a new prompt or an answer, andstatusandeventsgive it aspending. 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.--seenonly 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 (featuremark-seen, checked first, since an older server would mark the agent as pending review).
Close and reopen a workspace’s agents
Section titled “Close and reopen a workspace’s agents”cornercase agents closecornercase agents close --worktree fix/login --checkcornercase agents close --workspace 7 --force --jsoncornercase agents reopen --workspace 7cornercase agents forget --workspace 7 --yesagents closecloses the tabs of a workspace (the one you are in, or--workspaceor--worktree) that run an agent, whole, and keeps what each needs to start again, as the window’s close agents does. It refuses, withconflict, 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;--forcecloses anyway, and--checksays what would close and closes nothing. It printsclosed 4 agents in workspace 7; `cornercase agents reopen --workspace 7` reopens them.agents reopenbrings them back after the other tabs, a line per pane (pane 31 claude coder resumes, orstarts 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 (exitedinflow 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 (tabsis empty). Every agent’s command must be on the server’sPATH, or nothing opens (failed).agents forgetdrops them for good and ends a kept flow run, asking first on a terminal and needing--yesin a script.--jsonprints the answers:agents-closegivesproject,workspace,tabs,agents(pane,tab,agent,role,status,resumes),stops(the other panes that go with them),run,closed(false for a check) andclosed_agents;agents-reopengives the newtabs,panesandrun;agents-forgetgivesforgotandrun. The requests areagents-close(workspace,check,force),agents-reopenandagents-forget(workspace); an older server refuses them by name.status --json,watchandviewcarryclosed_agentson a workspace that holds some, andflow runslists a run whose agents are closed withstate: "closed"and every role’spanenull; a flow run can also close them by itself once its pull request merges. See Close agents and reopen them later.
Leave notes
Section titled “Leave notes”cornercase notify 'the release build is ready'cornercase todo add review the login fix # prints the item's idcornercase todo listcornercase todo done 3 # checks it off, or back oncornercase todo undone 3 # puts a done item back among the ones to docornercase todo edit 3 review the login fix againcornercase todo move 3 --before 5 # or --lastcornercase todo send 3 --pane 5 # types it into the agent and checks it offcornercase todo rm 3 # prints a number that restore takescornercase todo clear-done # the same, for every done itemcornercase todo restore 7todo 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.
Away on Telegram or Discord
Section titled “Away on Telegram or Discord”cornercase away # agents message you on Telegram or Discordcornercase away --off # they stopaway 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.
Updates from a program
Section titled “Updates from a program”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"}versionis the cornercase on disk when the command ends, on the machine it ran on, so aftermanualit is still the old one.from(the version before) is there only forupdated,pathonly forupdated(the binary it replaced) andavailable(the one it would replace),latest(the release that is out) only formanualandavailable, andcommand(what to run by hand) only formanual. Keys that don’t apply are left out. New keys may be added.updatedandup-to-dateexit with 0, andmanual, 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
--yesand--when-idle(status 2). Restart afterwards withcornercase restart --yesor--when-idle(below). update --check --jsoninstalls nothing: it printsup-to-date,manual, oravailable(withversion,latestandpath, where it would install), and exits with 0 whatever it finds.- With
--remotethe 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--jsonwith status 2: run plainupdate, 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-checkasks GitHub whatevercheck_updatessays, and answers theupdateobject when it ends. A check already running is joined. A failure isfailedwith the reason, and the release found before is kept.update-installinstalls the release found, and answers theupdateobject when it ends, withinstalledtrue: restart to use it (restartorrestart --when-idle). It isconflictwhen there is no release (ask forupdate-checkfirst) 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 isfailedand can be asked again.- A development build, which never looks for updates, lists both as unavailable in
contractand refuses them withunavailable.
There is no command for them: cornercase update (with --json for a program) does the same from a shell, and works without a server.
Restart without cutting an agent off
Section titled “Restart without cutting an agent off”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:
cornercase update --when-idle --yes --timeout 3600cornercase restart --when-idle --yesThe 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.
Draw the tour
Section titled “Draw the tour”cornercase tour list --jsoncornercase tour start todo --no-cardcornercase tour complete todo addThe 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.
Plan usage
Section titled “Plan usage”cornercase usagecornercase usage --jsoncornercase usage --cachedcornercase usage --machine all --jsonusage 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 timeIt 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.
Every machine’s limits
Section titled “Every machine’s limits”--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.
cornercase recapcornercase recap yesterday --language Spanishcornercase recap week --fresh --jsoncornercase recap --dossier yesterdayrecap 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.
--freshwrites it again.--agent,--account,--model,--effortand--languagechange the settings for that run only, and write it again.--dossierprints 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
--jsonit printsrange,day,label,from,to,zone,written_at,age,agent,title,account,model,effort,language,tokens,conversations,text,places,dossier,loading,progress,empty,error,outdatedandchanged, every key present (nullwhen it has no value,falseand[]for the last two).outdatedistruewhen anowno longer matches what is open andchangedlists the ids of the places that changed; asking fornowagain writes it again, so you meet them after a run that failed.textkeeps the ids ([c3],[p1]), andplacesmaps each to its project, workspace, tab, agent, conversation, thepaneit was last seen in and that server’sbootand, for a pull request, its number and address. Each place also hasstatus(the status its conversation had when the recap was written,openwhen its pane reported none,nullwhen it was closed) andchecks(a pull request’s checks then,nullunless read from an open workspace). - To follow a conversation’s place to the pane it is in now, also after
restartoragents closeandagents reopenmoved it, look instatus --jsonfor the pane with the place’sagentandconversation, as the panel’s links do. Anullconversationmatches nothing, and opencode’s is alwaysnull. A pane’sagentcan benullwhile nothing reports its state (Gemini CLI with its window title off, for one), and then itsconversationalone names it. Without a match, try the place’spanewhile itsbootis the onestatus --jsongives, since ids start again with every start of the server, then its workspace and project by theirpath. An older server gives its panes noconversationkey. - 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 withbusywhen they differ. An older server is refused by the contract featurerecap. eventsreports{"event": "recap", "state": "started" | "finished" | "failed", "range", "agent", "error"}to every reader that did not filter by--pane.
cornercase bot agents --jsoncornercase bot new prs --agent claude --about "Review my open pull requests" --jsoncornercase bot about prs --jsoncornercase bot memory prs --jsoncornercase bot edit prs --memory "- squash merges"cornercase focus --bot prscornercase bot list --jsoncornercase bot say prs "which of my PRs are blocked?" --wait --jsoncornercase bot history prs --after 12 --jsoncornercase bot stop prscornercase bot setup prsprintf '%s' "$PASSWORD" | cornercase bot secret set prs campus-passwordcornercase bot secret list prs --jsoncornercase bot secret remove prs campus-passwordprintf '%s' '{"campus-user":"…","campus-password":"…"}' | cornercase bot secret give prs 3cornercase bot secret decline prs 3bot 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).
agentsanswers{"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(featurebot-reads:folderwhencornercaseaccess 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-emptyabout,newalso starts the bot’s setup turn and answersstatethinking, featurebot-setup),edit(bot, and the same, withabouttoo: it writesbot.md, an empty one empties it, and a server without the featurebot-aboutignores it, sobot edit --aboutchecks it first; an emptymodel,effortoraccountclears it) answer the bot:id,name,agent,model,effort,account,access,state(idleorthinking),held,unread,last(kind, the first 200 characters oftextandatof the lastbotoryouline, ornull),folder,created,routines(how many routines the bot has) andnext(UTC seconds of the next run of its routines, ornull; featurebot-routines).listanswers{"bots": [...]}.botnames a bot by id, or by name ignoring case; an unknown one isnot-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 aremalformed; a name in use and the 51st bot areconflict;resetandremovewhile the bot answers arebusy, and so issetup, which a bot whosebot.mdis empty refuses asconflict.about(bot) answers{"bot", "about"}: the text of the bot’sbot.md, what it is for, read when you ask (the bot rewrites it too);""when it is empty or missing, andfailedwhen it cannot be read. An edit form shows it and sendsaboutwitheditonly when the person changed it. Checkbot-about-readfirst, ascornercase bot aboutdoes: an older server refuses the action asmalformed.- Memory (feature
bot-memory):memory(bot) answers{"bot", "memory"}, the text of the bot’smemory.md, read when you ask,""when it is empty or missing andfailedwhen it cannot be read;edittakesmemory, which replacesmemory.md(an empty one empties it) and tells the bot’s conversation at its next message that the user changed it.cornercase bot memoryandbot edit --memorycheck the feature first: an older server refuses the action asmalformed, and the field asunknown-fieldonly in a structured request; a legacy request has it ignored, and the edit succeeds without writingmemory.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"};statusthen reports it asshown_bot. It is whatcornercase focus --botsends, after checking the featurefocus-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 (keyisfile);secret-remove(bot, andnameorall) 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 ofa-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 (conflictfor the 21st) and an unknown name isnot-found. A refusal of who may ask, or of a file that cannot be read (the secrets of prs cannot be read), isfailed. The value is never in abot list,status --app, an event or the log.bot listandstatus --app’sbotshavesecrets, how many the bot has, andsecrets_unreadable: true(left out otherwise) when its file cannot be read, so a bot withsecrets: 0and that flag is not one with none; saving and removing publishchange: edited.cornercase bot secret setreads the value from standard input, never from an argument. Checkbot-secretsfirst, as the commands do. - Asks (feature
bot-asks):secret-ask(names, 1 to 4,about, 1 to 200 characters on one line, andreplace) 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 isfailed), at once, with{"bot", "ask", "names", "already"}:already: truewith the waiting ask’s id for the same names asked again. A saved name withoutreplace, a fifth waiting ask and passing 20 secrets areconflict; a bad name orabout(control characters, direction marks, one of the bot’s values) ismalformed; a chat file that cannot be written isfailedand 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 isnot-found, and a bot’s connection is refused both (failed).bot listandstatus --app’sbotshaveasks([{"id", "names", "about", "replace", "routine", "missing"}],routinenullfor the chat,nameswhat was asked andmissingthe names asecret-givemust still hold, left out when none waits), and the chat linesasks for a secret: …,secret saved: …andsecret not given: …carryask. A restart forgets the asks.cornercase bot secret give BOT ASKreads one JSON object from standard input, never a terminal. Checkbot-asksfirst, as the commands do. setup(bot) runs the setup turn again and answers{"bot", "line"}at once with its first line, the noticesetting up; checkbot-setupfirst, ascornercase bot setupdoes.say(bot,text,wait) writes theyouline and starts the turn, or holds the message while one runs, and answers{"bot", "line"}at once. Withwaitit answers{"bot", "asked", "line"}when that message’s turn ends, with itsbot,errorornoticeline; the command exits with 3 unless it is abotline.history(bot,last,after) answers{"bot", "name", "lines"}: the chat’s lines, each withid(increasing per bot),at(UTC seconds),kind(you,bot,step,error,notice,started,finishedorwaiting) andtext; ayouline may beheld, astepnames itstool, and abotline has itsmodel,tokensandconversation. A setup turn’s first line is the noticesetting up. A line of a routine’s run also hasroutine, the run’s queue id; its first line is anotice↻ Label · 09:00, then its steps and abotorerrorline.resetandseenanswer{"bot"},removeanswers{"bot", "entries", "undo"}(the queue entries removed with the bot, as one removal thatqueue restoretakes;entriesis empty andundoleft out when there were none), andstop{"bot", "stopped"}.eventsreports{"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 withaboutreportscreated,thinking, thesetting upline, its steps, its answer andidle. A program that shows a chat readshistoryonce and follows the events.status --apphas abotskey, the same list asbot list, left out when there are no bots.- Chat apps (feature
bot-chat-apps):newandedittakechat_apps(away,alwaysoroff;nullleaves it, another value ismalformed), andbot listandstatus --appanswer it for every bot. It says when the bot’s answers reach a paired Telegram or Discord, see On Telegram and Discord.cornercase bot newandbot edit --chat-appscheck the feature first. - Following (feature
bot-follow): a bot that starts an agent is told when it finishes, see Agents it starts.newandedittakefollow(a boolean;nullleaves it), andbot listandstatus --appanswerfollowandfollowing(the ids of the panes the bot follows). Thestarted,finishedandwaitinglines haveagent(kind,pane,workspace,projectand the server’sboot, so a link can readclosedafter a restart),body(the last message, or the screen) andrun(the routine run whose conversation owns the line); the answer to a report turn of a run carriesruntoo.status,watchandviewhaveboton tabs and panes: the id of the bot that started them, left out when none. A request’s envelope has optionalbotandbot_run, which the CLI fills fromCORNERCASE_BOTandCORNERCASE_BOT_RUN(never under--remote); they only label what the request creates, and a bot’s own connection always tags with its own bot. statushasshown_bot, the id of the bot whose chat the window shows in place of the panes (featureshown-bot), next toshown_remote. It is left out when no chat shows, and so is it inwatchsnapshots andviewlines, 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_botis left out, andshownkeeps 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 addwithbot(a bot’s id or name, withrepeatoratandprompt, and none ofproject,workspace,worktree,issue,source,flow,cleanup,agent,mode,accountsorfresh) schedules the bot’s own work, as Queue work for later tells; a bot’s entry hasplace.bot, and a run endsansweredwith itssession. Acornercase-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, andclear-started, is refused with exit 1, codefailedanda bot can only schedule and change its own queue entries;queue liststays open. - A bot’s own commands run with
CORNERCASE_BOTset (andqueue addwith no--project,--workspaceor--worktreemeans that bot):kill-server,restartandupdateexit with 2 there (a bot cannot stop its own server), and so doesconfig export --to(a bot cannot have cornercase write to a file), and so docornercasewith no command,remoteto a machine andproxy(a bot cannot attach as a window), and so does a command that would act on the pane it runs in without a--project,--workspaceor--pane(a bot runs in no pane), and so do--remoteandCORNERCASE_REMOTE(a bot works on this computer only: it cannot act on another machine),pluginother thanlist,status,actionsandlogs,machines add,edit,remove,update,hideandshow, and everytunnelcommand. Each line ofrequests --follow -is checked the same way. - The server also refuses, with exit 1 and code
failed, what acornercase-access bot types beyond a prompt to an agent (above), every request that a decision table closes to it (keys,input,flow-runand 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-serverand thetunnel-*writes),flow-importandflow-savewithoutcheck,close-agentandagents-closewithoutcheck,closeof anything but a pane or tab the bot started,machinesset, remove and update, anything relayed withmachine,startin a mode that never asks,openinside the bots’ folder or of a.code-workspacefile, what stops or replaces it (restart-when-idleandupdate-install, andkill-serverandrestart, which fail with the same text:a bot cannot stop its own server), andclone(a bot cannot clone a repository). Acornercase-access bot’s connection may send only requests: a window’s messages (Hello, input and the rest) are answeredRejectedwitha bot cannot attach as a windowand the connection is closed. It tells a bot’s commands by their process, not byCORNERCASE_BOTalone, 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 newwith an access other thancornercaseandbot editwith an access (a bot cannot change a bot's access),bot sayto, and anybot editof, a bot withfullaccess (a bot cannot write to a bot with full access),configwrites (set,project,secret,remove) andconfig-importwithapply(a bot cannot change cornercase's settings), and avieworview-setthat names a bot, or aview-set --visibleof a view that still names one (a bot cannot show a bot's chat in a view;--bot ''clears it and is allowed).
Context
Section titled “Context”cornercase contextcornercase context --pane 4 --jsoncornercase context --tab 3 --cachedcornercase context --pane 4 --json --boot 4242-1700000000context 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 now251.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.0kmemory files: ~/code/web-shop/AGENTS.md 8.5kFor 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).
Pull requests
Section titled “Pull requests”cornercase pull-requestcornercase pull-request --worktree feat/login --jsoncornercase pull-request --workspace 4pull-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 failingReturns page crashes on an empty addresshttps://github.com/acme/web-shop/pull/482failed tests (ubuntu-24.04) CI https://github.com/acme/web-shop/actions/runs/1001/job/2001pending tests (macos-15) CI https://github.com/acme/web-shop/actions/runs/1001/job/2002passed lint CI https://github.com/acme/web-shop/actions/runs/1001/job/2003passed review-botskipped deploy Pages https://github.com/acme/web-shop/actions/runs/1002/job/2004From 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.
cornercase portscornercase ports --worktree feat/login --jsoncornercase ports --allports 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 12http://localhost:6006 0.0.0.0 :: node storybook dev pid 48390 workspace 4, agent claude in pane 9http://localhost:3000 127.0.0.1 node next dev pid 51007 workspace 4, cwdA 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.
cornercase ports stop 5173cornercase ports stop 3000 --pid 48211 --jsonports 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.
Tunnels
Section titled “Tunnels”cornercase tunnelscornercase tunnel open 5173cornercase tunnel close 5173cornercase tunnel forget 5173cornercase --remote devbox tunnel open 5173 --jsoncornercase --remote devbox tunnel hold 5173cornercase --remote devbox tunnel hold 5173 --local 5174cornercase --remote devbox tunnel hold --reverse 9222cornercase tunnel close --reverse 9223cornercase --remote devbox tunnel orderscornercase --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.
Processes
Section titled “Processes”cornercase processescornercase processes --pane 12 --jsoncornercase processes --workspace 3 --interval 2000processes 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 MBcornercase 0.8% 85 MBtotal: 1 pane, 3 processes, cpu 98.8%, 897 MBCPU 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.
cornercase processes stop 4211cornercase processes stop 4211 --started 81240 --jsonprocesses 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.
Worktrees
Section titled “Worktrees”cornercase worktrees listcornercase worktrees list --project 2 --jsoncornercase worktrees size --worktree feat/logincornercase worktrees free-builds --worktree feat/login --checkcornercase worktrees free-builds --worktree feat/logincornercase worktrees free-builds --merged --checkcornercase worktrees free-builds --mergedcornercase worktrees remove --path ~/.cornercase/worktrees/web-shop/feat-login --checkcornercase worktrees remove --path ~/.cornercase/worktrees/web-shop/feat-login --delete-branchworktrees 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 unpushedweb-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 stop3.5 GB in 2 worktrees · 2.1 GB of builds idle 7+ days2.1 GB of builds in 1 merged worktree: cornercase worktrees free-builds --mergedThe 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/.nextThe 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 GBfreed 15.7 GB in ~/.cornercase/worktrees/shop/issue-143: target 15.7 GBdid not free ~/.cornercase/worktrees/shop/issue-156: cargo runs in itfreed 41.2 GB in 2 merged worktreesWith --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.
Removing worktrees
Section titled “Removing worktrees”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 unpushedweb-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 --unlockWithout --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:
--forceis 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-branchwould lose commits. Commits not pushed on a branch that stays do not need it.--unlockis needed for a locked worktree,--forceor 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/logindid not remove ~/.cornercase/worktrees/web-shop/feat-gift-cards: 3 files changed, codex running in it; they stop; add --force to remove it anywaydid not remove ~/code/web-shop: it is a repository's main checkout, which is never removedIt 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.
cornercase statscornercase stats --jsoncornercase stats --sharecornercase stats --machine allcornercase stats --cached --machine all --jsonstats 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 sumsummed from:▭ this computer● vps read 4 min ago○ mini ssh: connect to host mini port 22: Connection refused · not summedThe 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.
Settings
Section titled “Settings”cornercase configcornercase config --jsoncornercase config --json | jq -c '.agents[] | select(.flows) | .name'cornercase config models opencodecornercase config search def agcornercase config set sidebar treecornercase config set fetch_minutes 10 counts falsecornercase config set issue_tabs github,linearcornercase config set shell /usr/bin/fish shell.args -lprintf '%s' "$LINEAR_API_KEY" | cornercase config secret linearcornercase config remove linearcornercase 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 --jsonA 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,pageandsection(where the dialog shows it),label,type(switch,number,text,choice,listorkey),valueanddefault(as JSON),shown(what the dialog shows as its value),note,choices(for achoiceand thelist:value,note,dangerous; forshell, atext, the shells found, offered as suggestions while any program is taken),field(the label of its edit field),question(the title of its pick),dangerousandrestart.restartsays the change only applies after a restart; none of today’s settings does.settakes 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,connectedorrefused),account(who it is connected as),from(savedorenv) andenvfor a token from the environment,countfor the paired browsers,field(what to paste) andremovable. A token or a bot is set withsecret, never throughset. -
projects:folder,key(as written inconfig.json),project(the id of the open project in that folder),repository,setupandteardown. -
agents: each agent the default agent setting can name, in the order of its choices (autoaside): the agents cornercase knows, the others it can start, then your own fromagent_commands. Each hasname;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 --cleanuprefuses the others) andwaitcan wait on it without OSC 7501 reports;flows, true when a flow’s role can run it (flow save --checknames 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 isstart --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):modelsis then only the start, andconfig modelsgives the whole list; andefforts, the levelsstart --effortand a role’sefforttake, empty when it has no effort switch.reads_statusandflowsagree today but may not later, so read each for what it says. The text form leaves the agents out, and a server without the featureconfig-agentsleaves outagents.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(theconfig.jsonfile),problem(why it cannot be read, when it cannot) andnotices: 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.
An agent’s models
Section titled “An agent’s models”cornercase config models opencodecornercase config models opencode --jsonIt 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.
Pair a phone
Section titled “Pair a phone”cornercase config set remote truecornercase config pair browsers --jsonprintf '%s' "$BOT_TOKEN" | cornercase config secret telegramcornercase config pair telegram.chat --jsoncornercase config pair discord.chatcornercase config set phone_app truecornercase config pair app --jsoncornercase config pair app --routes --jsoncornercase config pair app --new-certificate --jsonconfig 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.
The command line over a WebSocket (/cli)
Section titled “The command line over a WebSocket (/cli)”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.
Pick the forum’s server
Section titled “Pick the forum’s server”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"}]}}cornercase config forum-server 1041234567890123459cornercase 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.
Share your setup
Section titled “Share your setup”cornercase config export --to team.tomlcornercase config import team.tomlcornercase config import team.toml --only agents,worktreescornercase config import - --yes < team.tomlcornercase config import team.toml --preview --jsonconfig 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.
Machines
Section titled “Machines”cornercase machines --jsoncornercase machines add vps ana@vps.example.com --icon servercornercase machines edit vps --folder '~/src'cornercase machines retrycornercase machines hide vpscornercase machines show allcornercase machines update mini --jsonmachines 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"}}]}stateisconnecting,linked,unreachableorolder.versionis the cornercase installed there (forolder, the old one) andserver_versionthe one its server runs, which differ until that server restarts.seenis when the link was last up, as a UTC time, ornull;erroris why it is down (whatsshsaid, cornercase not found there, this computer, the same server as another machine, or what a failed update printed last);updatingistruewhile anupdateruns;problemis what is wrong with the entry inconfig.json, which then gets no link. A machine that is not shown hasstateunreachableand"shown": false(written only then, ascommandis only when set), and no link:retry,updateand--machinefor it arenot-found, saying so (`vps` is hidden here, so it has no link). A server that knows the featuremachine-showntakescommandandshown;cornercase machines add --command C --hiddenandedit --command Ccheck it first.retry_atis when a link that fell tries next, as a UTC time in the form ofseen, for a card that counts down like the window’sreconnecting 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 islinkedorconnecting, and while it waits on a person:statesays why when it isolder, anderrorwhen 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, asseenis. An older server never sends it: check themachine-retry-atfeature before reading a machine with noretry_atas one that waits on a person.settakes the machine’snameand what changes:new_name,icon(the glyph or its name),destination,folder,command(what runs cornercase there for a window opened there;""clears it) andshown(falsekeeps it on the list without a link); a new machine needs adestination, and gets☁and~/codeunless you give them.createset totrueonly adds, and a name already listed is aconflict;falseonly edits, and an unknown name isnot-found;nulldoes either. A value the rules refuse ismalformed, and a name or destination another machine has is aconflict, with the same texts as the form.removetakes the name; the machine’s server keeps running there.retrytakes a name, ornullfor every machine, and tries those links now.retryandupdateof a machine whose entry has a problem arenot-found, with the problem.hidetakes a name, ornullfor every machine, and turns itsshownoff: its link ends and its server keeps running there.showturns it on and links it again. A machine already hidden or shown is no error and nothing is written; an unknown name isnot-found. A server that knows the featuremachine-hidetakes them;cornercase machines hide|show NAME|allchecks it first.updatetakes the name of anoldermachine and answers oncecornercase updateended there: the list, orfailedwith what it printed last. It is aconflictwhile one runs for that machine, and for a machine that isn’tolder.memoryis how much memory a computer has, in bytes:total,available(what the system can give a new program, the file cache included) andread_at, when it was read, as a UTC time.here.memoryis 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, theautoof a dialog’srun onrow, 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 featurememory, which never reports it. Check thememoryfeature before taking a missingmemoryto mean it is unknown.- Unknown names are
not-found.cornercase contractlists the operationmachinesand the featuremachines, and theappstream carries the same rows asmachines.
The machines a window offers
Section titled “The machines a window offers”cornercase remote --known --jsoncornercase remote --remember me@10.0.0.5 --command '~/bin/cornercase'cornercase remote --forget devboxremote --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.
Machines’ workspaces
Section titled “Machines’ workspaces”cornercase status # after what is here, each machine and what it hascornercase status --json | jq '.machines[] | {name, projects: [.projects[] | {name, repo, paired}]}'cornercase focus --machine vps --workspace 4 # pick workspace 4 of vps as the one showncornercase focus --machine vps --tab 9 --json # pick tab 9 of vps and print what is pickedYour 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-shopand an ssh alias from that machine’s~/.ssh/configare allgithub.com/acme/web-shop, taken from theupstreamremote, elseorigin, 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 hasremotes(name,url, without passwords or tokens) andrepo, that identity, both left out when it has no remotes.machineshas one entry per machine that has sent what it has:name,icon,state,seen,retry_at(as inmachines, so a failed try sends a line ofstatus --follow),boot(its server’s, not yours) and itsprojects, asprojectsgives yours, withmachineon each project and workspace,groupalwaysnull, andpaired, the id of the project here it pairs with, ornull, and itstunnels, as that machine’s owntunnelslists them (with its ownholdernumbers, 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 withfocus --machine, never with--pane,--tabor--workspacealone.shown_remote(machine,boot,project,workspace,tab,path) is the machine’s workspace picked withfocus --machineor a click on its row, and itsstreamsays how the window’s view of that tab is doing:connectinguntil the machine sends its first screen,live, ordownwhile the machine or that connection is down.streamis left out while no window is open, since the tab is only streamed for a window.status --followcarries 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--jsonprints itsshown_remote. The window shows it as a click on its row does, with the machine’s tab in the pane area, andstatusreports it asshown_remoteand(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 withcornercase --remote DESTINATIONview,surfaceandinput, with the machine’sdestinationfrommachinesand the idsstatusgives undermachines. It takes no--view,--pane,--project,--worktreeor--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, isnot-found; one that has sent nothing yet isunavailable.--boot BOOT(machine_bootover the socket) is thebootof the machine’s entry the ids came from: a machine whose server restarted since is refused withstale-boot(status 4) and nothing is picked; check themachine-bootfeature first. Over the socket it is{"command": "focus-machine", "args": {"machine": "vps", "item": {"workspace": 4}}}. Check themachine-workspacesfeature 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--bootand the machine’sboot. Moving the focus between the panes of a view of your own on the machine isfocus --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 IDalone 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--remoteand its own ids:cornercase --remote ana@vps.example.com rename --workspace 4 docs,close --workspace 4,close --workspace 4 --remove-worktree --checkto see what removing it would lose, thenclose --workspace 4 --remove-worktree(with--forceor--unlockas Arrange says). Give each one the machine’sbootfromstatus --jsonwith--boot(over the socket,bootin 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 itsviewlines andsurfaceframes give:mark,move-pane,account restart --pane,context,send,inputandpaste-filetake--boottoo, 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, sendcornercase --remote ana@vps.example.com collapse --pane 9 --boot BOOT(orexpand --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.
Start work on a machine
Section titled “Start work on a machine”cornercase start claude --issue '#482' --project 2 --machine vps --focuscornercase new-workspace notes --project 2 --machine vps --jsoncornercase flow run Quick --prompt 'Fix the login form' --project 2 --machine vpsstart, 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:
projectandworkspaceasstatus --jsonlists them undermachines(pairedgives 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
machineadded:{"project": 2, "workspace": 7, "tab": 11, "pane": 12, "machine": "vps"}.focusselects 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. Withfocus, a machine that hasn’t sent what it has yet isunavailable(try again), and--viewismalformed: what a machine shows is the window’s. - Errors: a machine not listed is
not-found, one that isn’t linkedunavailable, with why. The machine’s own refusals keep their code, and the request carries thebootof what the machine last sent, so one that restarted in between answersstale-bootand starts nothing. A machine that takes too long gives up withfailedandit 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 vpsafter the command’s words when it takes one (start,new-workspace,focus,flow run,stats,usage),thereafter any other,cornercase statusas it is; with--remote,--remotecomes first. - Its boot:
--boot BOOTtakes thebootof the machine’s entry instatus --json, the one you read its ids in (machine_bootover the socket, an optional string inargsofstart,start-with,new-workspaceandflow-run, and offocus-machine). Your server compares it with what the machine last sent before sending anything: a machine that restarted since is refused withstale-boot(status 4) and nothing is sent or started, and one that has sent nothing yet isunavailable. The machine itself refuses if it restarted after that. Send"contract": 1too to read the code, and check themachine-bootfeature first, as the command does. Withoutmachineit ismalformed: sendbootfor this server’s run. - No waiting:
wait,untilandtimeoutwithmachinearemalformed.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 withcornercase --remote DESTINATION waitand its ids, but afterplacedonly once the launch there is over, as Start an agent says:waitandsendbefore then fail or reach the wrong place.status --jsonhere lists that pane undermachines, and its status turnsworkingwhen the agent has taken its prompt. - An older server would ignore
machineand start the work on this computer, so check themachine-startfeature first, as the command does. autoas themachineofstart,start-withandflow-run(--machine auto, any case) lets your server pick, as the window’sautodoes: this computer, or the linked machine that has the project (found by its repository, aspairedis) and the most free memory once what it needs is counted, this computer on a tie. A machine on a cornercase without the featurememory, 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 isproject, elseworkspace’s, else the caller’s, and a machine gets the start in its own clone of it (aworkspacegiven 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’smemoryor 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, withmachinewhen it went to one, andauto, 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 codeno-roomand why (no machine has 6 GB free (best: mac, 4.1 GB)), nothing starts, and the command exits with status 8.machine_bootwithautoismalformed. Check themachine-autofeature first, as the command does: an older server would look for a machine namedauto. A machine can’t be namedauto.
Plugins
Section titled “Plugins”cornercase plugin statuscornercase plugin status --jsoncornercase plugin actionscornercase plugin actions --context pane --jsoncornercase plugin run acme.notes note --pane 5cornercase plugin run acme.notes note --worktree feat/xcornercase plugin run acme.notes browsecornercase plugin popup-closecornercase plugin windows --jsoncornercase plugin install acme/notes --preview --jsoncornercase plugin install acme/notes --commit "$commit" --yescornercase plugin update acme.notes --preview --jsonplugin 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
buttonaction 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,--worktreeor--projectstill 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 atwidth×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 withsurface --popupandinput --popup, and it is still one popup for everybody: a window shows it too, and a dialog or another popup makes it fail withconflict. - If the view goes away, the popup stays open at the size it has, as it does when the last window leaves, and
plugin rungoes on waiting. A program that comes back finds it instatus --app’spopup, then shows it again or closes it withplugin popup-close, since no other popup opens until then. - A view that closed is
not-found, a server withoutplugin-run-viewis refused up front, naming the update, and without--viewnothing 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.
Window processes beside your own window
Section titled “Window processes beside your own window”A program that draws cornercase itself runs this for as long as its window is open:
cornercase plugin windows --jsonWhat 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. |
Exit status
Section titled “Exit status”| 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. |
Contract and compatibility
Section titled “Contract and compatibility”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.
Ask the server first
Section titled “Ask the server first”cornercase contractcornercase contract --jsoncornercase 0.12.137contract 1boot 4242-1700000000commands 78 (78 available)stream events 1stream watch 1stream surface 1stream view 1stream app 1stream changes 1stream flow-runs 1stream flow-messages 1stream files 1stream config-pair 1stream tunnel-orders 1features 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 restartincluded, since ids start again from 1. It is the same value asCORNERCASE_SERVERin the panes andbootinstatus --json.operations: every request the server takes, by name, withavailable. A server withstart-serveramong 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 hasavailable: falseand areason; the others keep working.features: what a request can ask for (below):boot,structured-errors,strict-fields,views(theviewfield and--view; a client checks it before sending a view to a server),host-events(thehostfield ofevents, which an older server would ignore; a client checks it before sending it)theme(thethemerequest andstart-server’stheme; check it before sending colours),notices(a view’svisible, thenoticesfield ofeventsand thegorequest; check it before sending them),surface-patches(thepatchesfield ofsurface; an older server ignores it and sends complete lines, so check it before asking)config(theconfigrequest andconfig.revision)close-unlock(theunlockfield ofclose, which an older server ignores and then refuses with the lock’s message; check it before sending it),sound(a notice’ssoundfield: an older server never sends it),issues(theissueandsourcefields ofstartandflow-run, which an older server ignores and then starts the agent without the issue; check it before sending them),todo-panel(thetodorequest’sedit,undone,move,clear-doneandrestore; an older server refuses them as malformed, so check it before sending them),changes(thechangesrequests and thechangescount ofstatus),agent-folds(thepaneitem ofcollapseandexpand; an older server refuses it as malformed, so check it before sending it),accounts(theaccount-*andprofile-*requests and theprofilefield ofstart,start-with,new-tabandflow-run, which an older server ignores and then starts the agent with its own login; check it before sending it),account-login(thecheckfield ofaccount-listand each account’slogin; an older server ignorescheckand answers without asking, so check it before sending it),account-switch(theaccount-renameandaccount-userequests and theaccountsfield ofstart,start-with,new-tab,flow-runand the queue’saddandedit, which an older server ignores and then starts with the default accounts; check it before sending it),accounts-revision(accounts_revisioninstatus --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(theworkspace_namefield ofstart,start-withandflow-run, which an older server ignores and then names the workspace after the issue; check it before sending it),close-agent-tabs(close-agentonly closes tabs and never removes a worktree; check it before sendingclose-agent, since an older server removes an agent’s own worktree),queue-undo(queue removereturns undo data, and the queue acceptsclear-startedandrestore; check it before removing anything, since an older server removes without undo),focus-reveal(therevealfield offocus, which an older server ignores and then only shows the pane; check it before sending it), andpopup-terminal(thepopupfield ofsurfaceandinput; an older server refusessurfaceandinputwithpopupalone for their missing tab or pane, but takesinputwithpopupandpaneas input to panepane, so check it before sendingpopup),files(thefiles-*requests, thefilesstream,homeinstatusand~/inopen, which an older server takes as a folder named~; check it first),shared-files(sharedin each workspace ofstatusand thechanges-merge-checkrequest),settings-search(thesearchaction ofconfig),flow-issue-prompt(thepromptfield offlow-runtogether withissue; an older server refuses the two as malformed, so check it before sending both),start-issue-prompt(thepromptfield ofstartandstart-withtogether withissue, added after the issue’s prompt; an older server refuses the two as malformed, or, withoutissues, ignoresissueor answersunknown-field, so check it before sending both),start-folded(thefoldedfield ofstart,start-withandflow-run, which an older server ignores and then starts the agent expanded; check it before sending it),machines(themachinesrequest and themachineskey ofstatus --app),machine-usage(themachinefield ofstatsandusage, which an older server ignores and then answers for itself; check it before sending it),stats-cached(thecachedfield ofstatswith amachine, which an older server ignores and then waits for the machine; check it before sending it),machine-workspaces(remotes,repo,machinesandshown_remoteinstatus, and thefocus-machinerequest; see Machines’ workspaces),machine-start(themachinefield ofstart,start-with,new-workspaceandflow-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; theplacedfield ofstartandstart-withcame 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(therepeat,flowandcleanupfields ofqueue addandqueue edit, andqueue pauseandqueue resume; an older server takes a routine as a one-off entry, so check it before sending them),plugin-run-view(theviewofplugin-run; an older server with views refuses it asmalformed, so check it before offering a plugin’s buttons in a view),flow-run-view(theviewofflow-run; an older server with views refuses it asmalformed, so check it before sending a view with a flow run),open-code-workspace(a.code-workspacefile as thepathofopen, which an older server refuses as not a folder, and theintofield ofopen, which an older server ignores and then opens the folder outside the group; check it before sendinginto; see Import a VS Code workspace),against-base,machine-retry-at(a machine’sretry_at, which an older server never sends; see Machines),machine-hide(thehideandshowactions ofmachines, which an older server cannot read; see Machines),notice-subagent(a notice’ssubagentfield: an older server never sends it; see Follow events),mode-default(defaultas themodeofstart-withand ofqueueaddandedit, meaning no mode arguments: an older server refuses it instart-withand, inqueue, captures the mode chosen in settings instead, soqueue add --mode defaultchecks it first; see Start an agent),flow-close-when-merged(theclose_when_mergedfield offlow-runand theflow-close-when-mergedoperation: an older server drops the field and then starts a run that never closes its agents, soflow run --close-when-mergedchecks it before sending it),flow-free-builds(thefree_buildsfield offlow-runandflow-close-when-merged: an older server drops it and then never frees, soflow run --free-buildsandflow close-when-merged --free-buildscheck it before sending it),fresh-branches(thefreshfield ofstart,start-with,new-workspace,flow-runand the queue’saddandedit, which an older server drops and then branches fromHEAD;--freshchecks it before sending it;--no-freshchecks nothing on this server, and a machine older than this refuses either value asunknown-field),notice-messages(themessageevents ofevents --notices, the server’s notices without a token: an older server never sends them; see Follow events),prompt-unsent(unsentandwarningin the answers ofstartandstart-withwhose agent never took its prompt,unsenton queue entries, and thequeue-unsentnotice: an older server sends none, so check it before taking a missingunsentto mean that the prompt was taken),surface-wrapped(a pane’swrappedinsurfacelines: an older server never sends it, so check it before taking a missingwrappedto mean that no row goes on),account-login-tab(the request of that name, and a view withaccount-add: an older server refuses the request by name and a view onaccount-addasmalformed, so check it before sending either),config-agents(theagentslist ofconfig: an older server leaves it out)tunnels(the requeststunnels,tunnel-openandtunnel-close, andtunnelsinstatus),tunnels-remembered(the stateclosed, a closed tunnel staying listed,kindandtunnel-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 requeststunnel-ordersandtunnel-failed, the stream of orders andtakersin the tunnel answers: an older server refuses the requests by name; check it before sending either),tunnel-reverse(thedirectionoftunnel-hold,tunnel-closeandtunnel-forget,tunnel hold --reverseand--reverseon close and forget: an older server dropsdirectionand would hold or close a forward tunnel of that port, so check it before sending it),queue-results(thequeue-showrequest, andstartedandresult_aton the queue’s entries: an older server refusesqueue-showby name),agent-models(theagent-modelsrequest andcatalogueinconfig’sagents: an older server refuses the request by name and leavescatalogueout),flow-not-run(a run’snot_runinflow runs; an older server never sends it, so check it before taking a missingnot_runto mean every stage ran since the last change),flow-stopped(a run’sstoppedinflow runs; an older server never sends it, so check it before taking a missingstoppedto mean the run moves)machine-tunnels(each machine’stunnelsinstatus,status --followandview: an older server leaves them out),machine-boot(themachine_bootfield ofstart,start-with,new-workspace,flow-runandfocus-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(exitedon a role offlow runsand in a workspace’srun, andagents reopenbringing back a role whose agent exited: an older server leaves the keys out and refuses the reopen),tunnel-hold-ended(theendedline atunnel-holdstream gets before a close or a forget ends it: an older server sends none),merged-builds(themerged_buildstotal ofworktrees 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-routesanswersfingerprintandconfig-pairtakesnew_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, asconfig pair app --new-certificatedoes; pair a phone),status-since(a pane’ssinceinstatus,watchandview: an older server leaves the key out, so thesincecolumn of--panesis then-, ornullwith--json),paste-then-send(pasteinpaste-file’s answer andafter_pasteinsend: an older server drops the field and holds the send, sosend --after-pastechecks it first),paste-undo(undoinpaste-fileand its answer: an older server refuses it as a paste without a file, or withunknown-fieldwhen the request carriescontractorboot, sopaste-file --undochecks it first),issue-search(queryandafterinissue-list, andnextandsearchin itssources: an older server drops them and lists the first page unfiltered, or answersunknown-fieldwhen the request carriescontractorboot, soissue list --queryand--aftercheck it first),issue-list-all-projects(all_projectsinissue-list, andprojectin itssourcesand issues: an older server lists one project’s issues, or answersunknown-field, soissue list --all-projectschecks it first),message-flow-exited(theflow-exitedmessage and itsrunandrole),message-failed(failed: trueon aflow-mergedmessage whose free of the builds failed: an older server never sends it, so check it before taking a missingfailedto mean the builds were freed),held-after-draft(send now andheld --send-nowpaste the message after the person’s draft and leave its Enter to them, andheldanswersafter_draft; an older server sends both as one line, so check it before telling the person their line stays), andbots(thebotrequest, its events andstatus --app’sbots;cornercase botchecks it, so an older server is refused by name),bot-about(theaboutfield ofbotedit, which an older server refuses as an unknown field;bot edit --aboutchecks it first),shown-bot(shown_botinstatus: an older server never sends it, so check it before taking a missingshown_botto mean the window shows the panes),bot-routines(botin the queue’saddandedit, which an older server refuses as an unknown field;place.botand the stateansweredin queue entries; theroutineof a bot’s chat lines;routinesandnextof the bots;entriesandundoinbot remove‘s answer;queue add --botandqueue list --botcheck it first),bot-reads(readsinbot agents: an older server leaves it out),bot-setup(bot newwith a non-emptyaboutstarts the bot’s setup turn and answersstatethinking; the noticesetting up; thesetupaction ofbot, whichcornercase bot setupchecks first),bot-about-read(theaboutaction ofbot, which an older server refuses asmalformed;cornercase bot aboutchecks it first),bot-secrets(thesecret-*actions ofbotandsecretsin the bots’ list, which an older server refuses asmalformedor leaves out;cornercase bot secretchecks it first),bot-asks(thesecret-ask,secret-giveandsecret-declineactions ofbot,asksin the bots’ list andaskon a chat line, which an older server refuses asmalformedor leaves out;cornercase bot secret ask,giveanddeclinecheck it first),bot-chat-apps(chat_appsinbotnewandedit, which an older server refuses as an unknown field, and in the bots’ list, which an older server leaves out;--chat-appschecks it first),bot-memory(thememoryaction ofbot, which an older server refuses asmalformed, and thememoryfield ofbotedit, which it refuses asunknown-fieldin a structured request and ignores in a legacy one, so the edit succeeds without writingmemory.md;cornercase bot memoryandbot edit --memorycheck it first),focus-bot(theshowaction ofbot, which an older server refuses asmalformed;cornercase focus --botchecks it first),memory(here.memoryand each machine’smemoryinmachines, which an older server never sends),machine-auto(autoas themachineofstart,start-withandflow-run, theirautoanswer and the codeno-room: an older server looks for a machine namedautoand refuses, so--machine autochecks it first),view-bot(thebotfield ofviewandview-setand of a view’s lines, which an older server drops;--botchecks it first),queue-when-free(thewhenandmachinefields of the queue’saddandeditand itsfirstaction,wait,machine,first,waitingandtherein its entries, and thequeue-waitingandqueue-pull-requestmessages: an older server knows none of them, soqueue addandqueue editwith--whenor--machine, andqueue first, check it first),section-folds(thesectionofcollapseandexpandandcollapsed_sectionsinstatus: an older server cannot read a fold without an item, so--sectionchecks it first), andpending-question(the request of that name,read --pending: an older server refuses it by name, soread --pendingchecks it first),view-no-claim(no_claiminviewandview-set,claimsin a view’s lines: an older server would drop the field and size the tab, so--no-claimchecks it first)mark-seen(seeninmark: an older server would drop it and mark the agent as pending review, so--seenchecks it first)read-messages(the request of that name,read --messages: an older server refuses it by name, soread --messageschecks it first) andflow-account(the request of that name, each role’saccountand a run’saccount_changeinflow runs: an older server refuses the request by name and leaves the keys out, soflow accountchecks it first).streams: the formats of what the server streams, with their versions:{"name": "events", "version": 1}forevents{"name": "watch", "version": 1}forstatus --follow{"name": "surface", "version": 1}forsurfaceand{"name": "view", "version": 1}forview, whose lines arewatchformat 1 plusview, and{"name": "app", "version": 1}forstatus --app,{"name": "changes", "version": 1}forchanges,{"name": "flow-runs", "version": 1}and{"name": "flow-messages", "version": 1}forflow runsandflow messages,{"name": "files", "version": 1}forfiles list --followandfiles read --follow, and{"name": "config-pair", "version": 1}forconfig pairand{"name": "tunnel-orders", "version": 1}fortunnel 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.
What stays compatible
Section titled “What stays compatible”- Fields are only added, never renamed or removed. Read answers leniently: ignore keys you don’t know, and don’t depend on their order (
eventslines 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 … commandrather than doing something else. contractgoes up when something that was there changes. Additions show inoperations,featuresandstreamsinstead.- The format of each stream has its own version. Format 1 of
eventsis the one described in Follow events, format 1 ofwatchthe one in Follow the whole state, format 1 ofsurfacethe one in Stream a tab’s terminals, format 1 ofappthe one in Follow the rest of the app, format 1 ofchangesthe one in Follow a workspace’s changes.
Errors with a code
Section titled “Errors with a code”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.
Talking to the socket directly
Section titled “Talking to the socket directly”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.
Teach your agents
Section titled “Teach your agents”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:
npx skills add usecornercase/cornercase-terminal --skill cornercase -gOnly 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.
Environment
Section titled “Environment”| 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). |
Security
Section titled “Security”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.
Queue work for later
Section titled “Queue work for later”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.”