Skip to content

Files and environment

File What it holds Default location
cornercase The program itself. An update from the app replaces it in place. ~/.local/bin/ with the install script; Homebrew’s or Cargo’s bin folder otherwise
config.json Your settings. ~/.config/cornercase/
flows/ Your flows, one TOML file each. A project’s flows are in .cornercase/flows/ in its repository. Next to config.json
secrets.json GitLab, Shortcut, Linear, Jira, Plane and Asana tokens and the Telegram and Discord bots’ tokens, typed in the app. Readable only by you (mode 0600); removed when its last token is. Next to config.json
browsers.json The browsers paired to open cornercase from your phone: a hash of each one’s secret, never the secret. Readable only by you (mode 0600). Next to config.json
telegram.json The Telegram bot’s name and the chat paired with it. Readable only by you (mode 0600). Next to config.json
discord.json The Discord bot’s name and the direct message paired with it. Readable only by you (mode 0600). Next to config.json
plugins.json The plugins you installed or linked, where each came from and whether each is on. Readable only by you (mode 0600). Next to config.json
plugins/config/<id>/ A plugin’s own settings folder, given to it as CORNERCASE_PLUGIN_CONFIG. Private to you (mode 0700). Next to config.json
session.json The saved session: groups, projects, workspaces, tabs, splits, widths, the changes panel. ~/.local/state/cornercase/
session.json.bak The session as it was before a restore that left some tabs out, because their shells couldn’t start. The copy before that, if any, is moved to session.json.bak.1. Next to session.json
issues.json The last issue lists, so the browser opens instantly. Titles and metadata only, never tokens; at most 50 lists. Next to session.json
stats.json Local counts of agent work, hourly buckets for 26 weeks and a day, and lifetime totals per agent. Compact versioned JSON, readable only by its owner (0600). Next to session.json
star.json The days counted for the star prompt, when it last asked and your answer. Nothing else. Next to session.json
runs/ The folders of flow runs, one per run, removed with their workspace. Readable only by you (0700). Next to session.json
accounts/<agent>/<name>/ The folders of your agent accounts, each with the agent’s login and links to the settings of its usual folder. Private to you (0700). Next to session.json
queue.json The agent queue, including its history and persistent ids. Next to session.json
todos.json Your TODO list. Next to session.json
server.log What the server did, one line per event: windows attaching, commands run and their answers, tabs opened and closed, agents starting and changing status, background jobs and how long they took, errors and the bugs it hit. Never what you type, paste or see in a pane, nor tokens. Readable only by you (mode 0600). cornercase logs prints it; see Troubleshooting. Next to session.json
server.log.1 The previous log: past 8 MiB, server.log is moved here and starts over, so the two never take more than 16 MiB. Next to session.json
plugins/installed/<id>/<commit>/ An installed plugin’s files, one folder per version. Private to you (mode 0700). Next to session.json
plugins/state/<id>/ A plugin’s data folder, given to it as CORNERCASE_PLUGIN_STATE, and its log, plugin.log (0600), moved to plugin.log.1 past 1 MiB. Private to you (mode 0700). Next to session.json
server.sock The Unix socket clients use to reach the server. It sits next to session.json, so every login (an SSH session, cron, a terminal) reaches the same server. cornercase makes its folder private to you (mode 0700), and refuses an existing folder that another user owns or that is a symbolic link. $XDG_STATE_HOME/cornercase/
server.lock Makes sure only one server runs per session. Next to the socket

Stats contains only numbers and counting times: no prompts, replies, models, projects, paths or conversation ids. It is saved at most once a minute while changed, and flushed on shutdown and before a restart. Deleting stats.json with the server stopped starts counting again; a running server keeps its copy in memory.

The folders follow the XDG base directory variables: config.json goes in $XDG_CONFIG_HOME/cornercase/ when it is set, and session.json, runs/, issues.json, todos.json, queue.json, stats.json, star.json, server.log, server.sock and server.lock in $XDG_STATE_HOME/cornercase/. Without XDG_STATE_HOME they go in ~/.local/state/cornercase/. Set it where every shell reads it, not only in an interactive rc file, or an SSH session without it looks for another server.

Versions before 0.12.140 kept the socket in $XDG_RUNTIME_DIR/cornercase/ or $TMPDIR/cornercase-<uid>/. cornercase still looks there for a server started by such a version, so an update doesn’t hide it; restart it as after any update.

When CORNERCASE_SOCKET is set, everything moves next to that socket, so a separate server never touches your usual files. With CORNERCASE_SOCKET=/tmp/cc-demo/server.sock:

File Location
Socket, lock and log /tmp/cc-demo/server.sock, server.lock, server.log
Settings and tokens /tmp/cc-demo/config.json, secrets.json
Your flows /tmp/cc-demo/flows/
Paired browsers /tmp/cc-demo/browsers.json
Telegram bot and chat /tmp/cc-demo/telegram.json
Discord bot and chat /tmp/cc-demo/discord.json
Session /tmp/cc-demo/server.json
Issue cache /tmp/cc-demo/issues.json
Agent queue /tmp/cc-demo/server.queue.json
Flow run folders /tmp/cc-demo/server.runs/
Agent accounts /tmp/cc-demo/server.accounts/
TODO list /tmp/cc-demo/todos.json
Agent stats /tmp/cc-demo/stats.json
Plugins /tmp/cc-demo/plugins.json, plugins/config/<id>/, plugins/state/<id>/, plugins/installed/<id>/

A build from source (cargo run) keeps to folders of its own, one set per source tree, so it never touches your installed cornercase:

File Location
Session, log, stats, TODOs, queue and the rest of the state $XDG_STATE_HOME/cornercase-dev/<key>/ (else ~/.local/state/cornercase-dev/<key>/), with a source file naming the tree
Socket and lock Next to the session, in the same cornercase-dev/<key>/ folder
Settings, tokens, flows, plugins $XDG_CONFIG_HOME/cornercase-dev/, shared by every tree

