Skip to content

Terminal and chat

Every terminal and chat tab belongs to a project or worktree. The tab inherits that context’s directory, provider defaults, profile, model routing, notification state, and saved layout.

  • Chat UI renders supported providers as a native conversation with markdown, tool activity, inline diffs, attachments, mentions, and app-level history.
  • Terminal runs a shell or provider’s native CLI interface in the worktree directory.

Choose the default under Settings → Agents, then select another supported provider or tool when opening an individual tab. Some providers support both surfaces; others are terminal-only. See Providers and models.

Many tasks use both: keep the agent chat beside a terminal for verification or a development server.

The terminal starts in the selected project or worktree directory. Use it to:

  • Run a provider CLI.
  • Build, test, lint, and inspect Git state.
  • Start a local server that is not configured as a named run target.
  • Run worktree-aware sc commands.

Terminal tabs support scrollback, output selection, and a context menu. Hover or right-click recognized URLs and file paths for actions such as Preview File, Copy Path, Open With, or browser navigation.

Useful defaults include:

ShortcutAction
Open a terminal
Open the tool picker
Toggle the right-panel terminal
Open a new shell tab from a non-terminal surface

Closing a running terminal can require confirmation, depending on Settings → General → Confirm closing a running tab. Closing the tab does not automatically discard its worktree changes.

Chat UI keeps the provider conversation next to the code and review state it affects. Depending on the provider, it can show:

  • Rendered markdown, code blocks, plans, and links.
  • Tool calls and command activity.
  • Inline file edits and diffs.
  • Approval, question, completion, and error state.
  • Provider-reported child or subagent activity.
  • Extension output previews, when the provider exposes them.

Capability varies by adapter. A provider’s terminal UI may expose controls that its Chat UI integration does not, and one provider may report richer tool or subagent state than another.

Type @ to mention a file in the active worktree. Attach files or paste logs, specifications, review feedback, and other temporary context.

Large pasted text may appear as staged context instead of inline text when the selected provider supports that transfer. The composer preserves the material while keeping the prompt readable. Review attachments and mentions before submitting; the provider receives only the context you send through that session.

See Files, mentions, and context for examples.

Chat UI can disclose the system or app instructions supplied alongside your message. Use that view when an agent follows an unexpected branch-naming, worktree, permission, or action rule.

Those instructions explain the session’s current policy. They do not replace repository instructions or the provider’s own system behavior, and terminal providers may present their instruction stack differently.

The provider header identifies the resolved provider, model, profile, and supported controls. A model or reasoning change applies immediately only when the active adapter supports live updates; otherwise it becomes the default for the next session.

Permission modes remain provider-specific. An agent can pause for approval even when its prompt was auto-submitted or dispatched in the background. Requests enter the notification queue when structured provider events are available.

For compatible providers, the tab’s view menu offers Switch to Chat View or Switch to Terminal View for an idle session without creating an unrelated task. This is useful when you want rendered review context first and the provider’s native CLI later, or the reverse.

The switch is available for Claude Code, Codex, Cursor, Grok, OpenCode, Pi, Oh My Pi, and Kimi Code when the provider has a usable resume target. A busy session cannot switch. If the app cannot validate the provider session, it disables the action instead of opening a fresh process that only looks related.

Inspect the tab and worktree after switching. The surface changes, but the session still belongs to the same task directory and review state.

For an idle Claude Code, Codex, Pi, or Oh My Pi session with a valid provider resume ID, open the tab’s view menu and choose Relaunch with hapi. The app checks both the Hapi installation and hub before enabling the action.

Choose Relaunch with normal terminal to move a Hapi-owned tab back to the provider’s standard terminal flow. If the action is unavailable, wait for the current turn to finish and confirm that Hapi is installed, hapi hub is running, and the provider session is resumable.

Some providers accept a follow-up while they are still working. When supported, submit the correction from the same Chat UI session and the app delivers it as mid-turn steering instead of starting an unrelated task. Claude’s noninteractive chat path supports this behavior; other providers depend on their own protocol.

If the current provider cannot steer mid-turn, stop it or wait for completion before submitting the next instruction. Never assume that text typed into a busy terminal provider was accepted merely because it appears on screen.

When a provider reports child work, Chat UI can show that activity under the parent task. Treat it as progress context: the parent session still owns the final result, approvals, and worktree diff.

Git actions dispatched in Background also remain visible through tab state and the notification inbox. Background means “do not focus an agent tab,” not “run outside this worktree” or “skip permissions.”

Activity status appears beside a tab title when a task is working, waiting, or ready for attention. Give a terminal or session a clearer title with:

Terminal window
sc tab title "Review Auth Changes"

When the last tab closes, the empty view offers agent, terminal, browser, and recent-work launchers. You can also drag a tab into an empty split. See Layout, sidebars, and PiP.

The app restores tab order, titles, split placement, and local conversation metadata. It resumes provider state only when that provider exposes a usable resume target and still has the corresponding local history.

If validation fails, the app opens a fresh provider session rather than presenting an unverified old one as live. Read Session history and restore for provider-specific limits.