Chat & Sessions
Chat with AI agents and jump between sessions across every repository.

Session Picker
Every session in every repository is one search away. In a session, type /sessions (or /resume, /continue), or press Ctrl+X then L, to open the session picker. It opens on the Sessions tab; press Ctrl+S while the picker is open to cycle through Activity, Sessions, and Projects. On desktop, /sessions and the Sessions tool in the right tool rail open the same picker in the side panel.
Activity lists the sessions that need attention across every repository, in three groups:
- Needs input - waiting on a permission request or a question form.
- Running - the session, one of its shells, or one of its subagents is working.
- Recent - updated within the recent activity window (see Active work).
Subagent activity rolls up to its root session, and a session running in a worktree is listed under the repository that owns the worktree. Schedule worktree sessions appear only while they are running or need input. Selecting a row opens that session.
Sessions:
- This project / All sessions (
Ctrl+A) - tap the selected tab, or pressCtrl+Awhile it is open, to switch between sessions from the current project (including its worktrees, labelled with the worktree folder) and sessions from every repository, each tagged with its repository name. The choice is remembered. - Search - type to filter by title.
- Grouped by recency - sessions are listed under Pinned, Today, and then by day, and the session you are in is marked.
- Keyboard first - ↑/↓ (or
Ctrl+P/Ctrl+N) and Enter open a session;PageUp/PageDownjump ten rows. - Manage in place - press
Ctrl+Dtwice to delete the highlighted session, or use a row's ⋯ menu to pin, unpin, or delete it. Deleting the session you are in returns you to the session list.
Projects lists every repository; type to filter by name or branch, and pick one to switch to it.
Active work
The Sessions tool on the desktop tool rail opens the session picker in the side panel, on the same Activity, Sessions, and Projects tabs as the picker. Its rail button carries a count pill of the sessions that need input or are running, coloured for input.
- Needs input - waiting on a permission request or a question form. Selecting the row opens that session with the pending form ready to answer.
- Running - the session, one of its shells, or one of its subagents is working.
- Recent - updated within the recent activity window.
Subagent activity rolls up to its root session. A session running in a worktree is listed under the repository that owns the worktree and shows its worktree branch, and schedule worktree sessions appear only while they are running or need input. Sidebar repository rows and repository cards show a braille spinner while any of their sessions are active, in the info colour while running and the warning colour when input is needed.
The panel is docked beside the page on desktop: choosing a session keeps it open on the destination. Opened as a floating overlay, it closes on selection.
Recent activity window - Settings → General → Activity sets how far back the panel and the picker's Activity tab look: 15, 30, 60, 120, 240, 480, or 1440 minutes (default 30).

