Sheprd Docs

Agents · Native chat

Native chat

An agent can run as a chat instead of in its own terminal interface. This page covers starting chats, moving a running terminal agent into one, reading what the agent does, and using chats on SSH hosts.

ShippedmacOS, Linux, Windows

How chats work

Chats run through sheprd-acp, a program shipped beside the app. It talks to the agent through the Agent Client Protocol inside an ordinary Herdr pane and draws the conversation there, and Sheprd draws the same conversation natively over that pane.

sheprd-acp is the agent's only client, so the Herdr TUI, a plain terminal, and every Sheprd window see one conversation. Both views stay live: a prompt or an answer from either shows in both, and the first answer to a permission request wins. Closing Sheprd leaves the chat running in its pane.

The built-in agents are Antigravity, Claude, Codex, Copilot, Gemini, Kimi Code, Muse Code, OpenCode, and Pi. Each has to be installed: agy acp, claude, codex and pi (which sheprd-acp drives without an ACP adapter), copilot --acp, gemini --acp, kimi acp, muse acp, or opencode acp. For Antigravity, verify agy acp --help shows ACP usage; an IDE launcher also named agy may not provide ACP. Sign in through the native ACP flow or agy acp --login. Use it as the interactive agent, not as another agent's backend or an automated outer loop. See Google's ACP guide and Terms. The model picker shows the models Antigravity makes available to your account and plan, including Gemini 4 Neon when offered by your agy version and entitlement.

For Muse Code, run muse acp --help on the chat host to verify that the installed build supports ACP, then sign in with muse login. Choose Muse Code in New Chat or run sheprd chat new muse. The chat uses the models, reasoning levels, and approval modes that Muse offers for the session. Meta’s ACP guide

When Antigravity advertises ACP authentication methods, Sheprd asks it to run its native sign-in flow, defaulting to oauth-personal. Set SHEPRD_ANTIGRAVITY_AUTH_METHOD in the chat environment to choose another advertised method, such as oauth-business, gemini-api-key, or agent-platform. Without an override, GEMINI_API_KEY selects gemini-api-key, and GOOGLE_CLOUD_PROJECT plus GOOGLE_CLOUD_LOCATION selects agent-platform. Set API keys only in a private environment, never a committed file. The agent handles authentication; Sheprd does not read or store its OAuth tokens. See Google's authentication methods.

Antigravity receives your prompts directly without Sheprd's prompt templates, memory notes, or device annotations. You can switch to or from Antigravity whenever the current agent is idle, and the agent taking over gets the conversation with your next prompt. If an Antigravity turn goes quiet after replying because a background command kept it open, Sheprd posts a hint after 10 minutes and cancels the turn after 1 hour without dropping queued prompts; set SHEPRD_ANTIGRAVITY_IDLE_TURN_SECS to change that ceiling, or 0 to disable auto-cancel.

Turning chats on and configuring them

ACP chats are on by default. Turn off ACP chats in Settings > General, or set acp_chats = false under [features], to go without them. While it is off, chat panes show their terminal and sheprd chat new exits with code 8.

The [chat] table holds the rest:

[chat]
layout = "bubbles"
render_existing = true

Layouts

The button in a chat's header steps through the layouts, View > Agent Layout picks one, and Settings > Chat offers them while ACP chats are on. What a chat does is the same in every layout. Timeline is the default.

Layout Value How it draws
Timeline timeline Entries on a line, with an avatar where the speaker changes
Bubbles bubbles Your messages in bubbles on the right, settings under the prompt box, as Claude's app does
Terminal terminal Claude Code's own screen, in the terminal font
Document document Each prompt a heading, with the reply as prose under it
Cards cards Each turn in one card
iMessage imessage Blue and gray bubbles with tails, like Apple's Messages
iA ia One column of about 70 characters a line, your prompts and the agent's steps as quiet notes, earlier turns muted
OpenCode opencode The terminal's font, tinted blocks for prompts and open tool calls, finished calls folded to one line

Set one from a script:

sheprd config set chat.layout bubbles

Once your prompt scrolls away, every layout pins it over the top of the conversation, cut to two lines. Click it to go back to the prompt.

