Actions

Actions are configurable buttons that appear in the session UI, allowing you to trigger agent prompts or terminal commands with a single click. Each action is defined per-project and can operate in one of two modes: agent (sends a prompt to the active agent) or terminal (executes a command in the session terminal).

Configuring Actions

Actions are configured in the Project Settings section of the Settings panel (gear icon in the top-right corner). The Actions sub-section is collapsible and lists all available action types.

Each action type supports multiple named actions. For example, under the Run type you might create a "Dev" action and a "Debug" action, each with its own mode and prompt.

To add an action:

  1. Open Settings and navigate to Project Settings
  2. Expand the Actions sub-section
  3. Click the + button next to the action type you want to add
  4. Enter a name for the action (e.g., "Dev", "Debug", "Lint")
  5. Select a mode:
    • Terminal — runs the command text in the session terminal
    • Agent — sends the prompt text to the active agent
  6. Enter the prompt or command text
  7. Click Save

When multiple actions exist for a type, you can reorder them using the up/down arrow buttons. The first action in the list is the default and is marked with a "default" badge. You can also rename an action by clicking the edit icon next to its name.

To remove an action, click the delete icon (×). A confirmation prompt ("Delete? Yes / No") appears inline before the action is removed.

Available Action Types

Action TypeLocationDescription
CommitDiff report header, session context menuCommits the current changes
MergeSession context menuMerges session branch into base branch
Pull RequestPrompt input toolbar, session context menuCreates a pull request from the session branch
RunPrompt input toolbarRuns the application
BuildPrompt input toolbarBuilds the application
TestPrompt input toolbarRuns the test suite
BrowsePrompt input toolbarOpens the application in a web browser

Action buttons only appear in the UI when at least one action of that type has been configured. Commit, Merge, and Pull Request actions that are not configured show a disabled placeholder in the session context menu.

Multiple Actions and Split Buttons

When you define multiple actions for the same type, the UI displays a split button instead of a simple button:

  • The primary button (left) executes the first (default) action and shows its name
  • A disclosure chevron (right) opens a dropdown listing the remaining actions
  • Selecting an action from the dropdown executes it immediately

If only a single action is defined for a type, a regular button is shown.

Actions in the Session UI

Prompt Input Toolbar

The Pull Request, Run, Build, Test, and Browse actions appear as icon buttons in the prompt input toolbar, between the terminal toggle and the config options bar. Each button displays a distinctive icon:

  • Pull Request — Git pull-request arrow
  • Run — Play triangle
  • Build — Hammer and chisel
  • Test — Checkmark
  • Browse — Globe

Hovering over a button shows a tooltip with the action name and its mode (e.g., "Run" or "Test (agent)"). When a type has multiple actions, hovering over the split button chevron opens the dropdown after a short delay.

Diff Report Card

Commit actions appear in the header of the diff report card, which is displayed when the agent reports file changes.

  • If a single commit action is configured, its button is shown with the action's name (or "Commit" as a fallback)
  • If multiple commit actions are configured, a split button is shown:
    • The main button (left) executes the first (default) commit action
    • A disclosure chevron (right) reveals a dropdown with the remaining commit actions
    • Clicking outside the dropdown dismisses it

Session Context Menu

Commit, Merge, and Pull Request actions appear in the session context menu (kebab menu on each session item in the sidebar). The menu is structured as:

  1. Archive / Delete — Session management actions
  2. Divider
  3. Commit actions — All configured commit actions, disabled when there are no staged, unstaged, or untracked files in the worktree
  4. Merge actions — All configured merge actions, disabled when the session has no commits ahead of its base branch
  5. Pull Request actions — All configured pull-request actions, disabled when the session has no commits ahead of its base branch
  6. Status info — A summary showing commits ahead of the base branch and file change counts (staged, modified, untracked)

Commit, merge, and pull-request buttons start disabled when the menu opens and only enable once the worktree status has been fetched and confirms the action is relevant. If no actions are configured for a type, a disabled placeholder (e.g., "Commit (not configured)" or "Pull Request (not configured)") is shown.

Variable Substitution

Action prompts support variable substitution. The following variables are replaced at runtime with values from the session context:

VariableReplaced WithExample Value
$SRCThe session's worktree branch nameacp-session/20260411-143458-abc123
$DESTThe session's base branchmain
$LABELThe session's labeladd-support-for-pull-requests