On mobile, the Sessions tab opens the session picker as a sheet with the same tabs; see Mobile.
Background Work
While a shell command or subagent is running, Move to background above the prompt lets it keep running while the session continues. The background tasks bar lists each background shell and subagent with its status:
- running - still working
- completed / failed - finished, using the shell exit code or the subagent outcome
- killed - you stopped the shell from the bar
- interrupted - the subagent was interrupted
- unavailable - OpenCode no longer knows the shell and the session has no completion notice for it
Shell rows can show live output and be killed; subagent rows open the child session. Statuses are reconciled when the connection returns, so work that finished while you were away is shown as finished. After a page reload, a shell you killed is shown as failed, which matches OpenCode's own notice for it.
The session's own status indicator reflects this too: while a background shell or subagent is still working, the composer scanner and the session's row keep showing Background tasks running even after the session itself goes idle.
Model Selection
Click the model name in the chat prompt area to open the quick model switcher, where you can switch models, mark favorites, and pick variants without leaving the chat. Switching agents applies that agent's configured model. See AI Configuration for the full reference.
Press Ctrl+R to cycle through your favorite models, or Ctrl+X then M to open the model switcher.
Favorites, recent models, and variant choices are stored in OpenCode's model.json in the same format the OpenCode TUI uses, so they follow you between the Manager and the TUI.
Slash Commands
Type / to see available commands. Matching is fuzzy: /tl finds /timeline, and typing three or more characters also searches command descriptions. With nothing typed, your five most recently used commands are listed first and tagged recent. Built-in commands are covered in the Quick Start. OpenCode's own commands, such as /init and /review, appear in the same list.
The Fork shortcut (unbound by default) opens the same message picker as /fork.
Custom Commands
Create your own commands in Settings → OpenCode Config → Commands:
name: review
description: Request a code review
template: |
Please review the following code for:
- Security vulnerabilities
- Performance issues
- Best practices
- Code style
$ARGUMENTS
Use with /review in chat. Use $ARGUMENTS for everything typed after the command, or $1, $2, … for individual arguments. A command can also set an agent, model, Top P, or Run as subtask. A custom command with the same name as a built-in command replaces the built-in.
Mentions
Type @ to mention a file, agent, or skill. Suggestions are tagged file, agent, or skill and fuzzy-matched; select one to insert it.
- Files - the selected file's contents are attached to the message. Only files picked from the list are attached; folders are not suggested.
- Agents -
@<agent>asks that agent to handle the request. - Skills -
@<skill>loads that skill for the message.
Multiple Files
You can mention multiple files in one message by picking each from the list:
@src/components/Button.tsx @src/styles/button.css
Can you refactor the Button component to use CSS modules?
Shell Commands
Type ! at the start of an empty prompt to switch the composer to shell mode (badge BASH). Enter a command and send it to run it in the session; its output appears in the conversation. Press Escape or delete the ! to leave shell mode.
Agents: Plan and Build
Pick the agent for your next message from the agent button in the composer, or cycle through primary agents with /agent or Shift+Tab in the prompt. OpenCode's two built-in primary agents behave as follows, and custom primary agents appear in the same list:
Plan (Read-Only)
- AI can read and analyze files
- AI cannot modify, create, or delete files
- Safe for exploration and planning
Build (Full Access)
- AI can create new files
- AI can edit existing files
- AI can delete files
- Use for implementation tasks
Permission modes
Control who answers OpenCode permission requests for a session. The shield button in the composer toggles between two modes:
- Ask every time (default) - each permission request waits for you in the permission dialog.
- Accept everything - every "ask" request is answered automatically.
The mode is owned by the backend, so a session in Accept everything keeps working while the browser is closed. Accept everything answers each request once and never saves a permanent rule, and it never overrides a deny rule. When you switch a session to Accept everything, requests already waiting are answered immediately.
Child sessions inherit the mode of their root session and cannot change it, and the composer toggle is disabled for them with an explanation. A session forked from another starts with the source session's mode, except that forks of scheduled runs stay Ask every time.
Sessions started by a scheduled run always use their schedule's own permission configuration; the composer toggle is disabled there with an explanation. Sessions created or forked by an agent through the ocm tool always start in Ask every time, regardless of the default, though an agent can still send follow-ups to a session you switched to Accept everything.
If Manager restarts or loses its connection to OpenCode, permission requests already waiting in Accept everything sessions are answered when it reconnects.
To change the default for new sessions, go to Settings → General → Sessions and pick a Default permission mode for new sessions. The default is stamped onto a session when it is created, so changing it only affects sessions created afterwards, never existing ones.
Auto-accepted requests send no push notification, so you are not alerted for a request the session answered itself.
The permission dialog shows the request in context: the tool or command, the session it came from, and the scope Allow Always would cover. When more than one request is pending it keeps showing the one on screen until it is answered, and otherwise prefers a request from the session you are viewing (or one of its subagent sessions) over the rest. Open session jumps to the session that asked.
If you answer a permission request or question that has already expired on the server — for example it was answered from another device — Manager shows Permission request expired (or Form expired) and removes it instead of showing an error.
Session goals
A goal keeps a session working on an objective until an auditor model decides it is done or blocked, without you sending follow-up messages.
Arm goal mode with the target button in the composer, then send your message. That message becomes the goal objective, and it is sent to the session as usual. Goals cannot be started on scheduled-run sessions or subagent (child) sessions, and the goal button is disabled there. If you arm a goal and send while the agent is still responding, the message is queued and the goal starts; auditing begins after that queued turn. While a goal is active, each time the session goes idle the auditor decides the next step:
- done - the objective is verifiably achieved, and the goal completes.
- blocked - the agent needs a decision or access it cannot obtain. Three consecutive blocked verdicts stop the goal as blocked.
- continue - the agent keeps working toward the objective.
The auditor only sees the objective and the agent's latest reply; it cannot run tools or read files. Automatic continuations are capped by Max automatic continuations, and you can also set a Token budget per goal to stop a goal once it has spent that many tokens. A failed turn stops the goal, an interrupted turn pauses it, a goal whose auditor cannot reach a verdict pauses with Audit failed (resume it once the auditor model works), and deleting the session stops it.
The goal is persisted and driven by the backend, so it survives closing the browser and a Manager restart: an active goal resumes auditing once the session is idle again.
A status bar above the message list shows the goal state, the objective (expand it to read it in full), the turn count, token usage, and the latest reason, with Pause (or Resume) and Cancel while the goal runs, and Dismiss once it has finished.
Goal settings live in Settings → General → Sessions:
- Goal auditor model - the model that decides whether the goal is done. Pick one from the list or type
provider/model; leave empty to use the OpenCode default model. - Max automatic continuations - how many times a goal may continue before it stops (1-200, default 20).
- Token budget per goal - stop once the goal has spent this many tokens. Empty means no limit.
Mermaid Diagrams
AI responses can include Mermaid diagrams that render automatically:
graph TD
A[User Request] --> B[AI Processing]
B --> C{Valid?}
C -->|Yes| D[Execute]
C -->|No| E[Error Response]
D --> F[Return Result]
Supported diagram types:
- Flowcharts
- Sequence diagrams
- Class diagrams
- State diagrams
- Entity-relationship diagrams
- Gantt charts
- And more...
HTML in replies is rendered but sanitized to GitHub's allow-list: scripts, frames, and event handlers are removed, while safe formatting and syntax highlighting are kept.
Markdown images in replies render inline. A local or absolute path inside the workspace loads through the file API, while http(s) links and data:image/* sources render as they are; click an image to open it full size.
HTML artifacts
Ask the agent for a self-contained HTML page and to show it, for example "build an interactive chart of the data in reports/q3.csv and show it with show_artifact". The agent writes one .html file and calls the ocm tool's show_artifact with a title and the file path; the page then renders inline in the chat in a sandboxed frame, with Reload and Open in new tab controls. Editing the file and reloading shows the new version, so the agent never resends the document.
- The file must be
.htmlor.htm, at most 5 MB, and inside the session's directory (a relative path is resolved against it). A path that escapes the directory, including through a symlink, is rejected. - Inline your own CSS and JavaScript; libraries can load from public CDNs. Scripts run in an opaque origin without the Manager's cookies or API access, and forms, popups, cookies, and local storage are blocked. Sibling
.jsand.cssfiles do not load.
Tool Calls
Consecutive file reads, searches, and web fetches are collapsed into one summary line such as Explored: 5 reads, 2 searches (Exploring: while they are still running), matching the OpenCode TUI. Click it to see the individual calls. A call waiting for permission stays visible even while its group is collapsed. Turn grouping off with Group exploration in Settings → General; Expand tool calls opens groups by default.
Change Walkthroughs
Open a walkthrough with /walkthrough, the Walkthrough tool (on desktop, from the tool rail on the right edge, which opens docked in the side panel; on mobile, More → Workspace → Walkthrough, which opens full screen as "Change walkthrough"), or the Walkthrough button on multi-run entries and fusions (which opens a sheet).
You can also ask the agent, for example "walk me through what changed". It calls the ocm tool's open_walkthrough action, which starts the walkthrough for that session (optionally for a specific source) and waits until it is ready. On desktop the docked panel opens by itself once the walkthrough is ready; on mobile, tap Open walkthrough on the tool call in the chat.
Choose what to walk through with the source picker in the header: This session (the default), Uncommitted, Staged, Unstaged, Branch vs base, or Pull request. Branch vs base and Pull request show a Base branch field (empty means the default branch); Pull request also needs a Pull request number. A pull request is fetched from upstream (or origin) only when you generate, using the repository's stored credentials; it needs a remote that publishes refs/pull/<n>/head (GitHub style).
Click Generate walkthrough. Each request spawns a separate walkthrough agent session, titled Walkthrough · <title>, in the same directory, with repository edits denied outside its own output folder. The agent reads the changes through the ocm tool's walkthrough_changes action and publishes a self-contained HTML walkthrough with publish_walkthrough. While it works the panel shows "Building the walkthrough in a separate session…" with Stop and Open walkthrough session, and it renders the walkthrough as soon as the first version is published, continuing to refine and republish it. A run that has not published within 15 minutes fails.
The published walkthrough shows with Reload, Open in new tab, and Open walkthrough session. The refine box below it asks the walkthrough agent for a change and is disabled while the agent is working.
Lock files, snapshots, minified files and source maps are never sent to the agent as text; the outline lists them as mechanical files with +/− counts. Binary files, renames/mode changes without content, and files that do not fit the budget are listed as omitted.
Walkthroughs are saved per session and per source. When the changes move on, a banner "Changes have been updated since this walkthrough was generated" offers Update walkthrough. Regenerate (refresh icon in the header) starts from scratch in a new walkthrough session.
Model: Settings → General → Change walkthrough → Walkthrough model. It sets the model of the walkthrough session that builds the walkthrough UI; empty means the session's model, or the OpenCode default. A small, fast model works well.
Session Management
Switching Sessions
Use the Session Picker to jump to any session in any repository without leaving the chat.
Viewing Sessions
Access your sessions from the sidebar:
- Sessions are organized by repository; the current repository is expanded and one repository is open at a time
- Pinned sessions appear first, followed by the most recent sessions
- A live indicator marks sessions that are working, retrying, or compacting
- All sessions opens the repository's full session list when it has more sessions than the sidebar shows
- Repositories that are still cloning, or whose clone failed, show Repository not ready until they are ready
- On desktop, type in the sidebar search box to search sessions across all repositories as you type; a repository whose name matches shows its recent sessions. Press Escape or empty the box to clear
- Click a session to resume

Searching Sessions
Find sessions by title:
- Type in the always-visible Search sessions... box in the sessions panel
- Results filter as you type
Pinning Sessions
Pin important sessions to the top of the list. See Session Pinning for details.
Deleting Sessions
Remove sessions you no longer need:
- Swipe a session left to reveal the delete button, then tap it
- Or click the Manage sessions icon and use the trash button on a session
- Or press
Ctrl+Dtwice in the session picker - Confirm deletion
Bulk Delete
Remove multiple sessions at once:
- Click the Manage sessions icon in the sessions panel
- Check the sessions to delete
- Click Delete
- Confirm deletion
Context Management
Sessions maintain context of your conversation. As context grows, you may need to manage it:
Compacting Context
Use /compact to reduce context size:
- Summarizes earlier messages
- Preserves important information
- Frees up context for new messages
Starting Fresh
Use /new to start a new session when:
- Context is too large
- Topic has changed significantly
- You want a clean slate
Keyboard Shortcuts
Composer keys
These keys apply while the composer is focused:
| Shortcut | Action |
|---|---|
Enter | Send on mobile, or run a complete slash command; otherwise a new line on desktop |
/ | Open command suggestions |
@ | Mention a file, agent, or skill |
! | Shell mode (at the start of an empty prompt) |
↑ / ↓, Enter | Move through and pick a suggestion |
Escape | Close suggestions; otherwise interrupt the running response, or clear the prompt (or leave shell mode) when idle |
App shortcuts (desktop)
| Action | Default |
|---|---|
| Send message | Cmd+Enter (Ctrl+Enter outside macOS) |
| Interrupt the running response | Escape |
| Clear prompt (macOS) | Ctrl+C |
| Next agent (prompt focused) | Shift+Tab |
| Cycle model variant | Ctrl+T |
| Cycle favorite models | Ctrl+R |
| Scroll messages half a page up / down | Ctrl+U / Ctrl+D |
| Read aloud the messages on screen (press again to stop) | leader S |
| Undo / redo | leader U / R |
| Compact session | leader C |
| Timeline | leader G |
| Export session (Markdown) | leader X |
| Select model | leader M |
| Session picker | leader L |
| Switch session picker tab | Ctrl+S (only while the picker is open) |
| New session | leader N |
| Close session (back to list) | leader W |
| Toggle Files panel | leader B |
| Toggle terminal | leader T |
| Fork, Toggle Source Control, Settings | unbound |
The leader key is Ctrl+X on every platform, matching the OpenCode TUI; press it, then the letter within two seconds. Open Settings → Keyboard Shortcuts to rebind keys, clear them, or switch an action between leader and direct. Import from OpenCode TUI reads your cli.json (or legacy tui.json, usually in ~/.config/opencode) in the browser and maps its keybinds; conflicting defaults are unbound and the toast lists what was unbound or skipped. While a terminal is focused, only the leader key and the terminal toggle are intercepted. Keyboard shortcuts are not available on mobile.
To edit a message, use the edit action on the last user message while the session is idle.