OSC 26 is Otty's proposed Terminal Agent Protocol, or TAP. It is an OSC escape sequence that gives terminal-based coding agents a small structured channel for live metadata.
The goal is simple: instead of a terminal guessing what a code agent is doing by scraping process names, private files, or screen text, the agent can announce its own state.
Short form
OSC 26 ; CodeAgent=claude ; Status=running ; TaskProgress=1/4 ST
In raw bytes, OSC is ESC ] and ST is either ESC \ or BEL.
What OSC 26 can carry
| Field | Meaning |
|---|---|
CodeAgent | The agent kind, such as claude, codex, opencode, or aider. |
SessionId | The agent session identifier. |
SessionTitle | A title hint for the terminal tab or pane. |
ProjectFolder | The project root for this agent session. |
Status | A closed state such as idle, running, awaiting-approval, awaiting-input, error, or finished. |
Detail | An open display detail such as thinking, before-tool-call, or edit-file. |
TaskList | Newline-separated task labels. |
TaskProgress | A literal fraction like 1/4. |
MethodResume | A declarative hint for how to resume the session. |
MethodFork | A declarative hint for how to fork or branch the session. |
Values that may contain spaces, semicolons, equals signs, or non-ASCII text are base64-encoded UTF-8. Stable tokens such as status enums can be sent literally.
Why code agents need it
Agent CLIs run inside ordinary terminal panes, but their useful state is not ordinary terminal text. A terminal wants to know whether an agent is thinking, waiting for approval, done, blocked, resumable, or forkable. Without a protocol, the terminal has to infer that state from fragile heuristics.
OSC 26 turns that into declarative terminal metadata. The agent emits a state update, and the terminal can render badges, notifications, task progress, session grouping, resume, and fork actions.
Relationship to OSC 88
OSC 26 is about live agent state. OSC 88, the Terminal Resume Protocol, is about cold-restart recovery.
An agent can use both. OSC 26 says who the agent is and what it is doing now. OSC 88 says how the terminal can relaunch the program after a restart.
Status
OSC 26 is a proposal, not a ratified terminal standard. Otty ships the reference implementation and documents the wire format so other terminals and agent CLIs can implement the same behavior.