These variables work in all action types and in both terminal and agent mode prompts. They are especially useful for merge and pull-request actions where you need to reference branches and session context.

Examples

ActionModePrompt
MergeTerminalgit checkout $DEST && git merge --no-ff $SRC
MergeAgentMerge branch $SRC into $DEST and resolve any conflicts
Pull RequestTerminalgh pr create --head $SRC --base $DEST --title "$LABEL" --fill
Pull RequestAgentCreate a pull request from $SRC into $DEST titled "$LABEL". Write a detailed description summarizing the changes.
CommitAgentCommit all changes on $SRC with a descriptive message

Action Modes

Terminal Mode

When an action is set to terminal mode, its behavior depends on where it is triggered from:

From the prompt input toolbar (Pull Request, Run, Build, Test, Browse):

  1. Opens the session terminal if it is not already open
  2. Sends the command text to the terminal, followed by a newline
  3. The command runs in the session's worktree directory

From the session context menu (Commit, Merge, Pull Request):

  1. Executes the command directly via a shell in the session's worktree directory
  2. Does not require the session terminal to be open
  3. For merge actions, the session branch is automatically restored after the command completes. If the branch restore fails, an alert is shown to warn you that the worktree may be on the wrong branch.

This is useful for commands like npm run dev, npm test, open http://localhost:3000, or git checkout $DEST && git merge --no-ff $SRC.

Agent Mode

When an action is set to agent mode, clicking its button sends the prompt text to the active agent as if you had typed it into the prompt input. The agent processes the prompt and responds accordingly.

Agent-mode actions support user command expansion. If the prompt text contains /command-name references (matching user-defined commands from the Commands section of Settings), they are resolved and expanded before being sent to the agent. For example, if you have a user command named commit with detailed commit instructions, setting the Commit action prompt to /commit will expand to the full command text.

Persistence

Action configurations are stored in the project's settings.json file alongside other project preferences:

~/.braide/projects/<project-id>/settings.json

Each action is stored as an object with the following fields:

FieldTypeDescription
idstringThe action type identifier (commit, merge, pull-request, run, build, test, browse)
namestring (optional)A custom display name for the action (e.g., "Dev", "Debug")
modestringEither "agent" or "terminal"
promptstringThe prompt text or terminal command

Multiple actions can share the same id — this is how you define multiple actions per type. The first action in the array for a given id is treated as the default.

Examples

Terminal Commands

Action TypeNameCommand
RunDevnpm run dev
RunDebugnpm run dev -- --inspect
Buildnpm run build
Testnpm test
Browseopen http://localhost:3000

Agent Prompts

Action TypeNamePrompt
CommitCommit/commit
CommitCommit & Close/commit then close the attached GitHub issue
MergeMergeMerge branch $SRC into $DEST and resolve any conflicts
Pull RequestCreate PRCreate a pull request from $SRC into $DEST titled "$LABEL". Write a detailed description summarizing the changes.
TestRun the test suite and fix any failures

Pull Request Actions (Terminal)

Action TypeNameCommand
Pull RequestCreate PRgh pr create --head $SRC --base $DEST --title "$LABEL" --fill
Pull RequestDraft PRgh pr create --head $SRC --base $DEST --title "$LABEL" --fill --draft
Pull RequestPR to Upstreamgh pr create --head $SRC --base $DEST --title "$LABEL" --fill --repo upstream-owner/repo

Pull-request actions work well with the gh CLI, which natively understands fork workflows and can create cross-repository pull requests. The --fill flag auto-populates the PR body from commit messages.

Merge Actions (Terminal)

Action TypeNameCommand
MergeFast-forwardgit checkout $DEST && git merge --ff-only $SRC
MergeMergegit checkout $DEST && git merge --no-ff $SRC
MergeSquashgit checkout $DEST && git merge --squash $SRC && git commit -m "Squash merge $SRC"

After a terminal-mode merge action completes, the session's worktree branch ($SRC) is automatically checked out again so the worktree remains on the correct branch.

In these examples, the Run type has two named actions ("Dev" and "Debug"), which appear as a split button in the toolbar. The Commit type also has two actions — "Commit" as the default and "Commit & Close" as an alternative in the dropdown. The Merge type shows three strategies as separate actions in the session context menu. The Pull Request type demonstrates different PR creation strategies, including draft PRs and cross-repository PRs for fork workflows.