Command line
cornercase opens the window. Its other commands manage the server, or drive it from scripts and coding agents.
Commands
Section titled “Commands”cornercase # open the UI, starting the server if neededcornercase remote HOST # open the UI on the server of another machine, over sshcornercase update # install the latest release and restart the servercornercase restart # restart the server; the session comes back with new shells, agents resumecornercase start-server # start the server and restore the session without opening a windowcornercase kill-server # stop the server and every shell in itcornercase logs # print the end of the server's logcornercase --version # print the versioncornercase --help # list every command; cornercase COMMAND --help explains oneThe commands for scripts and agents, status, stats, usage, open, new-workspace, new-tab, split, start, send, keys, read, wait, events, surface, changes, view, view-set, input, scroll, selection, resize, redraw, ratio, link, theme, config, account, profile, issue, search, close, group, move, move-pane, collapse, expand, rename, focus, go, notify, todo, queue, away, mark, skill and contract, have their own page: Scripts and agents. Among them, status --follow keeps running and prints the whole session as one JSON line each time it changes, for another UI or a script that mirrors it, and status --app prints (with --follow, keeps printing) the TODO list, queue, away, update and keep awake.
cornercase
Section titled “cornercase”Attaches to the server, starting it first if none is running. A new server restores your saved session, or, when there is nothing to restore, opens the folder you ran the command from as a project.
When it starts, the client asks your terminal for its foreground, background and 16 ANSI colours (it waits at most a second for the answer, then briefly drains late replies), then turns on mouse reporting, bracketed paste and unambiguous key reporting. Late replies are dropped without reaching the pane. It puts your terminal back the way it was when it exits, and detaches cleanly if terminal input ends.
A server from another build
Section titled “A server from another build”A client only attaches to a server started from the same binary. After an update, the old server may still be running, so cornercase asks on the plain terminal before opening the UI:
The running cornercase server comes from another build; cornercase was probably updated.Restarting stops every program running in cornercase's terminals. Running now: 2 agents (1 working,1 waiting for you) and 1 other program (`npm` in orders-api › main). Your projects, workspaces, tabs andsplits come back, each tab with a new shell in its folder. 2 agent conversations resume in their tabs.Restart it now? [y/N]The list comes from the old server itself, so you see what it is running before you answer. A server too old to say, or one that doesn’t answer within a second, gets a general warning instead. Answer y to stop the old server and start one on the new binary: your projects, workspaces, tabs and splits come back, each pane with a new shell in its folder, and Claude Code, Codex, Gemini CLI, Grok Build, Cursor CLI and GitHub Copilot CLI resume their conversations. Any other answer leaves the old server running and exits with the message below. When the input isn’t a terminal, as in a script, it doesn’t ask.
cornercase remote
Section titled “cornercase remote”Opens the window on the server of another machine, through your own ssh:
cornercase remote devbox # a host from ~/.ssh/config, or user@hostcornercase remote devbox --command '~/tools/cornercase' # where cornercase is on that machineIt runs ssh devbox cornercase proxy, which starts the server there if none is running. If the connection drops, the window stays, says reconnecting to devbox… and tries again by itself; Esc or its quit gives up. Both machines need the same version: when they differ it says which one to update, and offers to update the other machine through ssh when that one is older. Remote machines explains it all.
cornercase update
Section titled “cornercase update”Installs the latest release from any shell, without waiting for the next check:
cornercase update # install it, then ask whether to restart the servercornercase update --yes # install it and restart the server without asking (-y works too)cornercase update --check # only say whether a newer version is outIt asks GitHub for the latest release. If yours is the latest, it prints cornercase 0.5.0 is up to date and stops. Otherwise it replaces the binary the same way the update dialog does (download, checksum, a test run of the new binary) and prints updated cornercase 0.4.2 → 0.5.0. If anything fails, it says why and the old binary stays.
The server that is running still has the old version, so update then asks:
The running cornercase server still runs 0.4.2.Restarting stops every program running in cornercase's terminals. Running now: 2 agents (1 working,1 waiting for you) and 1 other program (`npm` in orders-api › main). Your projects, workspaces, tabs andsplits come back, each tab with a new shell in its folder. 2 agent conversations resume in their tabs.Restart it now? [y/N]With y or --yes, it saves your session and restarts the server. --yes prints the same list first, since it doesn’t ask, and both print what was stopped afterwards, such as stopped 2 agents and 1 other program: every attached window reopens on the new version. Your projects, workspaces, tabs and splits come back, each pane gets a new shell in its folder, and agents resume their conversations. If you say no, or when the input isn’t a terminal and --yes isn’t given, the old server keeps running until you run cornercase kill-server. update never opens the UI. Run cornercase afterwards if you want it.
You can run it inside one of cornercase’s own panes. That pane closes with the server and reopens with the rest of your session.
A server running 0.4.2 or older doesn’t know how to restart itself, so this first time update stops it instead, like kill-server, and the attached windows close. Run cornercase again to get your session back on the new version. From the next update on, the windows reopen by themselves.
When cornercase can’t replace its own binary (Homebrew installed it, you can’t write to its folder, or your platform isn’t one it knows), update changes nothing. It prints the command to run instead (brew update && brew upgrade cornercase, or the install script) and exits with a non-zero status. After that command, the next cornercase offers to restart the old server.
--check prints cornercase 0.5.0 is out (you have 0.4.2). Update it with: followed by the command, or that you are up to date. It exits with status 0 in both cases. Builds made with cargo run refuse to update.
cornercase restart
Section titled “cornercase restart”Restarts the server, like settings → restart in the app. It first lists what is running in your terminals and asks Restart it now? [y/N], since restarting stops every program in them, agents included. With y or --yes, it saves your session and restarts the server: every attached window reopens, and your projects, workspaces, tabs and splits come back, each pane with a new shell in its folder and each agent in its conversation. --yes prints the list first, since it doesn’t ask, and both print what was stopped afterwards, such as stopped 1 agent and 2 other programs. If you say no, or when the input isn’t a terminal and --yes isn’t given, the server keeps running. If no server is running, it prints no cornercase server is running.
You can run it inside one of cornercase’s own panes. That pane closes with the server and reopens with the rest of your session.
Once no agent is working
Section titled “Once no agent is working”An agent in the middle of a turn loses that turn when the server restarts: its conversation resumes, but not the tool call or the build it was running. --when-idle waits for the agents first, and works with update too:
cornercase restart --when-idle # ask, then restart once no agent is workingcornercase restart --when-idle --yes --timeout 3600 # without asking; give up after an hourcornercase update --when-idle --yes # install now, restart on it once the agents are doneIt lists what is running and asks Restart it once no agent is working? [y/N], then waits until every agent with a status has stopped working: idle, done, failed, pending review and waiting for you count as stopped, and so does a Claude Code agent whose turn is over while a shell it started in the background still runs. The server restarts in the same moment it sees that, so no agent starts a new turn in between; a prompt typed into an agent in the last two seconds, or one cornercase is still typing, holds it a moment longer. Meanwhile every window shows ↻ restart pending until 2 agents end their turn in its corner, so nobody starts a long task by surprise, and its cancel button calls the restart off.
An agent whose own turn is over while subagents it started still run holds it too. Other programs, such as a dev server, don’t hold the restart; they stop as with any restart. Neither does the pane the command runs in, so an agent can run it as its last step. --timeout SECONDS gives up after that long with status 1 and leaves the server running, as do cancel and Ctrl+C. update --when-idle installs the release before it waits, so the new version is on disk whatever happens next. A server from a release without --when-idle can’t wait: the command says so, and the server keeps running.
cornercase start-server
Section titled “cornercase start-server”Starts the server without opening a window, for a script or a program that drives cornercase on its own. It needs no terminal. If no server runs on the socket, it starts one; then the server restores your saved session once, as the first window would (the same projects, tabs and splits, agents resuming their conversations), or opens the folder you ran it from when there is no session. It returns once the terminals exist:
cornercase start-server # started: restored the session (160×48)cornercase start-server --cols 200 --rows 60 # a size of your owncornercase start-server --json # the answer as an objectcornercase start-server --theme dark.json # colours for the programs in the terminalsUntil a window attaches, the terminals are 160 columns by 48 rows, or what --cols (90 to 1000) and --rows (10 to 500) say; a size out of range exits with status 1 and starts nothing. The first window that attaches takes the size over, as any window does, and gives the terminals its colours, unless --theme FILE (or - for standard input) gave them: JSON with the foreground, the background and the 16 ANSI colours, as cornercase theme takes. Unlike the size, --theme applies even when the server already runs. A program that asked for the colours before they were known keeps the default ones.
Run again, or with a window already attached, it starts and restores nothing, changes no size, and prints already running (window size 120×40) (or start-server size, when no window gave one yet). So it is also how a script learns that the server is ready. --json prints already, restored (a saved session was found), complete (every tab came back), cols, rows, size (window or start-server), boot, version and theme (from and scheme). restored and complete describe only the call that started the server: with already: true they are false and true, so read them from the first call. When some tabs could not be restored, or the server runs another version than the command, it says so on stderr and still exits 0. If no terminal could open at all (the shell cannot start), it exits 1 with the cause; the server keeps running, and a later call says already running.
Agents that resume their conversations are still being typed in when it returns: cornercase status and cornercase wait tell you when they are back. cornercase restart with no window attached leaves no server running: run start-server again.
cornercase kill-server
Section titled “cornercase kill-server”Stops the server: every shell and program in every pane ends, and every attached client exits. It waits for the server to be gone before returning, then prints what it stopped when something was running, such as stopped 1 agent and 2 other programs. If no server is running on the socket, it prints no cornercase server is running.
Run from a terminal inside the server it would stop, it asks first: it lists what stops, says that this terminal closes too, and waits for y. Anything else keeps the server running. Without a terminal (an agent’s tool, a script) it refuses with status 1 unless you pass -y or --yes. To stop another server from inside cornercase, set CORNERCASE_SOCKET to its socket.
cornercase logs
Section titled “cornercase logs”Prints the end of the server’s log, server.log: what the server did, one line per event, as described in Troubleshooting. It reads the file directly, so it works with no server running.
cornercase logs # the last 200 linescornercase logs -n 50 # the last 50 (--lines works too)cornercase logs --follow # then keep printing what the server writes, until Ctrl+C (-f works too)cornercase logs --path # print only where the log isWhen the log is short since it last moved to server.log.1, the lines before come from there. Without a log yet, it says so and exits with status 1.
cornercase account and cornercase profile
Section titled “cornercase account and cornercase profile”Keep several logins of Claude Code, Codex or Gemini CLI and choose which ones new agents start with: account add|list|remove (list --check asks each account whether it is logged in), account use AGENT ACCOUNT|--system (what new tabs use), account rename AGENT ACCOUNT|--system NAME|--clear (a name for the window; the folder stays), profile new|set|use|delete|list (a set of accounts to switch at once, for scripts), --account AGENT=ACCOUNT on start, new-tab, flow run and queue add|edit, and --profile NAME on start, new-tab and flow run. See Accounts and profiles.
cornercase contract
Section titled “cornercase contract”Prints what the running server supports: its version, the version of the contract it speaks, which start of the server it is (boot), and its requests and streams. --json prints it as an object, for programs that talk to cornercase. A server too old to have it says so. See Contract and compatibility.
cornercase plugin
Section titled “cornercase plugin”Installs, adds, lists and turns on and off plugins. It reads and writes plugins.json directly, so it works with no server running, except actions and run, which ask the running server; a running server picks up the change within a second.
cornercase plugin install acme/notes # fetch it, show what it runs, ask, install it turned offcornercase plugin install acme/notes@v1.2 # the same, at a tag, branch or commitcornercase plugin install acme/tools/notes # a plugin in the notes folder of acme/toolscornercase plugin update # fetch installed plugins again; ask before installing a changecornercase plugin remove notes # turn it off, wait for it to stop, delete its copycornercase plugin link ~/code/my-plugin # add the plugin in that folder, turned offcornercase plugin unlink my-plugin # forget it; its folder stayscornercase plugin list # every plugin, on or off, and what it runs (--json for scripts)cornercase plugin actions --context pane # the actions plugins add to the menus (asks the server)cornercase plugin run acme.notes note --pane 5 # run one as its menu entry does, wait, print how it endedcornercase plugin enable my-plugin # turn it on: says what it asks for, then runs itcornercase plugin disable my-plugin # turn it off: its service and window processes stopcornercase plugin logs my-plugin # what its commands printed; -n, --follow and --path as for logsinstall takes owner/repo (GitHub), an https:// git address or a git folder. A plugin in a folder of the repository is owner/repo/folder on GitHub, and address//folder for any other address or a folder on your machine. With no terminal to ask in, install and update need --yes. A plugin whose manifest cannot be read, or whose command leads out of its folder, is listed with the reason, and cannot be turned on. An unknown id exits with status 1.
cornercase --version
Section titled “cornercase --version”Prints the version, such as cornercase 0.1.0, and exits. It doesn’t touch the server.
cornercase server and cornercase proxy
Section titled “cornercase server and cornercase proxy”cornercase proxy is what cornercase remote runs on the other machine; it passes the window’s messages to the server there. cornercase server runs the server itself. You don’t need either: cornercase remote runs the proxy, and cornercase and cornercase start-server start the server in the background for you, with its output going to server.log. They are listed here so you recognise them in your process list.
The socket
Section titled “The socket”The commands find the server through the same socket: CORNERCASE_SOCKET if it is set, otherwise server.sock in $XDG_STATE_HOME/cornercase/ (~/.local/state/cornercase/ without it), next to your session. Set CORNERCASE_SOCKET on every command to work with a separate server:
CORNERCASE_SOCKET=/tmp/cc-demo/server.sock cornercaseCORNERCASE_SOCKET=/tmp/cc-demo/server.sock cornercase kill-servercornercase contract says what the server on it supports, and a program of your own can talk to the socket without cornercase: see Contract and compatibility.
Messages
Section titled “Messages”| Message | Meaning |
|---|---|
cornercase is already running in this terminal; nesting it is not supported |
You ran cornercase inside one of its own panes. Use another terminal. The other commands work in a pane. |
the running cornercase server comes from another build. Run cornercase kill-server (it closes all its terminals) and start cornercase again |
You updated or rebuilt cornercase while the old server kept running, and didn’t restart it. |
the running cornercase server is incompatible with this build. Run cornercase kill-server … |
Same cause, detected while talking to the server. |
this terminal runs inside the cornercase server, so kill-server would stop the server it runs in; pass --yes … |
You ran kill-server without a terminal inside one of the server’s own panes. Pass --yes to stop it anyway, or set CORNERCASE_SOCKET to the other server’s socket. |
failed to start the cornercase server; see <log> |
The server didn’t come up within a few seconds. The log next to the socket says why. |
a cornercase server is already running on <socket> |
Printed by cornercase server when another server holds the socket’s lock. |
the restart was cancelled in the window; the server keeps running |
Someone pressed cancel on the window’s notice while restart --when-idle or update --when-idle waited. |
timed out after …: the agent in pane … has not ended its turn, so the server keeps running |
--when-idle reached its --timeout before every agent stopped working. |
the running cornercase server is too old to wait for its agents … |
The server predates --when-idle. Run cornercase restart once no agent is working. |
this is a development build; `cornercase update` only updates released builds |
You ran update from a build made with cargo run. Pull and build again instead. |
could not reach cornercase on `<host>`: … |
cornercase remote couldn’t connect; the end of the line is what ssh said. |
cornercase was not found on `<host>` … |
The other machine has no cornercase where it looks; install it there, or give its path with --command. |
the cornercase on `<host>` is too old to attach to from another machine … |
The other machine’s cornercase predates cornercase remote. Update it there. |
`<host>` runs cornercase <version> and this machine <version> … |
The two machines run different versions; the message says which one to update. |
error: unrecognized subcommand '…' |
There is no such command; cornercase --help lists them. |
error: unexpected argument '…' found |
The command has no such option; cornercase COMMAND --help lists its options. |
On any of these, cornercase exits with a non-zero status: 2 for the last two, which are mistakes in how it was called, and 1 for the others.