Width

The default reading width is 800 logical pixels. In Settings > Chat, turn on Full-width chat or set Chat width with the slider; custom widths range from 320 to 4,000 and shrink to fit narrower windows.

sheprd config set chat.max_width 0     # full width
sheprd config set chat.max_width 1200  # custom width
sheprd config unset chat.max_width    # restore the default

Company endpoints

Variables in [chat.env] go into the environment of every chat's tab, on this machine or an SSH host. Settings > General edits them as NAME=value pairs while ACP chats are on.

[chat.env]
GH_HOST = "mycompany.ghe.com"
ANTHROPIC_BASE_URL = "https://llm.example.com"

Starting a chat

  • From a group's menu. A group's … menu lists New Chat with one row per agent. A row opens a tab named after the agent in the focused workspace, in the focused pane's folder.
  • With one click. Each tab strip offers a button per installed agent that starts its chat in a new tab; + still opens a terminal tab. [chat] launcher places the buttons: plus (the default, sliding out from under +), beside, leading, trailing, button (one button for the agent last started), or off.
  • From the command line. sheprd chat new AGENT does the same from a pane, and sheprd-acp claude starts a chat by hand in any pane. Run by a chat's agent, sheprd chat new with no agent starts one like that chat: the same agent, model, thinking level, and permission mode. The chat tells its agent so, so asking it to start an agent in a new workspace gets a chat rather than a terminal agent.

The rows and buttons show once the app has found sheprd-acp, first beside its own executable and then on the login shell's PATH.

In a Herdr 2 tab, the agent button next to the new tab button opens the chat in a tab of its own, in the same workspace and folder, as it does with Herdr 1. Starting one from the command palette or sheprd chat new splits the pane in use instead and runs the chat beside it, so a tab can hold several chats along with plain terminals. The chat view comes back after a restart and shows in every window that shows the pane. A chat in a terminal on another machine keeps its terminal view, as does a sheprd-acp started by hand in a Herdr 2 pane.

Moving a terminal agent into a chat

An agent running in its own CLI can move into a chat without leaving its pane or its conversation. Right-click its tab and choose Move Agent into Chat, run the same command from the palette with the agent's pane focused, or:

sheprd chat convert [--pane ID]

The agent's CLI stops, sheprd-acp --resume continues the same session in its shell, and the chat opens with the conversation so far and its context window use.

Agent Herdr 1 Herdr 2
Claude Yes, with its command line's flags, such as --model Local conversion reads the running process's Claude session record
Codex Yes Not yet
Copilot Yes Not yet
OpenCode Yes Not yet
Gemini No: Herdr reports no session for it Not yet
Pi No: nothing shows its earlier messages yet Not yet

For Herdr 1, Herdr must know the agent's session, which takes its integration: run herdr integration install claude (or codex, copilot, opencode), then restart the agent. This does not install session reporting for Herdr 2. Herdr 2's Claude path reads ~/.claude/sessions/<pid>.json and refuses a missing or mismatched record.

Only an idle agent moves. The agent is stopped with Ctrl+C alone, so nothing in its input is submitted, but text in its input is lost and whatever it ran in the background stops with it. If it has not stopped after 30 seconds, the move gives up and the agent keeps running.

The move continues the same session: nothing is sent to the agent as a new prompt. The chat opens at the agent's last prompt and reply, under a Continued from …'s earlier session line. On the desktop, Show N earlier turns above that prompt opens the rest of the conversation. A context compaction shows as Context compacted, with Claude's summary in its details, and slash commands typed in the terminal show as short notes.

Limits:

  • Herdr 1 conversion supports this machine or an SSH host, not Windows. Herdr 2 conversion is local; remote native chat attachment is not supported.
  • Claude's flags carry over, including --dangerously-skip-permissions. Other agents start with their default model and permissions, which the composer can change.
  • Claude and Codex show the last 8 MiB of their logs. Older messages stay in the agent's context.

Chats after a reboot

When Herdr restores its panes after a reboot or a server restart, a pane that ran a chat comes back as a shell in the chat's folder. Sheprd continues those chats itself: it types sheprd-acp --resume <session> <agent> into the restored shell, once, when that shell sits idle at its prompt in the chat's folder, and the chat view attaches with its earlier messages.

