Skip to content

AI Agents

devxian edited this page Nov 30, 2026 · 16 revisions

English | 한국어

AI agents

This page is for people who use Claude Code or Codex in cozzle terminals. It covers how to start an agent, what cozzle adds to it, how to watch subagents, and the permission and usage displays.

When you start Claude Code or Codex in a cozzle terminal, cozzle tells the agent how to use cozzle. The agent then uses the cozzle command to drive the browser tab you are looking at, read other terminals' logs, and open files in editor tabs to show you.

Install Claude Code and Codex and sign in to them yourself. cozzle only starts them.

Start an agent

Run it in a cozzle terminal as usual:

claude
claude "Find what's broken on the login screen"
codex

What cozzle adds

cozzle terminals (when the shell is zsh, bash or sh) define claude and codex shell functions. Only when they start an interactive session, they put the arguments below in front, and keep your own arguments after them.^cli

Tool Added arguments When
Claude Code --append-system-prompt-file <short cozzle note> and --plugin-dir <cozzle plugin> Always. If the plugin folder cannot be written, the full guide instead
Claude Code --permission-mode bypassPermissions Skip permission prompts is on, you typed the command in a terminal (input and output are both the terminal), and you did not choose a permission mode yourself (--permission-mode, --allow-dangerously-skip-permissions, --dangerously-skip-permissions, --cloud, --teleport)
Codex -c developer_instructions=<short cozzle note> Always
Codex --dangerously-bypass-approvals-and-sandbox Skip permission prompts is on, you typed the command in a terminal, and you did not pass that option, --yolo, --full-auto, -s/--sandbox or -a/--ask-for-approval yourself

Subcommands such as claude mcp list, claude update, codex login, --version and --help get nothing. To run the original command without the guide, use command claude or command codex.

The short note (three sentences) says that the cozzle command controls the app, that web pages go through cozzle browser, and to read the cozzle skill or cozzle guide first. Your own --append-system-prompt and --plugin-dir are kept and added to it.

The full guide is a skill. cozzle writes a Claude Code plugin for each cozzle version to ${XDG_DATA_HOME:-~/.local/share}/cozzle/claude-plugin/<version>/ (folders mode 700, files mode 600): the cozzle skill (skills/cozzle/SKILL.md), whose short description is all a session loads until it needs the body, and the agent status hooks (hooks/hooks.json). Your ~/.claude settings are not changed. Inside the skill, read-only commands (cozzle guide, status, tab list, tab read, browser snapshot, text, info, tabs, screenshot, console, network, git status, git log, agents, agent config, settings) and cozzle notify run without a permission prompt. Commands that run commands or scripts, move pages or sign in still follow your permission settings. For Codex, Settings → Agent → Codex skill → Install puts the same skill in ~/.codex/skills/cozzle (or under CODEX_HOME). It changes only a folder that cozzle created, which it marks with a .cozzle-managed file.

The cozzle guide is the same as src/agent_guide.md in the repository. Print it in a terminal with cozzle guide. Its main rules:^agent-guide

  • browser snapshot ends with what to try next: the page's WebMCP tools (pageTools) and a saved login for the site (savedLogin).

  • Check web pages in the cozzle browser tab instead of starting a separate browser.

  • Do not keep adding tabs. Reuse a tab for the same purpose with the same --name.

  • Show what the user needs to see now in the next pane with --split. For things the user does not need to watch, such as logs and builds, only create the tab.

  • Start dev servers and builds in their own terminal with cozzle tab new terminal --name <name> --run <command>, and read the log with tab read.

  • To point at a problem, draw a box and a label on the page and send cozzle notify.

  • Show file locations by opening them with cozzle open <file> --line N instead of writing the path.

  • When a page needs a sign-in, do not ask for the password. Ask the user to sign in in the cozzle browser.

  • Do not close the browser tab the user is looking at or move it to another address.

Subagents

