Orchestrate agents (MCP)
Next Term is an MCP server, so one agent can run the others. An orchestrator — Claude Code, Codex, Gemini CLI or any other agent that speaks MCP — sees every project and tab with the state of the agent in it, opens projects, starts agents in new tabs or panes, gives them prompts, waits until they stop, reads what they said, answers their questions, reads the projects’ files and changes, and uses the editor. With your approval on the Mac it also edits files, stages and commits, arranges panes and the layout, changes a few settings, and leaves you tasks in the project’s todo folder. You watch it happen in Next Term’s tabs, and can step in at any moment.
Nothing to set up
Section titled “Nothing to set up”Settings › Editor › Agents: “Let agents control Next Term” is on by default. While it is on, Next Term adds its server, nxtrm mcp, to the agents it finds on your Mac:
| Agent | Where Next Term registers |
|---|---|
| Claude Code | Through claude mcp add-json --scope user, so Claude writes its own file |
| Codex | ~/.codex/config.toml |
| Gemini CLI | ~/.gemini/settings.json |
| Qwen Code | ~/.qwen/settings.json |
| Cursor Agent | ~/.cursor/mcp.json |
| OpenCode | ~/.config/opencode/opencode.json (or .jsonc, whichever exists), or the same in $XDG_CONFIG_HOME/opencode when your login shell sets XDG_CONFIG_HOME; Next Term’s entry then leaves ~/.config/opencode |
| GitHub Copilot CLI | ~/.copilot/mcp-config.json |
| Amp | ~/.config/amp/settings.json |
| Junie | ~/.junie/mcp/mcp.json |
| Command Code | ~/.commandcode/mcp.json |
| Claude desktop app | ~/Library/Application Support/Claude/claude_desktop_config.json (Claude-3p instead of Claude when Claude is set up to use a third-party platform) |
Agents you start after that see Next Term’s tools. The line under the setting says where it is registered, for example “Registered in Claude Code, Codex and Cursor.”
- Only Next Term’s own entry is written, named
next-term, and by text: comments and every other server in the file stay byte for byte as they were. - Someone else’s
next-termentry is never touched; Settings tells you it is there. - Turning the setting off removes Next Term’s entries and stops the server. The Claude desktop app’s goes once Claude is closed (see below).
- A file it cannot edit safely is left alone, for example a read-only one; for the Claude desktop app, the line under the setting says why.
- Only the installed app registers itself, never a copy running from the disk image, so the entries never point at a path that is about to disappear.
The Claude and ChatGPT desktop apps
Section titled “The Claude and ChatGPT desktop apps”- Claude: the desktop app reads
claude_desktop_config.jsononly when it starts, for its chats and for the local sessions in its Code tab (there this entry is used instead of Claude Code’s). It also saves the whole file from the copy it read, so Next Term changes the file only while Claude is closed. If Claude is open, Next Term adds itself (or, with the setting off, takes itself out) when you quit Claude, or at its own next launch if it was not running then, and the line under the setting says so; open Claude again to load it. Next Term adds only its own server there; the app’s preferences in the same file stay as they were. - ChatGPT: the desktop app reads Codex’s
~/.codex/config.toml, so the Codex entry covers it, and the line under the setting names both. Next Term writes it when the ChatGPT app or Codex is installed. Restart ChatGPT if it was open when Next Term added itself.
Any other MCP client
Section titled “Any other MCP client”Add a stdio server that runs nxtrm mcp. nxtrm is on the PATH in Next Term’s tabs and, once installed, in your other terminals (see The nxtrm command):
{ "mcpServers": { "next-term": { "command": "nxtrm", "args": ["mcp"] } }}nxtrm mcp answers an agent’s start-up questions itself, so the agent starts at once whether or not Next Term is running. Tool calls need the app: if it is closed, or the setting is off, they say so.
The tools
Section titled “The tools”| Tool | What it does | Changes anything? |
|---|---|---|
list_tabs | Every window (one per project) and its tabs: id, title, folder, the program running, and its state — idle, working, done, failed, or attention with the agent’s question, its choices and a question_id. A tab running a local dev server also gives its address as served_url, without the part after ? where a server puts a login token (Jupyter’s ?token=): the tab itself keeps the whole address for your own click. A local agent tab whose agent works in a git repository gives, once Next Term has read where (within a few seconds of its start), the checkout it works in as checkout (the main one or a worktree, from the agent’s own folder; see Where each agent works), its branch (or detached_at), and sync: same when the window shows that checkout, elsewhere when it shows another checkout of the repository, switched_under when the branch was switched under the chat, or other_repository when the window shows another repository, or none. Whenever the chat’s branch was switched under it, whatever sync says, it also gives chat_branch, the branch the chat was on, and switched_by: you, shell_tab, agent_tab or unknown, plus switched_by_tab when a tab did it. The caller’s own tab is marked "you": true, and panes that share a tab say so. A project window merged with others gives merged_with (the others’ projects) and behind (its tab is out of sight behind the one in front). A tab that shows herdr lists herdr’s agents in herdr_agents, each with an id of its own (see herdr’s agents). An agent session’s tab gives agent_session, the agent’s id, and agent_version and model when the agent names them. A tab with a token budget gives budget: its tokens, and spent once counted. | No |
read_tab | The last lines of a tab’s screen (80 by default, up to 2,000) and its state, with the question, its choices and question_id while its agent asks one. At a zsh prompt in a tab on this Mac, also input: the line being typed (line, and cursor in characters) and any suggestion a zsh plugin such as zsh-autosuggestions shows, which isn’t typed and is left out of the screen text. Next Term’s own suggestion is never in it. For an agent session, also agent_session, the last turn’s stop_reason and the agent’s whole last_message, with stored keys masked, and the whole command of a permission request it asks. | No |
wait_for_tab | Waits until the tab’s agent stops working, or its command finishes, then returns the state and the end of the screen, with input at a zsh prompt as read_tab gives it. It returns early at a question, with state attention. An agent session is followed exactly: the wait ends when its turn ends or it asks permission, with stop_reason and last_message as read_tab gives them. | No |
list_projects | The projects open in Next Term and the recently opened ones. | No |
get_editor_selection | The file in front in the editor, the selected text and its lines, unsaved edits included. | No |
get_open_files | The files open in each window, which one is in front, and which have unsaved changes. A preview tab is marked preview. | No |
read_file | A text file in an open project, as saved on disk: 400 lines by default from offset, up to 2,000 per call, with the total and where to read on. Files over 5 MB, binary files and secrets files are refused (see below). | No |
find_in_files | Searches an open project the way Find in Files does (text, or a regular expression with regex; case_sensitive, whole_word, and glob masks such as *.ts, !*.min.js). Each match comes with its file, line, column and the line’s text; 50 by default, up to 200. | No |
git_status | An open project’s branch, its upstream with commits ahead and behind, and each changed file: its state, whether it has staged and unstaged changes, and lines added and removed. | No |
get_diff | The unified diff of a file, or of every changed file, against the last commit (which: "head"), or only what is staged or unstaged. Cut at 60,000 characters by default. | No |
open_project | Opens a folder as a project in its own window, or brings it to the front, and returns its tabs. | Opens a window |
new_tab | Opens a tab in a folder, in the window of the project that holds it, or else in the asking agent’s own window: a tab, never a window you didn’t ask for. new_window: true (or an agent outside Next Term) opens the folder’s project in a window of its own instead. It can run a command in it, such as claude, codex or opencode, or, with agent_session instead of command, an agent session (claude, codex, gemini, qwen, opencode and the other ACP agents installed); a name not installed is refused before any tab opens, with the names that would run. An agent’s first prompt goes in plain words: Next Term quotes it for the shell, so nothing in it runs ($(…), backticks). For OpenCode it goes in as one word after --prompt=, since OpenCode takes a plain word as the project’s folder, or after opencode run as its message. A linked worktree inside a project’s folder, such as .claude/worktrees/x, opens in its own window. hand_off marks an agent that carries on the conversation you were having, rather than a worker (no opened_by). With split_beside and direction (right or down) it opens a pane beside another tab instead. A tab opened to run a command that isn’t an agent closes by itself 3 seconds after the command succeeds, with Keep Open, as run_command’s pane does; it stays when the command fails, when you keep it or type in it, and when it’s the window’s last tab. Returns the new tab’s id. Its window comes forward, and the tab waits for your click (see When an agent opens a tab). | Yes: asks first |
send_to_tab | Types text into a tab as a paste, then presses Return (unless submit is false): a prompt, an answer, or a shell command. | Yes: asks first |
forward_prompt | When you tell an agent that prompts you typed to it were meant for another session (“wrong tab”, “find the cs tab”), it hands them over in one call. Next Term finds that session among the agent tabs in every window and your closed Claude Code and Codex sessions, matching short names such as “cs” for coding-sessions. With one clear match it types the prompts there, after a note on where they came from; with several it asks you on the Mac which one, showing exactly what will be typed. A closed session is resumed in a tab first. It types only into an agent that is idle and still running there, never into one that is working or asking a question. Only prompts you typed move: for Claude Code and Codex they must be among your recent messages to that agent. The agent then stops work on them and tells you where they went and what it had changed. | |
press_keys | Presses keys in order: enter, escape, tab, shift+tab, the arrows, backspace, space, ctrl+c, ctrl+d, or a single character such as 1 or y. For an agent’s menus and confirmations. | Yes: asks first |
answer_agent | Answers the question an agent is asking: give the tab, the question_id that came with the question, and the choice (its number) or answer (its words). It moves the agent’s own cursor to the choice with the arrow keys (up or down in a list, left or right in a row of buttons) and presses Return once the screen shows the choice selected, or types y or n for a y/n prompt. For OpenCode, ⎋ alone picks Reject or Cancel, and a digit alone picks one of a question’s options (see Questions are answered once). If the tab now asks something else, or nothing, it types nothing and says what is on screen. An agent session’s permission request is answered the same way, and its Allow always still waits for your approval on the Mac. | Yes: asks first |
show_tab | Brings a tab and its window to the front, for you to see, as an agent’s new tab comes: without the keyboard, and in the window you work in it stays behind your tab. | Brings it forward |
set_token_budget | Sets a token budget for a Claude Code or Codex tab, as you ask (“2M”, “500k”, or a number), or clears it with 0. The tab’s chat then shows how much of it the session has spent. Shown, never enforced, and kept while the tab is open. Refused for an agent that records no running total. | Sets the budget |
close_tab | Closes a tab. A tab with something running is refused unless force is true, which stops it. The last tab in a window with unsaved files in its editor would close the window, so you are asked whether to save them first, and the answer says closed: false. force on a tab kept by tmux ends its session only after you approve on the Mac (Changes that ask on the Mac), and the id of one of herdr’s agents ends that agent the same way (Start and end an agent). | Yes: asks first |
rename_tab | Names the caller’s own tab, or a tab or pane it opened (with new_tab, new_remote_tab or split_pane), as Rename Tab… does: one line, trimmed and cut at 100 characters, with no character that hides or reorders text (direction marks, zero-width spaces, other control and format characters, and line separators; emoji are fine); an empty title gives the tab its own name back. It asks nothing. Other tabs are yours to rename. A tmux session’s name and herdr’s names for its agents never change: an agent’s id is refused, and the herdr tab’s own id (before the slash) renames that tab. | Renames it |
open_in_editor | Opens a file in the editor, at a line and column if given. | Opens a file |
list_skills | The skills an agent can use where it works, found the way that agent finds them (see The skill library): the project’s, yours and Next Term’s own, each with its scope, its place, native (the agent loads it itself) and also (other copies). Yours also say what Claude Code, Codex, Command Code and OpenCode each do with them (loads, off, skipped or none; off also for a skill folder whose Claude Code plugin you turned off in /plugin), where they came from, and whether an update was found. | No |
get_skill | A skill’s instructions (its SKILL.md), its folder and its other files, by name: the copy the agent’s rule picks, or another with scope (project, personal or next-term). | No |
list_shortcuts | Your keyboard shortcuts as you have them now: the shortcut set (Next Term, VS Code or JetBrains) and each command’s title, menu path, key and, when you changed it, its default. query narrows it by words (“terminal position”) or a key (“⌥⌘T”). Agents give you keys from here, never from memory. | No |
show_settings | Opens Settings at a section (general, editor, terminal, notifications, keys, import, agents, skills, mcp for MCP Servers, tasks or secrets), in front of you but without taking the keyboard. It changes no setting. | Opens Settings |
list_agent_clis | The coding agents on your PATH, as Settings › Agents shows them: each one’s id, name, path (the copy a shell runs, with other_copies after it), version, installed_by (npm, pnpm, Yarn, Bun, Volta, Homebrew, uv, pipx, Go, Own installer, npx or Unknown), latest as last checked with update_available, updates_itself (true, false or notifies, with its_own_switch), auto_update (off, daily, weekly or not offered), update_command, and a note when Next Term can’t update it. all adds the agents not installed. It looks along your PATH and asks no network. Changing a schedule or updating stays with you, in Settings › Agents. | No |
install_skill | Asks you to install a skill from a public GitHub source, with the agent’s reason. Nothing is fetched until you choose Fetch and Review in Next Term, and nothing is written until you install it from the review. See Agents asking for skills. | Only if you say so |
remove_skill | Asks you to remove an installed skill by name; you see what goes, and what may stay in other apps, then decide. Undo puts it back. | Only if you say so |
“Asks first” means the tool is marked as destructive in its MCP description, so agents that ask before risky actions ask you before using it. Every tool is marked honestly: the fourteen in this table that only read say so.
read_tab, wait_for_tab, send_to_tab, press_keys, answer_agent and show_tab also take the id of one of herdr’s agents where they take a tab’s, and so does focus_tab; close_tab does too, and start_agent starts a new one of herdr’s agents. See herdr’s agents.
Nine more tools work with your servers: list_hosts, add_host, remove_host, edit_host, check_host, new_remote_tab, host_sessions, end_session and host_changes. They are described in Remote tabs: for agents. Of these, only list_hosts only reads; the others are marked so that your agent’s client asks you first. add_host, remove_host, edit_host and end_session also wait for your Approve on the Mac, which shows who is attached to a session before it ends (Changes that ask on the Mac). host_sessions and new_remote_tab also list and open herdr’s sessions (Sessions on a server).
Five more use your stored keys by name:
| Tool | What it does | Changes anything? |
|---|---|---|
list_secrets | The keys stored in Secrets, by name: what each is for, whether you or an agent added it, whether it is set to never show (write_only), when it was last used, the provider whose page it came from (service, never the link), the day its value was last set (rotated) and whether its rotation reminder has passed (rotate_due). | No |
request_secret | Asks you to type or paste a key into a Next Term window, by name, with the agent’s reason. The agent gets back the status and the name. | Only if you save it |
store_secret | Saves a key the agent already holds, such as one it just created, once you allow it with Touch ID or your password. | Only if you allow it |
run_with_secrets | Runs a command in a tab with keys in that command’s environment only, once you approve with Touch ID or your password. See Keys for commands. | Only if you allow it |
import_secrets | Opens the import on your Mac for a file of keys (path: a .env, JSON, TOML, YAML or CSV file, or a Bitwarden or 1Password export) or a password manager (source: 1password, bitwarden or bws, whose own command-line tool you run in a new tab), with the agent’s reason. The Secrets window comes forward without taking the keyboard, and the sheet’s action has no Return default, so it answers only your click. You tick the keys and approve with Touch ID or your password; a key you have is replaced only if you tick its row. It answers names and counts, never values: imported (with the names imported and replaced, the found and not_imported counts and the format), declined, nothing_found, unreadable (with a reason), refused (with a note), busy, limited, cant_open, or pending with a request_id. See Bring keys in. | Only if you import |
None of them returns a key’s value. More in Secrets: agents and Secrets.
Every tool also carries Next Term’s own tag, read or write, in its _meta as next-term/scope: read for the tools that only look (the host tools that run a check over ssh among them), write for the ones that act on your Mac.
When an agent opens a tab
Section titled “When an agent opens a tab”A tab, pane or window an agent opens (new_tab, split_pane, open_project, new_remote_tab, show_tab, open_in_editor) comes forward on its own, but it never takes what you type:
- The tab waits for your click. It shows “An agent opened this tab. Click to type here.” Until you click it, pick its tab or move to its pane, keys typed in Next Term never reach it. A just-started agent may be showing a trust question, and a stray Return would answer it.
focus_tabgives it the keyboard only after you approve on the Mac. - Its window comes forward and takes focus, out of the Dock if it was minimized. While you are typing, it waits until you pause, then comes forward without the keyboard if you keep typing. While you are in Settings or the Secrets window, where you may be pasting a key, it comes just behind that window and doesn’t take focus.
- In the window you are working in, the new tab opens behind your tab, and the tab bar shows it. One exception: a tab where ssh asks for a password or a host key is shown, with “Click to answer.”
- From another app, the Dock icon bounces once instead of a window coming over what you are doing. A window on another Space stays there.
Settings › Editor › When an agent opens a tab chooses: Bring its window forward and focus it (the default), Bring its window forward, or Leave it in the background. An agent can change it too, with settings_set agents_bring_tabs_forward, which you approve. In every choice the tab still waits for your click.
Scratch windows close themselves
Section titled “Scratch windows close themselves”When an agent opens a tab in a temporary folder, such as its own scratchpad in /tmp or /var/folders, Next Term doesn’t leave that window behind:
- It closes a minute after everything in it has finished, with no question asked.
- Click or type in it, or bring it to the front yourself, and it is yours: it stays open.
- It never closes while a command runs, an agent is working or waiting for you, a file or database value is unsaved, or it holds a remote tab.
- It stays out of Recent Projects and the Welcome window, and isn’t reopened at launch.
A temporary folder you open yourself is never closed for you.
Waiting
Section titled “Waiting”wait_for_tab waits up to 50 seconds by default, because some clients give up on a tool after a minute; timeout_seconds raises it to 300. A call that carries a progress token gets progress every 20 seconds until its answer, so a client that resets its timeout on progress, as OpenCode does, keeps waiting past that minute. When it returns with "timed_out": true, the agent is still working: call it again to keep waiting. Input that a tool has just sent counts as work, so a wait right after send_to_tab waits for the job it started, however quickly it begins.
The orchestrator is the one waiting, so a tab it opened with new_tab or gave input to does not notify you when its agent finishes while you are in Next Term; from another app, it does, and its decisions always do. Type in the tab yourself and it notifies you again like any other. See Notifications and the Dock badge.
Agents asking for skills
Section titled “Agents asking for skills”install_skill and remove_skill are requests, not actions. Each opens a small window naming the tab that asked, or saying the request came from outside Next Term’s tabs, with the agent’s reason shown as its own words. The window does not take the keyboard and has no Return button, so typing meant for a terminal never answers it. One request is open at a time: another one gets busy. A source you decline stays declined until Next Term quits. The call answers within about 50 seconds: installed, removed, declined, failed with a note saying why (for example, the download changed after the review), or pending with a request_id the agent passes again to keep waiting.
Fetch and Review opens the same review as Window › Skills, with the same choice for Claude Code and the same default: a skill folder that is also a Claude Code plugin is left out of Claude Code unless it brings nothing beyond its own skill, or you pick “Add it to Claude Code as a plugin” there. A removal names what may stay, as Settings › Skills does: an MCP server Codex may have added for the skill, and what sessions open now keep until they restart. See Skills from GitHub.
herdr’s agents
Section titled “herdr’s agents”A tab that shows herdr, kept with herdr on a server or herdr run in a tab on this Mac, lists each of herdr’s agents in list_tabs with an id of its own. The tab tools take that id wherever they take a tab’s, so an orchestrator reads one agent’s pane, prompts it, presses its keys or answers its question through herdr with the tools it already knows, even while another pane has herdr’s keyboard. One more tool, start_agent, starts a new agent, and close_tab ends one, each once you approve on the Mac (Start and end an agent).
Ids and what list_tabs gives
Section titled “Ids and what list_tabs gives”An agent’s id is its herdr tab’s id, a slash, and herdr’s pane id: 6f1c2a7e-3b4d-4e5f-8a9b-0c1d2e3f4a5b/w1:p3. An agent on one of herdr’s own machines has the machine’s id between them, after an @: <tab id>/@<machine id>/w1:p3, since pane ids are each machine’s own.
Each entry in the tab’s herdr_agents has:
id, and herdr’spane,name(the one you or a naming plugin gave it in herdr, when it has one),agent(what runs, such asclaude),state(herdr’s:idle,working,blocked,doneorunknown),title,directory,workspace,tabandfocused, as herdr gives them, with stored keys masked;session, for one of herdr’s named sessions;waiting_secondswhile it needs you, counted from when Next Term saw it start to;- while it waits on a decision,
questionas read from its pane,choicesand aquestion_idforanswer_agent. Until a question is read there,questionsays only that the agent needs a decision, points toread_tab, and comes with noquestion_id; "you": truefor the pane the calling agent runs in, when it runs inside herdr on this Mac;machine(itsidandlabel), for an agent on one of herdr’s machines.
{ "id": "6f1c2a7e-3b4d-4e5f-8a9b-0c1d2e3f4a5b/w1:p3", "pane": "w1:p3", "agent": "claude", "state": "blocked", "title": "Fix the login", "directory": "/srv/app", "workspace": "w1", "tab": "w1:t1", "focused": false, "waiting_seconds": 240, "question": "Do you want to make this edit to routes/api.php?", "choices": ["Yes", "No"], "question_id": "…"}A remote herdr tab also gives herdr_session for a named session, and herdr_note while herdr doesn’t answer or needs a restart, when its agents’ states aren’t known. A herdr tab that fell back to a plain shell gives fell_back: true and herdr_missing_reason, and says once herdr is on the server.
The tab tools on an agent
Section titled “The tab tools on an agent”| Tool | With the id of one of herdr’s agents |
|---|---|
read_tab | The agent’s pane, read through herdr: the last 80 lines by default, up to 2,000, masked as a tab’s screen is, with its state and, while it waits on a decision, its question. |
wait_for_tab | Waits until herdr says the agent stopped working, then returns its state, its question if it asks one, and the last 40 lines of its pane. Text or keys sent just before get 6 seconds to show as work, so a wait right after send_to_tab waits for the job it started. If herdr no longer lists the agent, the state is gone, with a note. |
send_to_tab | Sends the text to that agent through herdr. With submit (the default) it goes as one prompt, which herdr refuses while the agent waits on a decision: answer_agent answers that. submit: false types it without Return; an agent on one of herdr’s machines takes only whole prompts. |
press_keys | Sends the keys to that pane through herdr, all of one call in one command. A key herdr doesn’t take is refused before anything is sent. |
answer_agent | Answers as for a tab: the pane is read again, and the question_id must still match the question on it. The arrow keys go, the pane is read again until it shows the choice selected, and only then Return. A y/n prompt gets its letter, and Return only if the prompt is still there. If the choices or the selection can’t be read in that pane, nothing is typed, and press_keys can answer. |
show_tab | Brings the agent’s herdr tab forward, as for a tab. herdr’s own view does not move. |
focus_tab | Asks you on the Mac first, since herdr moves its view in every window attached to that session: “An agent asks to show a herdr agent”. Approved, the tab takes the keyboard and herdr moves its view to the agent’s pane. A herdr before 0.7.5 moves only to the agent’s herdr tab; with neither, the answer names the herdr version there and herdr’s view stays. The answer says what herdr did. For an agent on one of herdr’s machines, herdr focuses it there, and herdr’s screen shows that machine once you pick it in herdr’s sidebar. |
close_tab | Ends that agent once you approve on the Mac: herdr closes its pane, and what runs there stops. When that was its herdr tab’s only pane, herdr closes the tab too, and the workspace as well when it was that workspace’s only pane; the session and its server keep running, and the session’s last pane is refused. A working agent needs force. See Start and end an agent. Until then it is refused. close_tab with the herdr tab’s own id (before the slash) closes the tab, which only detaches. |
rename_tab | Refused: herdr’s names are shown as given. The herdr tab’s own id renames the tab, if it is the caller’s own or one it opened. |
split_pane, close_pane, zoom_pane | Refused: herdr’s panes are herdr’s to split, close and zoom. |
- The same checks as a tab. Typing into an agent is refused while its tab is connecting, disconnected or holds a line Next Term put back, and into the caller’s own herdr pane.
- What can’t be sent: text over 64 KB, text that is one of herdr’s own options (
--session,--remoteand the like), which herdr would take for itself, and text that holds one of your stored keys. On a server the text is herdr’s argument while herdr runs, where others there can see it withps;run_with_secretsgives a command a key instead. - Only that agent is driven. Typing into one of herdr’s agents asks nothing on the Mac, as typing into a tab doesn’t, and makes that agent, not its whole herdr tab, the calling agent’s to wait for: while you are in Next Term, its finishes don’t notify you, and its herdr neighbours’ still do. Type in the herdr tab, or act on the agent from Peek or a notice, and it is yours again.
- Agents on herdr’s own machines are reached only through the herdr on this Mac that saved them, and only with herdr’s agent commands.
Start and end an agent
Section titled “Start and end an agent”start_agent starts one of herdr’s agent kinds in a new herdr tab, in a tab that shows herdr: on a server, or herdr run in a tab on this Mac. It takes:
tab_id: that tab’s id fromlist_tabs, not one of its agents’ ids.kind: one of the kinds herdr lists in its own help there (herdr agent start --help), such asclaude,codexoropencode. Next Term reads the list before each start, so a kind herdr adds works with no update to Next Term.name: herdr’s name for the agent, up to 32 lowercase letters, digits,_and-, starting with a letter. The kind by default.directory: an absolute folder for the new herdr tab, such as/srv/app. herdr gets it with no shell between, so~is never expanded. herdr’s own folder by default.words: arguments for the agent, such as["--model", "opus"]: at most 16, each a plain word of letters, digits and. _ = : / @ + , -, never one of herdr’s own options or text that holds a stored key.split_beside: instead of a new herdr tab, an agent’s or pane’s id in that tab: herdr splits that pane and the agent starts in the new one, to itsdirection(right, the default, ordown).pane: or a herdr shell pane at its prompt, by its id, for the agent to start in.reason: why, shown to you as the agent’s words.
It asks on the Mac first. The window names the kind, the name, where herdr runs and its session, and the commands Next Term runs: herdr tab create --label NAME --no-focus (with --cwd and the folder, when one is given), then herdr agent start NAME --kind KIND --pane <its pane> --timeout 20000, with the words after --, each as herdr gets it (with --session for a named herdr session). Every refusal comes before the window: a tab that doesn’t show herdr, a name herdr wouldn’t take, a folder that isn’t absolute, words that aren’t plain, and a kind herdr doesn’t list there (the answer names the ones it does).
Approved, the answer gives the new agent’s id for the tab tools, its pane, herdr_tab, kind and name. The calling agent drives it, so while you are in Next Term its finishes don’t notify you. While the new pane’s shell isn’t ready yet, Next Term tries agent start again for up to 10 seconds. If the agent doesn’t start, the herdr tab herdr made stays, and the answer names it and its pane, with the id close_tab takes to close that pane (and the tab with it) while herdr lists it; Next Term never closes it by itself.
close_tab with an agent’s id ends that agent:
- It asks on the Mac first. The window names the agent, its pane and its state, and the command Next Term runs:
herdr pane close <pane>. herdr closes the pane, and what runs there stops. - Its herdr tab closes with its last pane. When the agent’s pane is its herdr tab’s only one, herdr closes that tab too, and its workspace when the pane is that workspace’s only one; the window says so, and the answer has
herdr_tab_closedandherdr_workspace_closed. The session and its server keep running. - A working agent needs
force. After Approve, herdr is asked again: the pane must still run the same agent (its kind and herdr’s name for it), one that started working while you were asked isn’t ended withoutforce, and one herdr no longer lists is left alone, with nothing run (closed: false). - Refused before any window: the caller’s own pane, an agent on one of herdr’s own machines, the session’s last pane, and whatever typing into it is refused for, such as a tab that is connecting or disconnected.
Waits, names and commands
Section titled “Waits, names and commands”- Wait for a state.
wait_for_tabwith an agent’s id anduntil, a list of herdr’s states (idle,working,blocked,done,unknown), returns once the agent is in one of them (herdr’sagent wait --until). - Wait for text.
wait_for_tabwithmatchreturns once the screen shows that text, or matches it as a regular expression withregex: true: in a tab on this Mac, or in a herdr pane (herdr’spane wait-output). - Rename.
rename_tabrenames in herdr an agent the calling agent started, as Rename… in the agent’s row menu does for you. - Run a command beside a pane.
new_tabwith a herdr agent’s or pane’s id insplit_besideasks on the Mac first, then herdr splits that pane and runs the command in the new one. Its folder is on herdr’s side. The answer’s id is the new pane’s, forread_tab,wait_for_tabwithmatch, andclose_tab, which closes a pane with no agent the same way. The pane stays open after the command ends: herdr doesn’t report exit codes, so Next Term can’t tell a success.
New Agent Beside… in an agent’s row menu does it for you: pick one of the kinds herdr lists, a name and a side, and herdr splits the pane and starts the agent there.
Layout, zoom, focus and worktrees
Section titled “Layout, zoom, focus and worktrees”- herdr’s layout.
list_tabswithherdr_layout: trueadds each herdr tab’s whole session as herdr sees it:herdr_workspaces, their tabs, and the panes in each, with ids the tab tools take. A workspace’s id is<tab id>/ws:w1, a herdr tab’s<tab id>/tab:w1:t1, and a pane’s is its agent’s id. Off by default. - Zoom a pane.
zoom_panewith a herdr agent’s id zooms its pane in its herdr tab, or withzoomed: falsebrings the others back. - Focus a pane.
focus_tabwith a herdr agent’s id moves herdr’s view to its pane; withdirection(left,right,upordown), to the neighbour there. With a herdr tab’s or workspace’s id it moves herdr’s view to that tab or workspace, andshow_tabtakes those ids too. - Start in a new workspace or worktree. Besides a new herdr tab,
split_besideandpane,start_agenttakesnew_workspace: true, for a new herdr workspace in itsdirectory, orworktreeand a new branch’s name, for a git worktree of the repository atdirectoryin a herdr workspace of its own. - Close a workspace or remove a worktree.
close_tabwith a herdr tab’s or workspace’s id closes it, never the session’s last panes; withremove_worktree: trueand a linked worktree’s workspace id, herdr removes the workspace and its checkout, and it’s refused while the checkout has uncommitted work. - Rename works on a herdr tab or workspace the agent started, as on an agent.
Each asks you on the Mac first. For you, a herdr agent’s row menu has Zoom in herdr, Move to a New herdr Tab (its pane gets a herdr tab of its own), Rename herdr Tab…, Rename herdr Workspace… and New Worktree Workspace… (a branch name, then herdr makes a git worktree on it in a workspace of its own). Your click is the yes, so these don’t ask again.
herdr itself
Section titled “herdr itself”A herdr agent’s row menu has a herdr submenu:
- Sessions… stops a herdr session, or deletes one that is stopped. A session a tab here shows is never stopped.
- Machines… renames one of herdr’s saved machines, turns it on or off, or removes it (for herdr on this Mac).
- Integrations… installs or uninstalls herdr’s agent integrations.
- herdr Status and Updates… shows herdr’s version and channel, checks its config, reloads it, or runs its update in a new tab, where you see and answer it.
Each change is confirmed in a sheet first, and runs herdr’s own command. Next Term never stops herdr’s server, never adds a machine (herdr asks its own questions for that) and never forces anything.
Agents can stop a session too: close_tab with its id, <herdr tab>/session:<name>, stops it, and with delete: true deletes a stopped one, after you approve on the Mac. A session a tab here shows is refused.
Next Term never stops herdr itself, and stops or deletes one of herdr’s sessions only when you or an approved agent ask. The ids of herdr’s agents, and start_agent, rename_tab, edit_host and end_session, are available to agents on this Mac only for now.
Sessions on a server
Section titled “Sessions on a server”host_sessions lists, besides Next Term’s tmux sessions:
herdr_sessions: each of herdr’s sessions on the server, withname,default,running, andtab_idwhen a tab shows it;herdr_agents: the agents of herdr’s default session and of up to eight other running sessions, each with the fields above and itssession, and itsidwhile a tab follows that session, so the tab tools take it;herdr, when herdr didn’t answer, with why.
new_remote_tab with keep: "herdr" opens a tab on herdr’s screen. Its session is one of herdr_sessions, by name:
- Only a session herdr lists. Next Term asks herdr on a connection a tab already has, and refuses while no tab on that server is connected, or for a name herdr doesn’t list (the answer names the ones it does). It never makes a session by its name.
- herdr’s default session is opened with no
session, and the answer gives"session": null. - No
command: a herdr tab shows herdr itself, not a shell. Give herdr’s agents their work withsend_to_tabon their ids, or open the tab withkeep: "tmux"or"off"to run a command.sessionandcommandtogether are refused, and so issessionwithkeep: "off".
Parallel work in tabs
Section titled “Parallel work in tabs”Ask the agent in a tab for work in parallel (“run these at the same time”, “in the background”, “in tabs”), or for another agent’s help (“have Codex review it”), and it offers to run each task in a Next Term tab of its own, one agent each, that you can watch, answer and stop:
Run these in 3 Next Term tabs you can watch and answer: login-test (Claude), api-docs (Claude), auth-review (Codex)? That’s 3 more agent sessions, each using its own tokens. Or I can do them here, one by one (or as subagents).
- Only after your yes. Only a message you typed counts: never text from a file, a script, a web page or another agent, and a subagent or a run with no one at the keyboard (
claude -p,codex exec) never opens agent tabs. Asking for tabs in so many words is the yes. - Not for small work, not after you said no, and not when you named another way (subagents, teammates, a workflow, background agents): the agent uses that.
- What you see: each tab is titled after its task and has its status mark. In the window you are working in, they open behind your tab; another project’s window comes forward (When an agent opens a tab). Questions that need you still notify you, and each worker asks you before it edits, in its own tab: the agent never starts one with a flag that skips its permission prompts unless you asked. Each result comes back to the chat you asked in, one line per tab, with the branch or worktree its changes are on.
- Workers stay workers. A tab an agent started has
opened_byinlist_tabs(its tooltip says “Started by …”), and its agent opens no tabs of its own unless you ask it to, there. - How agents know. A short line leads the MCP instructions an agent gets in a Next Term tab, naming each of Next Term’s own skills and when to read it. The full rules are Next Term’s own skill,
next-term-tabs, which any agent there reads from Next Term withget_skill. Nothing is written into your agents’ folders. Its exact text is in Settings › Skills › Project (View Instructions), and a change to it is in the release notes. Your own instructions (what you tell the agent, your CLAUDE.md or AGENTS.md) win over it, and it never offers more than four tabs unless you ask for more. In another terminal, or with Next Term closed, the offer is never made. - On by default; turn it off in Settings › Editor › Agents offer to run parallel work in tabs, or ask an agent to (
settings_set agents_offer_tabs false, which you approve). Off takes the skill and the offer out at once. A skill of your own or your project’s namednext-term-tabscomes before Next Term’s.
Work that already has a worktree
Section titled “Work that already has a worktree”Paste a repository, branch, pull request or worktree into an agent in a tab, and when the project already has a worktree or local branch for it, the agent offers once to go on there instead of starting over:
fix/loginalready has a worktree,~/Code/app-wt-login: last commit 2 days ago, 3 changed files. Open it in its own Next Term window and continue there with Codex? Or I can work on it here.
- Only after your yes, typed by you. The agent only reads to find it:
git worktree list, the local branches,gh pr viewfor a pull request. A pull request from a fork counts only through a branch that tracks the fork. It never creates, switches or removes a branch or worktree without asking, and offers to make a worktree for a branch that has none, namedmyapp-wt-loginbeside the main checkout as Open in New Worktree names them. - The same agent goes on there: in a tab in the worktree’s own window (“myapp ▸ app-wt-login”), started with a hand-off of what you asked, what is done and what is next. Codex can resume the same conversation there; Claude Code, Gemini CLI and most others keep sessions per folder, so they start a new one with the hand-off. The agent in your tab says where the work went and stops it there.
- How agents know: Next Term’s own skill
next-term-worktrees, read overget_skilllikenext-term-tabs. It is there while agents may control Next Term, and its text is in Settings › Skills › Project (View Instructions).
Setting Next Term up by asking
Section titled “Setting Next Term up by asking”Ask an agent in a tab to change how Next Term works (“terminal on the right”, “bigger font”, “make it work like VS Code”, “how do I split panes?”), and it changes what it may, opens Settings at the right tab for the rest, and answers with a table, the key first:
| Key | What | Where | Done |
|---|---|---|---|
| ⌥⌘T | Open a tab on a server | File › New Remote Tab… | how to |
| — | Terminal on the right | View › Terminal Position | changed |
| ⌘, | Terminal font | Settings › Terminal › Font | Settings open |
- What it may change: the settings in
settings_get, with onesettings_setyou approve; the layout withset_layout; panes with the pane tools; fonts, colours and keys from another editor through Import, which you apply. Never agent control, remote access, the IDE links, updates or a single key. - Your keys, not a guess: the keys come from
list_shortcuts, so they follow your shortcut set and your own changes. - How agents know: Next Term’s own skill
next-term-setup, there while agents may control Next Term.
The skill library
Section titled “The skill library”An agent in a Next Term tab can use more skills than it reads itself. list_skills and get_skill give it the skills of its project, yours and Next Term’s own, found the way that agent finds them:
-
The project’s. These are the skill folders (
.agents/skills,.claude/skills,.codex/skills,.commandcode/skillsand.opencode/skills) in the agent’s folder and in each folder above it, up to the repository’s top. It looks at most ten folders up, and never in your home folder. Codex and Command Code walk up the same way. -
Yours. The same folders in your home folder, and OpenCode’s
skillsfolder in~/.config/opencode(or whereXDG_CONFIG_HOMEputs it). -
Next Term’s own.
next-term-tabswhile it is on, andnext-term-worktreesandnext-term-setupwhile agents may control Next Term (see below). -
A name found twice. The agent’s own rule picks the copy, as of October 2026:
- Claude Code reads only
.claude/skills, and takes your copy over the project’s. - Command Code takes the project’s,
.commandcodebefore.agents. - OpenCode takes a copy in its own folders first (yours in
~/.opencode/skills, the project’s.opencode/skills, then yours in~/.config/opencode/skills), else the project’s, and skips aSKILL.mdthat gives noname. - Codex lists both, and the library gives the nearer one first.
- Every other copy is named in
also, so nothing is hidden.
- Claude Code reads only
-
native. A skill says whether the asking agent already loads it itself, so it reads only the others withget_skill. Gemini CLI and the rest can use your Claude Code skills this way, and Claude Code can use the ones in.agents/skills. -
Read safely. A cloned repository’s skills are anyone’s, so a
SKILL.mdis read only if it is a regular file of at most 256 KB inside its skill’s own folder. A link from it to the project’s.env, out of the folder or to a device is refused, and secrets files are never read. Skill text and descriptions have tokens and passwords masked, asread_file’s are.
Settings › Skills › Project shows the same thing for the project in front, for Claude Code, Codex, Command Code and OpenCode. See Settings › Skills.
An example: two projects, two agents
Section titled “An example: two projects, two agents”Ask the agent you are talking to (here Claude Code, in any Next Term tab):
Open ~/Code/api and ~/Code/web in Next Term. Start Claude Code in api and Codex in web. Ask Claude to add rate limiting to the login endpoint with tests, and Codex to show a friendly message on the login page when the limit is hit. Wait for both, answer anything routine, and tell me what each one changed.
What it does with the tools:
open_projectwith~/Code/api, then with~/Code/web: two project windows open.new_tabwithdirectory: ~/Code/apiandcommand: "claude", and again with~/Code/weband"codex". Each call returns a tab id; both tabs show a spinner once their agent is busy.send_to_tabgives each agent its task.wait_for_tabon the Claude tab. It comes backtimed_out, so the orchestrator calls it again; then it returnsattentionwith Claude’s question, “Do you want to make this edit toroutes/api.php?”, its choices and aquestion_id.get_diffon that file shows what Claude has changed there so far, andread_filereads the code around it.answer_agentwith thatquestion_idandchoice: 1answers “Yes” (or the orchestrator asks you, if the question is not routine), and it waits again until the state isdone.wait_for_tabon the Codex tab, thenread_tabon both to read their summaries, andgit_statuson each project to see which files changed.- It reports back to you, and
show_tabputs the tab worth reviewing in front, where ⌥⌘G shows the changes side by side.
To watch a worker next to the agent that started it, the orchestrator can call new_tab with split_beside set to its own tab: the worker opens as a split pane beside it.
Questions are answered once
Section titled “Questions are answered once”A question’s question_id changes whenever the agent asks a new question, even one in the same words. answer_agent checks it against the question on screen before it types anything, so an answer meant for one question never lands on the next. It moves the agent’s cursor with the arrow keys and checks that the cursor reached the choice before it presses Return. It types a choice’s digit only where the digit alone is the whole answer, as in OpenCode’s questions, and then presses no Return, which would answer whatever comes next.
OpenCode asks in its own ways (see OpenCode’s screen):
- A permission prompt is a row of buttons.
answer_agentmoves along it with the arrow keys, the shorter way round, and presses Return once the button it wants shows selected. OpenCode marks that button only by its background, so in a theme where every button looks the same, only Reject can be answered: ⎋ picks it wherever the selection is. On OpenCode 2’s fullscreen prompt the first ⎋ only makes the prompt smaller, so a second follows once it has. - Allow always asks to confirm in OpenCode 1.19: a new question, with its own
question_id, that the caller answers too. Next Term never confirms for it. - Rejecting a sub-agent’s request asks what OpenCode should do instead, a question with no choices:
send_to_tabtypes a message and sends it, andpress_keyswithentersends none. - A question’s options are picked by their digit, 1 to 9. A form with several questions, a question that takes several answers, or an option past 9 gets no keys, and the answer says what
press_keyscan do instead. - The mouse moves OpenCode’s selection, so a pointer moving over its buttons just as an agent answers can change what Return picks.
Files, search and changes
Section titled “Files, search and changes”read_file, find_in_files, git_status and get_diff read only inside the projects open in Next Term:
- Paths stay inside. A path is relative to the project, or absolute inside an open project. Symlinks are resolved first, so a link that leads outside is refused.
- Secrets files are never read.
.envfiles (except.env.example), keys and certificates (*.pem,*.key,*.p12and the like), ssh keys (id_rsa,id_ed25519), credentials files (.netrc,.npmrc,credentials…,secrets.…, Terraform state), git’s own.gitfolder and Next Term’s Secrets folder are refused with the reason. Search skips them, and diffs leave them out and say so. - Secret-looking values are masked as
•••in what the tools return: known token formats (sk-…,ghp_…, AWS keys and others), private keys, passwords in URLs, the values of settings named like secrets (api_key,password,token), and long random-looking strings. Keys you stored in Secrets are masked by their exact value too. Code, paths and commit ids stay readable. - Text only, and capped. Binary files and files over 5 MB are refused, and one answer carries about 60,000 characters at most.
- Reading never locks git. Status and diffs use the same read-only git commands as the sidebar, so they never get in the way of an agent’s own
git commit.
Tools that change things
Section titled “Tools that change things”Besides the tools above, fifteen more edit files, stage and commit, run a command you have to run yourself, and control panes, the layout and a few settings, so an agent can drive Next Term completely. Each one that changes something waits for your answer on the Mac first (see Approving changes).
| Tool | What it does | Changes anything? |
|---|---|---|
propose_edit | Opens a change to a file as a proposal in the editor’s side-by-side diff, for you to Accept or Reject, as Claude Code’s edits are. Give the whole new text (content), or old_text and new_text to replace the one place where old_text appears. It never writes the file. The answer is accepted or rejected, or pending with a proposal_id after about 50 seconds; closing the proposal rejects it. | Only if you accept, and then the agent writes it |
write_file | Replaces the text of an existing file in an open project, keeping its encoding, line endings and permissions. | Only if you approve |
create_file | Creates a new text file in an open project, and any folders missing on its path. | Only if you approve |
stage | git add of exactly the named files, with new files and deletions; no patterns. | Only if you approve |
commit | Stages the named files and commits them with message. The repository’s hooks run as for any commit. Never pushes, never amends. Returns the new commit’s id. | Only if you approve |
run_command | For a command you have to run yourself, such as sudo, gh auth login or anything that asks for your password, instead of the agent asking you to copy it or type it after !. The window shows the exact command in a box, with Run as the button to click. On Run it runs in a new pane below the agent’s tab (on the same server for a remote tab), and that pane takes the keyboard, ready for your password. An agent outside Next Term’s tabs gives a folder, and it runs in a new tab there. The agent gets back the exit code and the pane’s last lines, with stored keys masked. When the command succeeds, the pane shows “Closes in 3 s” and then closes by itself (from 0.11.53); a failed command stays open for you to read. Keep Open, a key typed in the pane after it ends, or Keep Open in the pane’s menu keeps it. The window’s last pane never closes this way. read_tab and wait_for_tab on a closed pane answer closed with its exit code and output for 30 minutes. A command still running after about 50 seconds answers running with a request_id to keep waiting. It always asks, even over a remote connection whose changes need no approval. | Only if you click Run |
focus_tab | Puts a tab, or a pane of a split tab, in front of its window with that window’s keyboard. A tab an agent opened gets the keyboard only this way or by your click. Unlike show_tab, the window and Next Term stay where they are. With the id of one of herdr’s agents, herdr also moves its view to that agent’s pane (herdr’s agents). | Only if you approve |
split_pane | Opens a new pane beside a tab’s pane, to its right or below it (direction: "down"), without taking the keyboard. Returns the new pane’s id. | Only if you approve |
close_pane | Closes one pane of a split tab; the tab and its other panes stay. A pane with something running needs force. | Only if you approve |
zoom_pane | Makes one pane fill its tab with the window’s keyboard, as Window › Maximize Pane does, or brings the panes back with zoomed: false, leaving the keyboard where it is. | Only if you approve |
set_layout | terminal_position, sidebar_side, terminal_tabs (top, or left or right for a list of the tabs down that side of the terminal), window_column (shown or hidden: the window column) window_column_folded and window_column_side (left or right; by default the project sidebar’s side) for every window, as the View menu sets them; sidebar (shown or hidden) and terminal_folded for one window. Moving the sidebar or the tabs leaves a folded terminal folded. | Only if you approve |
settings_get | The settings settings_set may change, with their values and what each takes, and the layout as set_layout answers it. | No |
settings_set | Changes a few settings: font_size (the editor’s; terminals use it too unless they have a size of their own), line_height, soft_wrap, terminal_position, the notification switches notify_decisions, notify_agent_finished, notify_program_alerts and notification_sound, notify_commands (in_another_app, always or never), agent_spinner (spinning, still or off, as View › Agent Spinner) and agents_offer_tabs (see Parallel work in tabs) and agents_bring_tabs_forward (focus, show or off, see When an agent opens a tab), open_projects_in (ask, this_window, new_window, new_tab or as_macos, see Where a project opens), and appearance (system, light or dark) with light_theme and dark_theme (see Appearance). So you can ask any agent to change them, and approve on the Mac. | Only if you approve |
reopen_before_update | Reopens the windows that were open when the last update was installed and didn’t come back after its restart, each with its tabs in their folders, merged windows merged again (If a window didn’t come back). With nothing to reopen it answers at once. | Only if you approve |
apply_setup | A whole setup plan in one call: settings (the same names and values as settings_set), the layout (set_layout’s fields) and an import (a preview_import result’s rows). One window on your Mac lists every change with a tick box, and Apply changes only what stays ticked. Next Term › Undo Agent Setup… puts exactly those values back, even after a restart, and names anything you changed by hand since. The next-term-setup skill uses it for a first-run setup. | Only if you approve |
A call that would change nothing, such as set_layout with the layout as it is, answers at once without asking. write_file, stage, commit, run_command and close_pane are marked destructive, since they can replace a file’s text, the staging you chose, run a command or stop a running program; the others are not.
Approving changes
Section titled “Approving changes”Each change opens a small window on your Mac. It says what the agent asks to do, which tab asked (or that the request came from outside Next Term’s tabs), the agent’s reason in its own words, and what would change: the lines added and removed with the first of them, a commit’s branch, files and message, or each setting before and after. It has three buttons:
- Approve makes the change. Just before, Next Term checks that what you saw still holds: if the file changed meanwhile, or the staged files or the branch did, the change is refused.
- Decline changes nothing, and the agent is told so.
- Decline and Stop Asking also refuses further changes from the same tab, without a window, until Next Term quits: its proposals too, and writing a proposal you accepted before. For a request from outside Next Term’s tabs, that is every agent outside them.
Like the skills window, it does not take the keyboard and has no Return button, so typing meant for a terminal never answers it. One change waits at a time: another agent asking meanwhile is told to try again. With no answer in about 50 seconds the window closes and the change is refused, so the agent’s call never hangs.
The same window asks before add_host, remove_host, edit_host or end_session saves, changes or forgets a server or ends a tmux session, before close_tab with force ends a kept tmux session (Changes that ask on the Mac), and before start_agent or close_tab starts or ends one of herdr’s agents (Start and end an agent). Their checks run before it opens, so a call that would fail opens no window.
After you accept a propose_edit, the agent writes the file with write_file (or create_file) and exactly that text. That write does not ask again, for 10 minutes and while the file is as it was when you saw the proposal. Each agent has one proposal open at a time.
Approve a change to a script, a test or an agent’s settings file as you would a command typed in your shell: it is code that may run later, and commit runs the repository’s hooks, which often run the project’s own scripts and tests.
Keys for commands
Section titled “Keys for commands”run_with_secrets runs a command with keys from Secrets in its environment, such as npm test with OPENAI_API_KEY. It asks in a panel of its own, not the window above:
- The tab first. A new tab opens in the folder without taking the keyboard, or the agent names a tab of yours at its shell’s prompt with
tab_id. Next Term types one line there,nxtrm secret run --ticket …, so the command and its keys never reach the shell or its history. - Then the panel. It shows who asks, the keys and what each is for, the whole command with invisible characters written out, the folder, the agent’s reason, and warnings, such as a variable in that tab that can change what the command runs, or a
.envthat points the key elsewhere. Choose in Remember, such as Only this time, For 15 minutes or an Always choice, then Allow, then Touch ID or your password. A key set to ask for Touch ID every time it’s used, as new keys are, offers only Only this time, and Always where it is offered. See Approving a use. - Then the command, under
/bin/sh -c, with the keys in its environment; the tab’s shell never gets them. The agent getsstartedwith the tab’s id, and reads its screen withread_tab, where stored keys show as•••. - The answer comes within about 50 seconds:
started,declined, orpendingwith arequest_idto call again with. A command that holds a stored key’s value is refused before any tab opens.
A command you allow gets the key and can send it on, so read it as you would before typing it yourself.
What is refused
Section titled “What is refused”- Files outside the open projects, with symlinks resolved first, and files that usually hold secrets:
.envfiles, keys and certificates, ssh keys, credentials files and.git, as for reading. The answer says why. - Git hooks: files in the repository’s hooks folder (
core.hooksPath), in.husky, and pre-commit’s and lefthook’s settings, sincecommitwould run them. - Binary files and files over 5 MB.
- A file open in the editor with unsaved edits: your edits win. The agent can propose its change instead.
- A path that exists already, for
create_file. It never writes over a file. - A commit that would take more than the agent named: when other changes are staged already,
commitrefuses them unless the agent passesinclude_staged: true, and the window then lists them as “staged already”. A commit is also refused during a merge, rebase, cherry-pick or revert, and on a detached HEAD. Folders and secrets files can’t be staged. - Settings outside the list: never “Let agents control Next Term”, the IDE links, updates or keyboard shortcuts.
- Next Term’s Secrets folders:
Secrets.noindex, and theSecrets-<date>.old.noindexfolders Start Over… keeps, are refused for reading and writing, even with your home folder open as a project. - Your own pane: an agent cannot close the pane it runs in.
Adding tasks
Section titled “Adding tasks”One more tool leaves a task for you, or for tomorrow’s agent session: a Markdown file in the project’s todo folder, or the same task where the project sends its tasks:
| Tool | What it does | Changes anything? |
|---|---|---|
add_task | Adds a task: one new file in the project’s todo folder (todo/ unless you chose another in Settings › Tasks), with front matter (created, scheduled, branch, tab, agent) and a - [ ] line holding the title, its steps and notes. when is today, tomorrow (the default) or a date, YYYY-MM-DD; project defaults to the caller’s window’s, or the only one open. destination is project (the default: where you send this project’s tasks, such as Reminders, Things or a prefilled GitHub page) or todo_folder (always the todo folder); an agent can’t name any other place. The answer says where the task went, its title, steps and scheduled day, with the file’s path for the todo folder and "waiting_for_user": true for a page you still have to submit, or why nothing was added. | Only if you approve |
It asks in the same window as the tools above, showing the exact file it would create, or for another destination the line and the exact text that would leave, with stored keys masked as •••. A task bound anywhere but the todo folder is always asked about on the Mac itself, and Next Term makes no network request to send it; Decline and Stop Asking stops it too. Next Term fills the branch, the tab and its agent from the caller’s tab, never from its arguments. A call it can’t carry out, such as one with no project to put the task in, is refused at once, without a window. Claude Code finds add_task through its tool search, so it costs nothing in a session that never adds a task. See Agents add tasks.
MCP servers
Section titled “MCP servers”Two more tools connect MCP servers in Next Term, for every agent started in its tabs. Both are always listed, deferred, so an agent can add the first server, and they work for agents on this Mac only:
| Tool | What it does | Changes anything? |
|---|---|---|
list_mcp_servers | The MCP servers connected in Next Term: each one’s name, kind (local, a command, or remote, a URL), where it applies (all projects, some folders, or a project’s own .next-term/mcp.json) and its state: ready (with its tool count once it has started), failed (and why), off, off_here, needs_approval, not_reached (a server at a URL that speaks only the older HTTP+SSE transport), broken (and why) or shadowed, and for a server that signs in, needs_sign_in, signed_in (with its tool count once used), signed_out or needs_more_access (with the scopes it asked for). With the caller’s project, also what applies there. Never a key. | No |
add_mcp_server | Asks you to connect a server: name, and command (with args and env) for a local server or url (with headers) for one at a URL. Keys go by name in secrets: a command gets them through nxtrm secret run, a URL as its Authorization: Bearer header. A value that looks like a key is refused before anything is asked. project limits it to one open project; the default is every project. The window shows exactly what will run or be reached, which keys it uses and where it applies. | Only if you approve |
add_mcp_server is always asked on the Mac, and Undo in Settings › MCP Servers takes the server out again.
Once a server that can start applies where an agent works, three more tools come after Next Term’s own in that agent’s tool list, for the whole session. The agent’s session answers them itself, running the servers:
| Tool | What it does | Changes anything? |
|---|---|---|
mcp_servers | The servers that apply in the agent’s folder, each with its command or URL and its state: ready, running (with its tool count), failed (and why), off, needs_approval or remote (an older HTTP+SSE server Next Term doesn’t reach). A ready server also has direct_tools, how many of its tools the agent has as its own, or direct, why they aren’t. | No |
mcp_tools | A server’s tools; with tool, that tool with its full input schema; with query, the tools whose name or description has every word, across the servers. | Starts a server |
mcp_call | Calls a server’s tool with its arguments, and answers what the tool answered. A result over 100,000 characters is cut, and says so. | What the tool does |
A server starts the first time one of them needs it, in the agent’s folder; Next Term reaches a server at a URL itself. A new session also lists each server’s tools as its own, named <server>__<tool> (such as github__create_issue), up to 40 a session, from the session after a server’s first use. A call to one goes where mcp_call with its server and tool goes. See How agents reach the servers.
Importing settings
Section titled “Importing settings”Four tools let an agent bring your settings over from another editor or terminal, so it never reads those apps’ own files, which sit next to tokens, licence keys and account data. They work only for agents on this Mac. Claude Code finds them through its tool search when you ask for an import, so they cost nothing in a session that never imports.
| Tool | What it does | Changes anything? |
|---|---|---|
list_import_sources | The apps Next Term can import from. For each: an id, name, family (editors or terminals), version, whether the app is still installed, when it was last used, the shortcut set it suggests, what it can bring, and whether it was not used lately. Also the shortcut set in use and the last import with its undo_id. To find the apps, Next Term looks only at folders, dates and the apps’ version files, plus which keymap a JetBrains IDE uses, where its idea.properties moves its settings, and whether Terminal’s default profile was changed; no setting’s value is returned. include_targets adds the settings and commands an import can set. | No |
preview_import | What importing from a source would change, as the import window shows it: the shortcut set, your shortcuts (the key now and the new one), settings, recent projects, and what isn’t brought over with why. Each row has an id (preset, set:<setting>, key:<command>, recents) and says whether it starts ticked. changes_if_applied is the number the window’s Apply button shows. plan_id names the preview. With path and format (vscode-settings or vscode-keybindings) it reads a settings file in an open project instead. | No |
apply_import | Asks you to import. The import window opens with the rows the agent named ticked (items, or the preview’s ticked rows) and the rest unticked. | Only if you click Apply |
undo_import | Asks you to undo the last import, as Settings › Import › Undo Import does. It takes only the last import’s undo_id. | Only if you approve |
- The import window is the ask. It opens without taking the keyboard, under a banner naming the tab that asked (or saying it came from outside Next Term’s tabs), with the agent’s
reasonin its own words. When applying it would replace an earlier import’s Undo, the banner says so. You may tick or untick any row. Apply has no Return key, and the buttons are Decline and Stop Asking, Cancel and Apply N Changes. - The answer:
applied, with the rows you applied, the ones you ticked or unticked, what changed and theundo_id. Otherwise:declined;stopped;busy(another request is waiting, or you have the import window open yourself);up_to_date(nothing would change, so no window opens and the last Undo stays);changed_since_preview(the other app’s files changed since the preview).
- Waiting: with no answer in about 50 seconds the call answers
pendingwith arequest_idto call again with. The window stays open for 10 minutes, then closes as a decline. - A request you declined is declined at once until Next Term quits. Decline and Stop Asking also stops that tab’s other changes, as in Approving changes.
- Undo’s window names any imported setting you changed by hand since the import (recent projects are only taken back, so they are never named). An older
undo_idanswersstale_undo_id. - What an agent never gets: your home folder shows as
~, and the apps’ settings and storage folders are never named. Skipped settings are named, never their values. Colours and extensions come as a count, a key’s program or the text it sends is never shown, and anything that looks like a secret is masked. - A file the agent names follows read_file’s rules: inside an open project, no secret files, 4 MB at most, size checked before it is read. It never sets hidden files, where new tabs open or recent projects, since the agent may have written it. A project’s own
.vscode/settings.jsoncomes in unticked, since Next Term’s settings apply to every window.
Through an update or a quit
Section titled “Through an update or a quit”Next Term can bring its tabs back after an update or a quit (What comes back), and an orchestrator keeps working across the restart:
- Tab ids stay. A tab that comes back after an update, a quit, a crash or in safe mode keeps its id, so the ids an orchestrator holds name the same tabs. A tab whose id another tab already had gets a fresh one, and its note says so.
- Restored tabs say what happened. Until the first command you or an agent starts in a restored tab,
list_tabs,read_tabandwait_for_tabgive it arestoredobject. The shell’s first prompt and the restore’s own resume don’t end it. It holds:reason:update,quit,crashorsafe_mode;outcome, what the restore did:resume,agent_on_the_line,command_on_the_line,agent_note,agent_hint,command_note,not_kept,idle,reattachorfresh_connection, orcancelledwhen something was typed in the tab before its shell was ready;- for an automatic resume,
outcomereadspending, withplanned_outcome: "resume", until Next Term has watched the agent start (If an agent doesn’t start). It readsresumeonly once the agent started. A start that failed readsagent_on_the_line, with the agent’s error innoteandline_held: truewhile its plain resume command waits on the line. An agent that started another conversation readsnew_session, and one that ended within the watch with ⌃C, with status 0 or after a key you pressed, readsended; action:pendinguntil the tab’s shell is ready, or for an automatic resume until its start watch ends, thenapplied,cancelledordismissed;state_before, the tab’s state before the restart, such asworkingorattention, andinterrupted, whether the restart cut its work off;note, the tab’s note, once its action is done, andline_held: truewhile its prompt holds a line the restore put back.
- A line put back is yours.
send_to_tab,press_keysand the other tools that type are refused while a tab’s restore waits for its shell or watches its agent start, and while its prompt holds a line Next Term put back that you haven’t typed in since. No tool runs, edits or clears such a line. Type in the tab once, and they work there again. - Old questions are refused. A
question_idfrom before the restart never matches a question after it, even the same question in the same words. - Calls in flight get an answer. When Next Term quits for an update, each call it was serving answers “Next Term is restarting for an update”, never a timeout. A
wait_for_tabanswers withstate: "restarting"and, underplanned, what the update does to that tab. While Next Term restarts,nxtrm mcptries a tool that only reads again for about 20 seconds; a tool that changes something is not tried again, so nothing is done twice. - While an update waits for busy tabs (Wait for Them), input into the tabs it waits for still works, and
list_tabsmarks themupdate_wait: "waits_for_this_tab", and every other tabupdate_wait: "update_pending". Asking again for the answer to a request already open, with itsproposal_idorrequest_id, works too. Any other new work is refused withupdate_pendinguntil the wait ends. - In safe mode only the tools that read work, until you choose Keep As Is or Try Again.
- No tool touches the update or the quit. No tool can start, confirm, wait out, skip or cancel an update, choose Try Again, press a quit dialog’s button or set its checkbox. Those stay with you.
An nxtrm mcp that a client outside Next Term, such as the Claude desktop app, started under a version without these answers and retries keeps that version’s code until the client restarts.
Safe by design
Section titled “Safe by design”- Local only. The app listens on a Unix socket,
~/Library/Application Support/Next Term/mcp.sock, readable and writable only by you (mode0600). Every connection is checked to come from your user. There is no network port. - The same reach as your own shell. Anything that can connect can already run commands as you; the server gives an agent no power you have not given it by running it.
- Agents ask before they act, because typing into a tab, answering an agent’s question, opening tabs and closing them are marked destructive.
- Changes wait for you on the Mac: files, commits, panes, the layout, settings and tasks change only after you click Approve, and no answer is a no. So do your saved servers, a tmux session an agent ends, and herdr’s agents an agent starts or ends.
- MCP servers connect only after your Approve:
add_mcp_serverasks on the Mac, and keys stay in Secrets, by name. - Imports wait for your Apply in Next Term’s own import window, whatever the agent asked for.
- No tool returns a stored key’s value. Agents use keys in Secrets by name, after you approve with Touch ID or your password, and an import an agent asks for answers only the names imported and counts.
- Files are read and written only inside the open projects, and never the ones that hold secrets. A task goes only into the todo folder, which Settings › Tasks can put outside them, or to the destination you chose for the project, never one the agent names.
- An agent cannot type into its own tab or close it, nor type into its own herdr pane or end it.
- herdr’s agents start and end only after your Approve:
start_agent, andclose_tabon an agent’s id, ask on the Mac first. herdr’s sessions and servers are never stopped, and the pane tools refuse an agent’s id, so herdr’s panes are never split, closed or zoomed with them. - A busy tab closes only with
force, and the error says what is running. - Text is typed as a paste, so it is never run before the Return the tool presses.
- Off switch: Settings › Editor › Agents: “Let agents control Next Term”. Off, the socket closes and Next Term’s entries are removed from your agents.
More in Security and privacy.
Coming later
Section titled “Coming later”Coming later Remote access for agents that do not run on your Mac, such as ChatGPT and Claude on the web, through a secure link with its own, explicit security model.