Limits:

  • Only Herdr 1 on this machine, on macOS and Linux. Windows, SSH hosts, WSL, cloud machines, and a daemon behind a custom socket are not continued.
  • Herdr 2 chats are not continued yet.
  • Only the built-in agents started without extra agent arguments. Custom commands, and a chat that kept Claude's flags, are not continued.
  • A chat Sheprd never saw live, or one started with --cwd in another folder, is not continued.
  • [chat.env] variables are not set again, since typing them would show them on screen.

Reading a chat

The header shows how long the running turn has taken, how full the context window is (yellow past 75%, red past 90%), and what the session has cost when the agent reports it. It also stops a turn and switches back to the pane's terminal. Buttons under it pick the agent's model, thinking level, and mode; the gear lists the rest. In the prompt box, / completes the agent's commands and Up recalls earlier prompts. During a turn, Enter or Send queues your message for the next turn. To steer an agent that supports it, click the curved arrow on the queued message. Hover over the arrow to see what it does, or click × to withdraw the message.

What the agent is doing

While a turn runs, the row above the composer says what the agent is doing, such as Editing server/purpose.ts… · 42s +1 more 11m 10s. Click it to list the running steps, each with its own time.

Tool calls

A folded tool call says what it did: the command, file, search, or sub-agent task. Click its header to open it. Commands show as shell, arguments as JSON, and edits as a red and green diff. Copy diff or Copy code copies what is drawn, and Copy original gives the exact payload. A diff compares only the text the agent reported, so its line numbers are not the file's.

Sub-agents and background shells

When the agent hands work to a sub-agent or leaves a command running in the background, the row says so, such as Writing… 12s · 2 sub-agents · 1 background shell. Once the agent is idle it keeps saying what still runs until everything ends. Click it for a table of each one and its state. A sub-agent's call is marked Sub-agent, with its steps inside its card.

Claude (run directly), Codex, and Claude through its ACP adapter report these, the adapter only for foreground sub-agents.

Messages and controls

Messages render Markdown and TeX: headings, lists, links, tables, Mermaid, code with syntax colors, inline and display equations, and attached images. Ctrl+-, Ctrl++ and Ctrl+0 change text size on Linux and Windows; macOS uses Cmd.

  • Selecting. Drag across text to select across messages, code, and tables. Tables copy as tab-separated cells, and formulas copy their TeX. Releasing the drag copies the selection, as in terminals; with Herdr's [ui] copy_on_select = false it waits for Cmd-C or Ctrl-C instead.
  • Pictures. A local image the agent links or a tool wrote shows in the chat, on SSH hosts too. A web picture shows as a card and loads only when you press Load, since loading it tells that server your address.
  • Code blocks. Each has Wrap and Copy code buttons. Settings > Chat sets whether blocks start wrapped (chat.wrap_code), with line numbers (chat.code_line_numbers), or with alternating line colors (chat.code_stripes); a block's own Wrap button still changes that block alone.
  • Pages. An html code block, or an HTML file a tool wrote on this machine, gets a Show page button. On macOS and Windows the page runs inside the message; on Linux the button opens your browser. HTML blocks in Settings > Chat (chat.render_html) starts an agent's html block as this card (default), with its page already loaded (always, macOS and Windows), or as code (never). Show code and Render webpage switch each block either way.
  • Permissions and questions. Chats answer permission requests and single-choice questions. Multi-question, multi-select, and free-text prompts are not supported by every agent.
  • Cards. A herdr-ui code block can render cards, choices, toggles, sliders, tables, and charts. Editing one only changes local state; nothing runs and no prompt is sent until you use an explicit action.

When you scroll up, the conversation stays put and a round button appears, saying New output below once more arrives.

What the agent is told