Subagents that Claude Code starts with its Agent (Task) tool, and sub-agents that Codex starts with spawn_agent, appear in the left sidebar, below the terminal tab that started them. Agent team teammates that run in tmux panes appear in the same list.[^subagents]

  • Each row shows the name (the Agent tool's description, the teammate name, or for Codex the agent's nickname, else the first line of its task), the state and the elapsed time. The tooltip shows the type (the Agent tool's agent type or the Codex role).
  • A subagent that another subagent started sits right below its parent, indented one step per level (up to 3). When the parent row is hidden because it finished, the child moves left. The list shows running subagents, those that finished in the last 5 minutes, and those with an open log tab. A subagent started by the tab's running Claude Code process counts as running until it is marked finished, even when its log is quiet for a long time, as with background subagents. A subagent that Claude Code has not written a log for yet (for example one running in its own worktree) still shows, from its description file. A subagent from an earlier process of a resumed session counts as stopped when its log has not changed for more than 10 minutes without a finish mark.
  • A subagent that another subagent started sits right below its parent, indented one step per level (up to 3). When the parent row is hidden because it finished, the child moves left. The list shows only running subagents and the one you are viewing. A subagent started by the tab's running Claude Code process counts as running until it is finished: its description file says so, a SubagentStop hook arrived, or (when the description file has no finish mark) its log ends with a finished reply and every background shell, agent or monitor it started has reported back. A reply that only says the work is still running does not count, and an hour without log changes counts as finished. A subagent that Claude Code has not written a log for yet (for example one running in its own worktree) still shows, from its description file. A subagent from an earlier process of a resumed session counts as stopped when its log has not changed for more than 10 minutes without a finish mark.
  • A Codex sub-agent is running after its log records the start of a turn, done after the end of a turn, and stopped when the turn was interrupted. When it gets more work, it is running again.
  • Click the list header to collapse or expand the list. The header shows the count and how many are running.
  • Click a row to show it in a pane beside its lead's pane. The first one opens to the right of the lead; when another subagent or teammate of the same lead is already in a pane, the next one stacks below it. Clicking a row whose tab is already shown goes to that pane.
  • Right-click a row for View Log, or Close Log Tab when its tab is open.

Subagent view

A subagent runs inside the Claude Code or Codex process and has no terminal of its own. Its view tab shows the transcript the way the Claude Code screen does, in the terminal font and colors:

  • > the request, ⏺ answers and tool calls such as Bash(cargo test), and ⎿ the first 3 lines of each tool result with … +N lines for the rest. Failed results are red.
  • New lines appear as they are written (the visible view rereads the log every 0.4 seconds). The view follows the end of the log only while you are at the bottom. Scroll up to stop following; Jump to bottom resumes it. A long run shows its last 400 steps.
  • The header shows the description (cut with … when long), the agent type, its state and the elapsed time, and a Read-only badge because typing does nothing here; hover it for Read-only · subagents don't take input. You can select and copy text.
  • Until the log has lines, the view shows the description and No activity yet. When the log file does not exist at all, it says No transcript file · it isn't written when session saving is off.
  • When the subagent finishes, the last line shows Done · took and the elapsed time. The tab stays open and the log is no longer reread.
  • Subagent view tabs are not restored when cozzle starts again.
  • The view only reads log files. Closing it does not stop the subagent.

Teammates in cozzle tabs

A cozzle terminal outside a real tmux tells programs that they run in tmux (TMUX=cozzle,…, TMUX_PANE=%<tab>), so Claude Code agent teams (teammateMode auto or tmux) open each teammate as a terminal tab instead of a tmux pane. The tmux in cozzle's command folder handles only the pane commands Claude Code uses (split-window, respawn-pane, send-keys, select-pane -T, kill-pane, display-message, list-panes; layout and color commands succeed without doing anything) and passes everything else, such as tmux or tmux attach that you type, to the real tmux.

  • A teammate tab opens in a pane beside its lead's pane, and later teammates of the same lead stack below it. The pane you type in stays focused. Click the tab to type in it.
  • Teammate tabs are not saved in the session, and closing the lead's tab closes them. Only teammates may be changed or closed this way.
  • Programs that see TMUX wrap notifications, titles and clipboard writes in tmux passthrough; the terminal host unwraps them, so they work as before. 24-bit color stays on (CLAUDE_CODE_TMUX_TRUECOLOR=1). Claude Code does not show inline images in these terminals.

Teammates in tmux panes

With agent teams and teammateMode set to tmux (or auto inside tmux), each teammate is a full Claude Code session in a tmux pane. Clicking such a row opens a terminal tab that runs tmux attach to that pane, so you see and type into the teammate's real terminal.

  • When the lead runs outside tmux, as in a cozzle terminal, Claude Code puts the panes on its own tmux server claude-swarm-<lead pid>. cozzle attaches with tmux -L claude-swarm-<pid> attach-session -t <pane> and selects the pane.
  • When the pane is on your own tmux server, cozzle attaches read-only (-r) so it does not change your tmux session.
  • Detach with tmux's usual key (Ctrl-b d) or close the tab. The teammate keeps running.

cozzle reads subagent logs under <config folder>/projects/<folder>/<session>/subagents/ and teammate panes from <config folder>/teams/session-<first 8 characters of the session id>/config.json. The config folder is CLAUDE_CONFIG_DIR, or ~/.claude when it is not set. The view tab reads only agent-*.jsonl under a subagents folder in <config folder>/projects, or Codex rollout-*.jsonl under <Codex folder>/sessions; paths with .. or links that lead outside those folders are refused.

To find the session of a tab, cozzle uses the session file Claude Code writes for its process, the cozzle hook record, or --resume/--session-id in the command line. A Claude Code process that left none of these (one started before cozzle 0.5.0, for example) gets the session log in its folder that was first written after the process started and before any other Claude Code process started in the same folder, but only when exactly one log matches and no other process uses it. Otherwise the tab shows no subagents rather than another tab's.

For Codex, cozzle finds the tab's session log from the file the Codex process keeps open, then looks in $CODEX_HOME/sessions (default ~/.codex/sessions) for logs whose first line names that session (or one of its sub-agents) as parent_thread_id. Each sub-agent has its own log there.

Agents read the same list with cozzle agents.

View the agent configuration

The Config tab of the Agent section in the right panel shows, for Claude Code or Codex, the rules, skills, subagents, commands, MCP servers and hooks that load in the workspace. Agents read the full list with cozzle agent config and open this tab for you with cozzle panel agent.[^agent-config]

Skip permission prompts

Settings → Agent → Run without permission prompts. It is off by default. If your ~/.config/cozzle/settings.json already says "bypassPermissions": true, that stays.

When it is on, the agent does not ask before each file change or command. For Codex, it also turns off the sandbox. It applies only when you type claude or codex in a terminal: a claude -p or codex exec that an agent runs with its own shell tool, or a command whose input or output is a pipe, keeps its permission prompts and sandbox. cozzle reads the setting each time you start an agent, so a change applies to the next start, also in terminals that are already open. Options that you pass yourself always win. A workspace settings file can only turn this setting off.

Prevent sleep while working

Settings → Agent → Prevent sleep while agents work. It is on by default.

While Claude Code or Codex is working in a cozzle terminal, the screen does not turn off and the computer does not sleep. An agent that waits for your answer is not working. It ends 30 seconds after the last agent stops working, or right away when you turn the setting off.

If you quit with Keep Running in Background (see Terminal), the terminal host takes over: while no cozzle app is attached and an agent is working, it runs caffeinate -i -w <host pid> (the system stays awake, the screen may turn off). macOS only.

Operating system Method
macOS caffeinate -dims
Linux systemd-inhibit --what=idle:sleep
Windows Not supported yet

Get notified when work is done

When an agent runs cozzle notify "title" "body", the notification goes to the cozzle list and also appears as an operating system notification. The agent guide tells agents to use it only for finished work and requests for confirmation, not for every progress step, and to write the title and body in the language you use with them (or the cozzle UI language from cozzle settings get language). English notifications that Claude Code and Codex send themselves are shown in the cozzle UI language when cozzle knows the text. To turn it off, see Notifications.[^notify]

Answer permissions and questions from cozzle

When Claude Code asks for a permission, a question (AskUserQuestion) or a plan approval, cozzle gets it at once from a PermissionRequest hook, about 6 seconds before Claude Code's own notification, and shows a card at the bottom right while you are not looking at that terminal. It shows the tool and the command or file, or each question with its options; more requests wait behind it, oldest first, and are also listed in Needs You at the top of Notifications. The operating system notification has Allow and Deny buttons.^cli

  • Allow, Allow for Session (when Claude Code offers a rule), Deny, or an option of a single-choice question. cozzle answers by typing in that terminal, one key every 0.15 seconds: 1, 2, Esc, or the option number. Claude Code ignores a hook's answer while its own prompt is shown. Questions with several parts or multiple choice, options without a number (10 or more) and a request behind an older prompt in the same terminal show Answer in Terminal instead.
  • Subagents running in the background ask only through the hook; there is no prompt in the terminal and keys would land in your input box. cozzle answers those through the hook, and shows their card even while you look at the tab.
  • If you answer in the terminal, Claude Code ends the hook and the card goes away. The hook waits up to 20 seconds at a time and asks again with the same request; a card that is not asked again within 8 seconds goes away. Between those, the buttons are off and the card says Answer in the terminal, since the prompt may have changed; they come back when the hook asks again. cozzle also types nothing when Claude Code has reported (OSC 7501) that it is no longer waiting. The notification buttons follow the same checks.
  • When cozzle is not running, is an older version or the input is not understood, the hook prints nothing and exits 0, so Claude Code asks as usual. It does nothing for claude -p and the SDK.

See agent status in the sidebar

Each sidebar tab row where Claude Code or Codex runs shows the Git branch of that terminal's working folder, such as main. A worktree shows its own branch. A detached HEAD shows the first 7 characters of the commit. Point at it to see the full text in a tooltip.[^agent-state]

The row also shows what the agent is doing:

Badge Meaning
Blue Working with a pulsing dot The agent is working. With reduce motion on, the dot stays still
Yellow Needs Input The agent waits for you, for example for a permission. The tooltip shows what it asks, in the cozzle UI language when cozzle knows the text. When it asks for a permission or an answer, cozzle also sends a notification after 1.5 seconds, unless a card already announced it. An idle prompt after a finished turn is not a wait. Until you look at the tab, its sidebar row, its tab and the pane that shows it get a yellow border. Claude Code, and other agents that send a notification or ring the bell
Green Done with a check The agent finished while you looked at another tab. It goes away when you open the tab

Claude Code 2.1.295 and later report their state with a terminal sequence (OSC 7501) to terminals that answer its query. The cozzle terminal host answers it, so this state comes first when it is there. Otherwise cozzle uses hooks: the cozzle plugin (or, when the plugin cannot be written, the same --settings that sets the status line) adds a cozzle-cli agent-hook hook for UserPromptSubmit, PreToolUse, PostToolUse, Notification, Stop, SessionStart, SessionEnd, SubagentStop and PermissionRequest. Claude Code runs these together with your own hooks. Except for answers to permission requests from a background subagent, the hook prints nothing and always succeeds, so it never changes what Claude Code does. The hook state comes before <config folder>/sessions/<pid>.json, which stays busy while teammates are alive, with two exceptions: a turn stopped with Esc sends no hook, so a session file that turns idle ends it (cozzle also checks whether the last turn in the session log is an interruption), and a session file that turns busy after a question means you answered in the terminal. shell in the session file (only background commands left) counts as idle. A SessionStart after a compaction keeps the current state. The status is checked every 2 seconds.^cli

When neither is there, for example a Claude Code started before cozzle 0.5.0 or with --resume outside cozzle, and for Codex, cozzle watches the terminal output instead. An agent redraws its screen many times a second while it works and is quiet at the prompt, so the tab shows Working after output in two checks in a row and goes back after 3 seconds of quiet. Output within 0.3 seconds after you type, resize or focus the terminal does not count. When a hook says Claude Code is idle but output keeps coming for more than 5 seconds, the tab shows Working, in case a hook was missed. Needs Input comes only from Claude Code's own state, or from another agent's own notification or bell.

Usage and context display

The status bar shows this only while an agent runs in a cozzle terminal. It refreshes every 15 seconds.[^usage]

● Claude  Opus 5.5 medium ⚡   5h 77% [■■■■□]   Weekly 93% [■■■■■]   Context 50% [■■■□□]

Each limit and the context get a short name and a small battery with the percent inside it. The Usage gauge setting chooses what the battery shows: Remaining (the default) fills by the part left, and Used fills by the part used. The fill color always follows the part left: green, orange at 20% or less left, red at 10% or less left. Hold the pointer on one to see its full name, the percent with the shown mode (5h 40% left or 5h 60% used) and when it resets, such as Resets in 3h 12m. The fill moves to a new value in 200 ms, or at once when the system reduce motion setting is on.

Claude shows every limit the status line has: 5-hour, weekly, a weekly limit per model (seven_day_opus becomes Opus weekly), and extra usage (spend_limit, shown as Extra usage $used/$limit). Model keys cozzle does not know are left out. When no limits could be read, for example with an API key, an older Claude Code, claude -p or your own --settings, the bar shows Limits n/a instead of a 0% battery. Some models, such as Fable, have a weekly limit that the status line does not include yet. cozzle then shows only the model name, and its tooltip says to check the limit with /usage in Claude Code.

Item Source
Model The Claude Code status line (see below): its model name, effort level and ⚡ for fast mode. If it is missing or older than the log, the model ID from the latest session log in that terminal's working folder
Remaining context The Claude Code status line. Otherwise, the token count of the last response in the same log. For Claude, the window is taken as 200K, or 1M when the model name contains [1m] or the count is over 200K (an estimate)
Claude limits The newest Claude Code status line saved in the last 5 minutes, from any session (rate_limits). An idle session's file is older, because it does not know what other sessions used. Without one, Limits n/a
Codex limits The rate_limits values (primary, secondary) in the Codex session log, with their reset times

For Claude Code, cozzle starts claude with --settings that sets its status line command to cozzle-cli statusline. That command saves the status line JSON of each session to ${XDG_STATE_HOME:-~/.local/state}/cozzle/agents/, then runs your own status line command, if you set one, and shows its output. cozzle reads no sign-in token and sends no request for usage.^cli

When the same tool runs in several terminals, the tab you are viewing comes first. What the status line files hold and which status line command runs is in Security and privacy.

Continue a session

  • When cozzle restarts: cozzle saves the session IDs that were running in terminals and continues them in the same tab with claude --resume <id> or codex resume <id>. See Session restore.
  • Other agents: see Other terminal agents.
  • To pick an earlier session: in the Sessions tab of the Agent section, right-click → Resume this session.

From the file editor

Fix with Agent on a problem and Ask Agent on a selection send code to the session running in this workspace, or to a one-off read-only run when none runs. See File editor.

Other terminal agents

cozzle also recognizes these agents when you run them in a cozzle terminal. You install and sign in to them yourself.[^agent-cli]

Every agent below gets:

  • Tab: its name and icon on the tab, and Working while it writes output (see See agent status in the sidebar).
  • Needs Input and the yellow border when the agent itself asks for you: a terminal notification (OSC 9 or OSC 777) or the terminal bell. The tab keeps it until you type in that tab. A notification goes to the list and, for tabs you are not looking at, to the system. Without such a signal cozzle shows nothing rather than guess; it never marks these agents Done from quiet output.
  • Prevent sleep while working while it shows Working.
Agent Command Attention signal cozzle note Skip permission prompts Restored with
Gemini CLI gemini Notifications after you turn on general.enableNotifications in its settings Settings → Agent → Gemini CLI extension --approval-mode=yolo gemini --resume latest
GitHub Copilot CLI copilot Notifications after you turn on terminalNotifications — --allow-all copilot --continue
Qwen Code qwen Bell (general.terminalBell, on by default) --append-system-prompt <short note> --approval-mode=yolo qwen --continue
Goose goose Bell (cozzle sets GOOSE_CLI_BELL=true) GOOSE_MOIM_MESSAGE_FILE=<short note file> — (autonomous by default) goose session -r
Amp amp Bell (cozzle sets AMP_FORCE_BEL=1) — — (no prompts by default) —
Cursor CLI cursor-agent Notifications after you turn on notifications in ~/.cursor/cli-config.json — --force cursor-agent resume
Kiro CLI kiro-cli Notifications after you set chat.enableNotifications (bel or osc9) — — kiro-cli chat --resume
Aider aider Output only — --yes-always aider --restore-chat-history
Crush crush Output only, unless you set option notifications osc or bell — --yolo —
OpenCode opencode Output only — — opencode --continue
  • Command: cozzle recognizes the program by this name, or by the script an interpreter (node, python, a shell) runs, so npm installs count too. The same word in another command's arguments does not. Cursor's shorter agent command is too common a name to recognize.
  • cozzle note and Skip permission prompts: cozzle wraps a command in a shell function like claude only when it adds something in this table, and adds the flag only to an interactive start (no subcommand or prompt first) that does not choose a permission mode itself. A variable you already set wins. command <name> runs the original.
  • Gemini CLI extension: Gemini CLI reads only a system prompt that replaces its own, or files in its user folder, so cozzle does not pass anything at launch. Install writes ~/.gemini/extensions/cozzle/ (gemini-extension.json, GEMINI.md with the short note that applies only when COZZLE_ADDR is set, and a .cozzle-managed mark). Remove deletes only those files, and a folder that cozzle did not create is never changed.
  • Restored with: when cozzle restarts without the terminal host, it types this documented command in the same tab. These continue the latest session for that folder or repository, not a session ID, so two tabs of the same agent in one folder both open the latest one.
  • Not used: agents' own hooks, plugin folders and user instruction files (AGENTS.md and the like), because using them means writing into your global configuration or repository.

Things to ask an agent

Open localhost:3000 at mobile size and draw a box where the buttons overlap.
Start the dev server in a new terminal tab. If it fails, read the log and fix it.
Open the place you just changed in an editor tab.

[^subagents]: src/subagents.rs, src/subagent_view.rs [^agent-config]: src/agent_config.rs [^notify]: src/notify.rs [^usage]: src/usage.rs [^agent-cli]: src/agent_cli.rs, src/agent_skill.rs [^agent-state]: src/agent_state.rs, src/workspace.rs, src/app.rs

Clone this wiki locally