<key> is the first 8 hex digits of the SHA-256 of the source tree’s path. CORNERCASE_SOCKET still moves everything next to the socket you give.

  • Worktrees that cornercase creates go in ~/.cornercase/worktrees/<repository>/<branch>, or in the folder set in settings. They are ordinary git worktrees: git worktree list shows them.
  • While it updates, cornercase unpacks the download in a hidden .cornercase-update-<pid> folder next to its binary, and removes it when done.
  • cornercase reads, and never writes, the files Claude Code keeps for its running sessions in ~/.claude/sessions/ (or $CLAUDE_CONFIG_DIR/sessions/), to show what an agent is doing. To show how full its context is, it also reads the end of each session’s transcript in ~/.claude/projects/ (further back for read --last-message, up to 64 MiB), and Claude’s settings: ~/.claude/settings.json, and .claude/settings.json and .claude/settings.local.json in the folder where Claude started.
  • Gemini CLI status comes from its dynamic terminal title. Its prompts, replies and context come from <GEMINI_CLI_HOME or HOME>/.gemini/tmp/<project>/chats/*.jsonl, using projects.json to find the project slug and .project_root to check its folder. Only one Gemini with that home may run in that folder for conversation data to be shown. These files are only read; credentials are never read.
  • For Codex’s model and context use, and its last message for read --last-message, cornercase reads the rollout JSONL held open by each running Codex process under its $CODEX_HOME/sessions/ or ~/.codex/sessions/. It follows npm wrapper children and reads the home from that agent’s environment, so concurrent sessions are associated by process rather than folder. When Codex’s background app-server holds the rollouts instead (its pid is in app-server-daemon/daemon.pid), cornercase takes the one whose session folder is the agent’s, if only one Codex runs there. It never writes these files or reads Codex credentials.
  • For opencode, cornercase reads the SQLite database each running opencode holds open, ~/.local/share/opencode/opencode.db by default, to show what it is doing, its model and its context use (and its last message, for read --last-message), and the list of models opencode caches in ~/.cache/opencode/models.json for each model’s name and context window. It opens the database read only, never writes either file, and never reads opencode’s credentials.
  • For Grok Build, cornercase reads $GROK_HOME (or ~/.grok): active_sessions.json, then sessions/<encoded cwd>/<id>/ (events.jsonl, updates.jsonl, chat_history.jsonl, summary.json and signals.json). A directory name that does not decode is accepted when its .cwd file, or summary.json’s info.cwd, is the pane’s folder. These files are only read. auth.json is never read.
  • For Cursor CLI, cornercase reads the chat store each running Cursor holds open, <CURSOR_CONFIG_DIR, or $XDG_CONFIG_HOME/cursor, or ~/.cursor>/chats/<hash of the folder>/<chat id>/store.db (SQLite, opened read only), and that chat’s transcript, <CURSOR_DATA_DIR or ~/.cursor>/projects/<folder>/agent-transcripts/<chat id>/<chat id>.jsonl, to show its model, context use, status, prompts and last message. It never writes them and never reads Cursor’s login.
  • For GitHub Copilot CLI, cornercase reads $COPILOT_HOME (or ~/.copilot): the session-state/<id>/events.jsonl of the session whose inuse.<pid>.hold file the running Copilot holds open, and open-sessions-state.json. It never reads config.json there.
  • Inside your projects, cornercase only changes what you ask for: the worktrees you create (which git records in the repository’s .git folder), the files .worktreeinclude copies into them, and the flows you save for the project in .cornercase/flows/.
Variable Used for
CORNERCASE_SOCKET Use another socket, which means another, independent server; its files live next to it. Keep the path short: Unix sockets allow about 100 bytes. cornercase doesn’t add it to panes, except a debug build’s own server: a pane has it only when the server was started with it.
SHELL The shell started in every pane. Without it, /bin/sh.
CORNERCASE_LOG How much the server writes to server.log: info (the default), debug for every event it handles, every git run and slow frames, or warn / error for less. Read when the server starts.
CORNERCASE_IMAGES Which protocol the files panel draws images with in this window: kitty, iterm, sixel, or off for none. Without it, cornercase picks one from your terminal’s name. Read by each cornercase window when it starts, not by the server, so two windows can use different values.
GITLAB_TOKEN GitLab personal access token, used with the server of your GitLab settings (gitlab.com unless set). Takes precedence over a saved one.
SHORTCUT_API_TOKEN Shortcut token. Takes precedence over a saved one.
LINEAR_API_KEY Linear API key. Takes precedence over a saved one.
JIRA_API_TOKEN Jira API token, sent with the email of your Jira settings. Takes precedence over a saved one.
PLANE_API_KEY Plane API key, used with the workspace of your Plane settings. Takes precedence over a saved one.
ASANA_ACCESS_TOKEN Asana personal access token, used with the workspace of your Asana settings (or your only one). Takes precedence over a saved one.
HOME Expands ~ in paths, and is the base of the default folders.
CLAUDE_CONFIG_DIR Where Claude Code keeps its files; cornercase reads its running sessions from sessions/ in it, their transcripts from projects/ and its settings.json. Without it, ~/.claude. The claude that the usage dialog and cornercase usage run gets it too.
GEMINI_CLI_HOME Gemini CLI’s home override; cornercase reads .gemini/projects.json and main session JSONL under .gemini/tmp in it. Without it, the running agent’s HOME/.gemini.
CODEX_HOME Where each running Codex keeps its files; cornercase reads that process’s open rollout in sessions/ to show its model and context use. Without it, the agent’s HOME/.codex. The codex that the usage dialog and cornercase usage run gets the server’s.
XDG_CACHE_HOME, OPENCODE_MODELS_PATH, OPENCODE_DB Read from each running opencode: where its list of models is ($XDG_CACHE_HOME/opencode/models.json, or OPENCODE_MODELS_PATH), and the name of its database when OPENCODE_DB sets one. Without them, ~/.cache and the database it has open whose name starts with opencode.
GROK_HOME Where each running Grok Build keeps its sessions. Without it, that process’s HOME/.grok.
COPILOT_HOME Where each running GitHub Copilot CLI keeps its sessions. Without it, that process’s HOME/.copilot.
CURSOR_DATA_DIR Where each running Cursor CLI keeps its transcripts (projects/<folder>/agent-transcripts); cornercase reads it from that process. Without it, HOME/.cursor. The chat store itself is found through the file the process holds open.
TERM_PROGRAM, LC_TERMINAL, TERM, KITTY_WINDOW_ID, KONSOLE_VERSION Recognising your terminal when it doesn’t say its name, to send it desktop notifications and images it understands.
TERM_PROGRAM_VERSION, GHOSTTY_RESOURCES_DIR, VTE_VERSION, PTYXIS_VERSION, ALACRITTY_WINDOW_ID, XTERM_VERSION, TERMINAL_EMULATOR, INSIDE_EMACS More hints about your terminal, for images, when it doesn’t say its name: its version, a terminal built on VTE, JetBrains’ terminal, Emacs’ vterm.
TMUX, TMUX_PANE, STY, ZELLIJ Inside tmux, screen or Zellij, desktop notifications are a bell, and images take the way the multiplexer lets through; inside tmux on the same machine, cornercase asks tmux whether it passes images through.
XDG_CONFIG_HOME Folder for config.json and secrets.json.
XDG_STATE_HOME Folder for session.json, issues.json, todos.json, the socket, the lock and the log.
XDG_RUNTIME_DIR, TMPDIR Only to find a server started by a version before 0.12.140.
CORNERCASE_RELEASES_URL Where the update check asks for the latest release. Meant for testing; the default is https://api.github.com/repos/usecornercase/cornercase-terminal/releases/latest.
CORNERCASE_SHORTCUT_API, CORNERCASE_LINEAR_API, CORNERCASE_JIRA_API, CORNERCASE_PLANE_API, CORNERCASE_ASANA_API Base URL of the Shortcut REST API, of the Linear GraphQL API, of the Jira REST API, of the Plane REST API and of the Asana REST API. Meant for testing; the defaults are https://api.app.shortcut.com/api/v3, https://api.linear.app/graphql, https://<your Jira site> and https://api.plane.so (or your Plane URL, when set) and https://app.asana.com/api/1.0.

To work out the size of Claude’s context window, cornercase reads these from the environment of each running claude, and from the env in its settings, which take precedence. See How full the context is.

Variable Used for
ANTHROPIC_MODEL The model Claude was started with, when --model isn’t given; [1m] at its end means a 1M window.
CLAUDE_CODE_DISABLE_1M_CONTEXT A 200k window even for models that have 1M.
CLAUDE_CODE_MAX_CONTEXT_TOKENS, DISABLE_COMPACT The window of a model Claude Code doesn’t know, or of any model while compacting is turned off.
Variable Value
CORNERCASE_ROOT The project folder
CORNERCASE_WORKTREE The worktree being set up or removed
CORNERCASE_BRANCH Its branch

They are set only for the project’s setup and teardown commands, not for your shell. While a setup runs, a short-lived setup-<pane>.status file is kept next to the socket.

Variable Value Why
TERM xterm-256color Tells programs what the emulator supports.
CORNERCASE 1 Lets scripts know they run inside cornercase, and stops cornercase from opening its window inside itself.
CORNERCASE_PANE The pane’s id Tells the commands for scripts and agents which pane they run in.
CORNERCASE_SERVER A token of the server Lets a server tell its own panes from another server’s, which have the same ids.
CORNERCASE_RUN_DIR The run’s folder Only in the panes of a flow run: where the team keeps its files.
CLAUDE_CONFIG_DIR, CODEX_HOME, GEMINI_CLI_HOME An account’s folder Only for the agents that start with an account in that pane (the one in use, a profile’s, or one picked for that start); without one the server’s value passes through. A pane with a Claude Code account also loses CLAUDE_SECURESTORAGE_CONFIG_DIR, which would point Claude Code at another login.
Variable Why
CLAUDECODE, CLAUDE_CODE_CHILD_SESSION, CLAUDE_CODE_SESSION_ID, CLAUDE_CODE_MESSAGING_SOCKET, CLAUDE_CODE_MESSAGING_TOKEN, CLAUDE_CODE_ENTRYPOINT, CLAUDE_CODE_SESSION_ATTENDED, CLAUDE_CODE_EXECPATH, CLAUDE_PID, CLAUDE_EFFORT Claude Code sets these for the session it runs in. When cornercase is started from inside Claude Code, the server would pass them to every pane: a claude started there would think it is a child of that other session (a child session does not save its prompt history, for instance), and every program in the pane could read that session’s messaging token. A pane is never part of the session that started the server, and neither is the claude that the usage dialog runs.
COPILOT_CLI, COPILOT_AGENT_SESSION_ID, COPILOT_LOADER_PID, COPILOT_SUPERVISED, COPILOT_CLI_RESOLVED_DIST_DIR, COPILOT_CLI_BINARY_VERSION GitHub Copilot CLI sets these for the session it runs in. A copilot started in a pane would otherwise think it runs under that session’s loader, share its login tokens and run another package.

Only these are removed. Claude Code settings such as CLAUDE_CONFIG_DIR, CLAUDE_CODE_USE_BEDROCK or CLAUDE_CODE_MAX_OUTPUT_TOKENS pass through. COPILOT_HOME and COPILOT_MODEL pass through, and so do GROK_HOME, GROK_SESSION_ID and GROK_AGENT: Grok Build 1.0.52’s own window does not join a session from those inherited variables, so stripping them would hide a home you set on purpose. Apart from the variables above, a pane’s shell inherits the server’s environment.

cornercase runs gh with GH_PROMPT_DISABLED=1, GH_NO_UPDATE_NOTIFIER=1, NO_COLOR=1 and GH_PAGER=cat, so that it never waits for input or prints colours. Your own gh configuration and login are used as they are.