Besides your words, a chat tells the agent two things it cannot see, in a note ahead of your message that the chat itself does not show:

  • Your instructions. Instructions for every chat go in ~/.config/herdr/chat-prompts/instructions.md (under XDG_CONFIG_HOME when set, %APPDATA% on Windows), on the machine the agent runs on. The first message of each chat sends them, once: a chat restored after a restart does not send them again unless you edited the file. The file may hold up to 16 KiB; an empty file means no instructions. An older ~/.config/herdr/chat-system-prompt.md is still read only when instructions.md does not exist.
  • Where you are typing. The desktop app on the agent's machine or on another computer over SSH, the terminal pane's own chat view, or Sheprd's iPhone and iPad app or web app, along with how the phone reached the computer: the local network, Tailscale, or Sheprd's relay. The note goes again only when you switch devices, so moving from your desk to your phone and back mid-chat tells the agent each time, while a phone changing networks does not. Opening the same chat from the desktop app on another computer over SSH also counts, since paths are no longer yours to open.

Where you cannot open files on the agent's machine, as on a phone, the agent is asked to put pictures in the chat instead of giving a path: it saves a screenshot or a mockup as an image and links it, which attaches the picture to the message. HTML mockups are rendered to screenshots first.

Seeing what the agent was told

As sent in a chat's header shows the conversation as the agent received it: above each of your messages, the note that went with it, dimmed and in the terminal font, with Copy beside it. When the chat switched agents, the conversation handed to the new one shows there too. A message that went alone shows nothing more. Click As sent again to hide the notes. The agent's own system prompt, such as Claude Code's, stays inside the agent, so the chat cannot show it. A chat restored from an agent's log shows the notes the log kept.

Changing what the agent is told

Every part of the note is a template you can replace. Copy the built-in file from crates/sheprd-acp/prompts into ~/.config/herdr/chat-prompts/ on the machine the agent runs on and edit it; chats started afterwards use it, and an empty file brings the built-in text back.

File Sent when you are typing
intro.md Always first: says the note comes from Sheprd
desktop.md In the desktop app on the agent's computer
terminal.md In the chat view of the agent's terminal pane
remote.md Anywhere else that cannot open the agent's files, such as the desktop app over SSH
phone.md In the iPhone and iPad app or the phone web app

{{ name }} is replaced by a value:

Name Value
where Where you are typing, such as on their phone or tablet, in Sheprd's iPhone and iPad app, connected to this computer over Tailscale
device The app, such as Sheprd's desktop app
connection this computer, SSH, the local network, Tailscale, or Sheprd's encrypted relay
agent The agent's name, such as Claude
cwd The folder the agent works in
os The agent's operating system: macos, linux, or windows
max_pictures How many pictures one message attaches
max_image_mb The largest picture, in MB

instructions.md may use all but where, device, and connection, since it goes once wherever you are; it is filled in when sent, so {{ agent }} follows a switch to another agent. Before any client has said where you are, the place names read as an unknown Sheprd client. A name Sheprd does not know is sent as written, and the chat shows a warning, as it does for a file larger than 16 KiB or not UTF-8 text, which is then skipped for the built-in one.

Existing CLI sessions

With render_existing = true, Sheprd shows running Codex and Claude CLI conversations as a chat above their original terminal input, without restarting or replacing the agent. Typing, approvals, slash commands, and image paste stay with the CLI. Drag the divider above Agent input · same session to size the input, or choose Compact input.

This needs a Linux agent host. Only the tail of the log is shown, up to 8 MiB. sheprd chat show, hide, and toggle switch between the chat view and the terminal without starting or stopping the agent, and sheprd chat status --json reports the input mode and session ID.

Chats on SSH hosts

A Herdr 1 chat on a saved SSH host shows in the native chat view like a local one, over the same SSH connection Sheprd uses for Herdr. Starting a chat there runs the host's own sheprd-acp, looked for in ~/.herdr/bin, ~/.cargo/bin, ~/.local/bin, and then the remote PATH. Install it on the host with:

cargo install --locked --git https://github.com/sheprd-labs/sheprd sheprd-acp --root ~/.herdr

The menu offers only the agents installed on the host, as sheprd-acp agents lists them. Files dropped on a remote chat are copied to the host first. Without sheprd-acp on the host, the pane keeps its terminal view.

See the command line for every sheprd chat command, and the sheprd-acp README for the program itself.