CLI Code
English · Tiếng Việt · 中文 · 日本語
📖 User Guide · Hướng dẫn sử dụng · Changelog
The agent terminal for VS Code. Claude Code, Codex, Copilot, opencode, Pi, Grok, Droid and 21 more coding agents, each in a tab that understands the agent: it shows what the agent is doing, opens what it mentions, keeps the session through reloads and quitting VS Code, and restarts back into the same conversation.

Open it in one click
After installing, click the CLI Code icon in the editor title bar, or the CLI Code button on the right of the status bar, next to the bell. Cmd/Ctrl + Esc opens it too.

Why
Every serious coding agent ships as a terminal program. Running it in a plain terminal tab means the tab is blind: it can't tell you the agent is waiting for approval, it doesn't know which file the agent just edited, a reload or quitting VS Code kills it, and a restart forgets the conversation.
CLI Code replaces that tab with an interface built for agents — its own webview terminal with an action bar, live state, clickable output and notices — while the agent itself runs untouched: same CLI, same shell, same MCP servers and plugins.
What you get
Tabs that know the agent's state. The tab renames itself after the task you gave and carries a mark: ⟳ working, ? waiting for you, ● finished while you were on another tab. An agent that needs you on a hidden tab sends a notification with an Open tab button. The action bar above the terminal shows the model in use.
An interface around the agent, not a bare terminal. Above the terminal sits a quiet action bar in Claude's visual language: New Session (with the agent picker), Resume, Restart, Find, and a … menu (Rename, Copy Context, Quick Command). Its left side shows the tab's name (double-click it to rename the tab in place), the model in use, a status line while the agent waits on you, and a "… changed — restart to apply" notice when the running agent is older than its configuration. Hovering a link shows what it opens; find has match-case and regex; an overlay with a Restart button appears when the agent exits, a session ended page when its process is gone. Fonts and colours follow your VS Code theme; an optional chat-style composer can sit under the terminal.
Everything the agent prints is clickable. File paths open in the editor at the exact line and column (a file that is already open comes to front in its own tab instead of opening twice), folders reveal in the Explorer (or Finder/Explorer when outside the workspace), URLs open in the browser, Markdown opens in the preview. Only paths that really exist are underlined. A plain click selects the whole link so Cmd/Ctrl + C copies it; selection and copy keep working even while Claude Code is capturing the mouse.
See the whole prompt before you send it. Agents fold what you paste into [Pasted text [#1](https://github.com/x302502/cli-code/issues/1) +8 lines] or [Image [#1](https://github.com/x302502/cli-code/issues/1)]. While your draft holds a paste or an image, or runs to 3 lines or 200 characters, a Full prompt box floats right above the agent's input and shows all of it in order — typed text, every paste in full, image thumbnails (click one to open it in an editor tab) — and follows your edits as you type. Copy all copies it; ✕ hides it until the next paste; it closes when you send, and comes back after a reload with the draft still in the input. The agent itself is untouched: Cmd + V of a screenshot or Ctrl + V reaches it as in any terminal (thumbnails need macOS).
Sessions that survive. Agents run under a background daemon, so Reload Window re-attaches every tab with its scrollback, title and state — and so does quitting VS Code and reopening the folder later: the agents keep running meanwhile. If an agent did not survive (the machine restarted), its tab starts it again by itself, back in the same conversation, and says Session restored. Tabs a crashed VS Code forgot to save come back too. When you do need a fresh process — a new MCP server, a plugin, an update — Restart Session brings 19 of the 28 agents back into the exact conversation, and tabs whose configuration changed restart themselves when idle.
One shortcut, your real shell. Cmd/Ctrl + Esc opens any of 28 agents beside your editor, in your project folder, inside your interactive login shell — PATH, nvm, pnpm, MCP servers, all exactly as in a terminal. Cmd/Ctrl + Alt + K drops the file you are looking at into the prompt as @src/app.ts#L10-20.
And the small things. Resume past sessions, quick commands (from settings or saved from a selection), copy the last 200 lines as context, in-terminal find, per-tab zoom, Shift + Enter for newlines, a context-aware right-click menu, coloured agent icons.
How it knows: CLI Code installs a small status hook into each agent's own configuration (Claude Code, Codex, Copilot, Droid, Grok, opencode, Kilo, MiMo, Pi, OMP). It runs one shell line that does nothing outside CLI Code, your files are backed up first, and one setting removes everything. Details in the User Guide.
How it works
CLI Code does not use VS Code's integrated terminal. Each agent opens in a webview panel of the extension's own — an editor tab that renders a terminal (xterm.js) and, around it, the action bar, state marks, link tooltips, search bar and notices. The agent process itself runs in a background daemon that belongs to the VS Code window, which is why Reload Window or quitting VS Code re-attaches instead of killing it.
What that means for you:
- The tab behaves like an editor tab: drag it to any column, split it, pin it, keep several per agent. It does not appear in the Terminal panel.
- VS Code's
terminal.* settings and terminal shortcuts do not apply; CLI Code uses your editor.fontFamily / editor.fontSize, your colour theme, and its own shortcuts (below), which are active only while a CLI Code tab is focused.
- The agent runs unchanged, in your interactive login shell, with your real
PATH, MCP servers and plugins.
Quick start
- Install from the Marketplace (
Cmd/Ctrl + Shift + X → CLI Code). VS Code 1.101+, macOS or Linux for the full feature set.
- Install and sign in to the agents you use, in a normal terminal (
claude, codex, copilot, opencode…). CLI Code launches them; it doesn't install them. If a command works in your terminal, it works here.
- Press
Cmd/Ctrl + Esc (or click CLI Code in the status bar), pick an agent, start typing. Press Cmd/Ctrl + Alt + K in the editor to hand it the current file.
⚠️ Agents are launched with their approval prompts disabled (claude --dangerously-skip-permissions, codex --dangerously-bypass-approvals-and-sandbox, copilot --yolo, …) so they can work without interruption. They will edit files and run commands without asking — use CLI Code on repositories you trust, or start the agent from a plain terminal when you want its prompts back.
Supported agents
State on tab needs a status hook, which exists for the first 11. Restart → same conversation ✓ reopens the exact session; --continue uses the agent's own "latest session" flag. Model shown: OMP and Pi report the current selection directly, including changes before the next prompt. Other supported agents refresh from their session stores within about a second of recording a change; agents that record models only during a response update after that response. The picker shows agents found on PATH first.
In daily use
Open and hand over files. Cmd/Ctrl + Esc opens or focuses an agent; Cmd/Ctrl + Shift + Esc opens another tab of it; the New Session button opens one in the current tab's folder. Cmd/Ctrl + Alt + K inserts @path, @path#L10 or @path#L10-20 for the editor's file and selection.
Read the tab. Title = your name (double-click it at the top left, right-click the tab, or F2) › the quick command that opened it › the agent's own title, cleaned › your last prompt (40 chars, cut at a word) › the agent's name. Marks: ⟳ working · ? waiting for you · ● done while hidden.
Check a long prompt. Paste logs, code or a screenshot (Cmd + V / Ctrl + V), type around them, and read the Full prompt box above the input before pressing Enter. Click the chevron to fold it to one line.
Click what the agent prints. Cmd/Ctrl + click opens files (at line:col), folders and URLs; Shift + Cmd/Ctrl + click opens with the default app; hover shows the target. Right-click offers Open File / Open Folder / Open Link, Open with Default App, Insert @path into CLI, Copy Link / Path, Find Selection, plus Copy / Paste / Select All / Find in Terminal.
Keep the conversation. Reload Window and quitting VS Code keep everything; an agent that did not survive is resumed in its tab on reopen. Restart Session (↻) relaunches into the same conversation — by the session id the hook reported, else the newest session in the agent's own store for this folder, else the agent's --continue. Resume Session lists past sessions (Claude Code, Codex, Grok) and offers Continue latest session for the rest. When an MCP/plugin/hook file changes, idle tabs restart themselves; busy ones show "… changed — restart to apply" until you press ↻. Restart All Sessions does every tab.
Quick commands. Store prompts in cliCode.quickCommands (User or Workspace settings) or select text and run Save as Quick Command; run them from the action bar's … menu. They arrive as one paste, followed by Enter unless "submit": false.
Shortcuts, commands, settings
| Action |
macOS |
Windows / Linux |
| Open / focus an agent |
Cmd + Esc |
Ctrl + Esc |
| Open an agent in a new tab |
Cmd + Shift + Esc |
Ctrl + Shift + Esc |
Insert the current file as @path |
Cmd + Alt + K |
Ctrl + Alt + K |
| Newline in the prompt |
Shift + Enter |
Shift + Enter |
| Find in terminal |
Cmd + F |
Ctrl + F * |
| Zoom in / out / reset |
Cmd + = / - / 0 |
Ctrl + = / - / 0 |
| Rename tab |
F2 (or double-click its name) |
F2 (or double-click its name) |
* On Windows/Linux the terminal keeps Ctrl + F for the agent — use the palette or the right-click entry. Terminal shortcuts are active only in a CLI Code tab.
Command Palette (CLI Code:): New Session · Resume Session · Restart Session · Restart All Sessions · Quick Command · Save as Quick Command · Rename Tab · Find in Terminal · Copy Context · Copy · Paste · Select All · Zoom In / Out / Reset · Install Status Hooks · Remove Status Hooks — plus Open CLI, Open CLI in new tab and CLI: Insert At-Mentioned.
| Setting |
Default |
Meaning |
cliCode.statusHooks |
true |
Keep status hooks installed in every supported agent on PATH; false removes them. |
cliCode.checkForUpdates |
true |
Show CLI update notices and Update & Restart in the terminal header. |
cliCode.defaultCli |
"" |
CLI id listed first in the picker; set it with the star in the picker. |
cliCode.cliUpdates |
{} |
Optional version/check/update commands by CLI id, in User settings, for custom installations or release channels. |
cliCode.notifications |
true |
Notify when an agent finishes or starts waiting on a tab you are not looking at. |
cliCode.quickCommands |
[] |
{ "label", "text", "submit"? } entries; User settings = global, Workspace settings = project. |
cliCode.composer |
false |
Experimental chat-style input under the terminal (applies to new tabs). |
What CLI Code touches
- Writes the status hook into each agent's own config (
~/.claude/settings.json, ~/.factory/settings.json, ~/.codex/hooks.json + trust entries in config.toml, ~/.copilot/hooks/cli-code.json, ~/.grok/hooks/cli-code.json, a generated cli-code-status.ts plugin for opencode/Kilo/MiMo and extension for Pi/OMP), backing each file up once as <file>.cli-code.bak. Your own hooks are kept; cliCode.statusHooks: false removes everything.
- Reads the agents' session stores to find session ids, titles and models, and the modification times of their MCP/plugin/hook files to spot stale tabs.
- No network of its own; no data leaves your machine through CLI Code.
Limits
- Closing a tab ends the agent inside it (VS Code cannot ask first). Quitting VS Code does not: agents keep running until you reopen the folder.
- Status hooks and the interactive-shell launch are POSIX only (macOS, Linux). On Windows tabs work but show no state marks.
- Nine agents have no addressable sessions and restart with their
--continue flag (see the table).
FAQ
The agent asks me to log in. Expected — CLI Code only launches it. Complete the login once in any terminal.
Nothing happens on Cmd + Alt + K. A file must be open in the editor and an agent tab focused.
A shortcut collides with another extension. Rebind it under Preferences → Keyboard Shortcuts (search "CLI Code").
Can I keep using VS Code's own terminal? Yes — CLI Code only manages the tabs it opens.
Development
bun test — unit tests.
bun run test:integration — a real VS Code Extension Host (downloaded once into .vscode-test/): open/type/close, gone/restart, hook → state, resume and quick commands, two-stage reload. macOS/Linux; never writes your real hook files — the runner snapshots them and fails if one changes.
node test/e2e/status-hooks.mjs [agent…] — end-to-end against the agents installed on your machine (one model call each).
bun run package:target <platform> — VSIX for one target; bun run package:all for all six.
Agent icons are sourced from Orca.
License
MIT © 2026 Thanh Luan