AI Agents
SmartGit can run an installed Codex or Claude command-line agent with context from selected commits or refs. The agent uses its own authentication and execution permissions.
- Configuring an Agent
- Launcher Variables
- Starting a Conversation
- Reviewing Conversations
- Worktrees
- Sandboxing
- Prompts and Speech Input
- Deleting Sessions
- Related Low-Level Properties
Configuring an agent
- Install the agent and configure its authentication outside SmartGit.
- Open Preferences -> AI Integration -> Codex or Preferences -> AI Integration -> Claude and enable that integration.
- Configure Path and the command arguments. Codex uses one Arguments field; Claude uses New Arguments and Resume Arguments.
Auto-Configure can fill in Codex and Claude settings on Windows, macOS, and Linux.
It tries commands in PATH before common installer and package-manager locations, including Homebrew and npm.
Before executing each candidate’s check, SmartGit shows its path and test arguments.
Choose Probe to run the check, or Cancel to stop auto-detection without applying a configuration.
At startup, SmartGit also checks the filesystem for installed agents that have no configured Path. The notification offers Configure to open that agent’s preferences and start Auto-Configure. Choose Ignore to stop automatic checks for that agent, or close the notification to postpone checks for seven days. Manual Auto-Configure remains available.
Disable an agent on its own preferences page when you want to remove its run actions.
See Codex Preferences and Claude Preferences for the available settings.
Launcher variables
The Variables menus insert placeholders into the argument fields:
${repositoryRootPath}: the repository path used for the invocation.${model}and${reasoningEffort}: the selected model settings.${serviceTier}: the selected service tier (Codex only).${contextWindow}: the context-window size in tokens, available in Codex’s Arguments only.${sessionId}: the agent’s session identifier, when available.${environmentId}: the execution environment’s identifier.${agentConfigDir}: the agent configuration directory for that environment.${agentExecutionBranch}: the execution branch name.
Note
Custom argument templates can also use ${launcherAgentHomeDir} as an alias for ${agentConfigDir}.
Configure permissions through Sandboxing, rather than launcher arguments.
Starting a conversation
Select commits in the Graph and choose Run Codex… or Run Claude… from the context menu. In the Standard Window, these commands open a compact conversation pane beside the graph. They are also available for a ref in My History or All Branches + Tags. Enter a prompt and choose the model settings. Use Start conversation (the play icon) in the compact pane, or Send in the full view. The agent runs in the background. In the Log Window, the run commands open a separate Agent window. This window has one tab per repository. Each tab shows the number of running or unread conversations for that repository. Closing a tab leaves its agents running.
In the full conversation view, click New Agent conversation (+) beside Sessions to start from HEAD.
In either view, this resets the draft’s earlier branch or commit target.
If several agents are configured, choose one from the popup.
The draft appears above stored sessions with a gray status dot.
Select it to return to your prompt after viewing another session.
Codex and Claude keep separate prompt drafts.
Reviewing conversations
When the agent supplies a task summary with its initial response, SmartGit uses it in the session list and conversation header. Follow-up runs keep this summary. Without a summary, the session list shows the initial prompt.
Click a web citation in a Codex response to open its source in your browser. Links that SmartGit cannot open, such as local file links, appear in italics inside parentheses.
Status indicators in the session list and compact conversation selector show:
- A blinking blue dot for a running session.
- A filled green dot for a completed, unread result.
- A green outline for a completed result that has been read.
- A red dot for a failed, cancelled, or interrupted run.
Unread titles appear in bold in the session list and compact conversation popup.
In the Standard Window, repository tabs show a robot badge for running or unread conversations. A blue badge means that at least one agent is running. When all runs have finished, red indicates unread failures and green indicates other unread results. With multiple running or unread conversations, the badge includes a count.
In the full view, Send starts a conversation or sends follow-up instructions to a resumable session. While the agent is running and ready to accept instructions, Send sends them as steering input.
Use Stop to cancel a running agent. Work already performed remains.
In either conversation view, focus the prompt and press Ctrl+Enter (Command+Enter on macOS) to send it.
Compact conversations in History
In the Standard Window, select History, then Agents in the left accordion to keep a conversation beside the Graph.
Click New Agent conversation (+) to compose a prompt for HEAD.
If several agents are configured, choose which one to use.
Use the conversation selector at the top to switch conversations. It lists running conversations first, then unread finished conversations, then read conversations, with the most recently updated first in each group. Opening the selector marks the current finished conversation read. Choose More… or click Open full Agents view to open the selected conversation in the full view. The views share prompt drafts and model settings, and remember their conversation selections separately.
Right-click the conversation title or an entry in the selector popup for Mark as Unread or Delete….
The compact output shows only the latest run, with a prompt preview, assistant responses, and activity summaries. Output wraps automatically. The play icon’s tooltip shows Resume conversation for a resumable session or Steer conversation while steering is available. Use Stop conversation to cancel a running agent.
To copy the complete prompt, select its entire preview and choose Copy. Use Copy Markdown from the prompt’s context menu to keep its formatting.
Selecting a conversation reveals its execution branch in the Graph.
If the agent branch and HEAD have diverged, the graph compacts older linear HEAD history.
It keeps recent HEAD commits and the agent’s commits expanded, showing more HEAD history when space permits.
Use the graph controls to expand or collapse sequences.
Note
The low-level property ai.agent.compact.maxEntryCount limits the conversation picker (default 10, range 3 to 100, including More…).
Available screen space can reduce the number of rows further.
ai.agent.output.compact.promptMaxLength limits prompt previews and activity summaries (default 128 characters).
Previews also stop at the first line break; open the full view to read the complete prompt and activity details.
standard.graph.agent.headCommits sets the minimum number of recent first-parent HEAD commits kept expanded (default 3, minimum 1).
Full conversation view
Click Agents in the main layout selector to open the full view in the Standard Window.
With the conversation panel focused, press Ctrl+Shift+Enter (Command+Shift+Enter on macOS) to invoke Send.
The output has collapsible activity sections.
To wrap long lines, right-click the output and choose Wrap long lines.
Place the caret on a section heading and press Left to collapse it or Right to expand it.
Press Enter or Space to toggle it.
Choose Collapse All from the output’s context menu to close all expanded sections.
Adjacent tool invocations share an output section. Consecutive file changes and image views are also grouped by type. Failed or cancelled operations remain separate.
The Bash and Tool Uses section headers summarize recent commands and tool names, newest first. Consecutive Git commands and repeated invocations are grouped. Expand a section to see arguments and output.
For Codex, expand an Image View section to see the path of an image inspected by the agent.
Select output text and choose Copy from the context menu, or press Ctrl+C (Command+C on macOS).
Right-click an expanded section and choose Copy Markdown to copy its body as Markdown.
You can also paste the result as formatted text into applications that support it.
The Agents button’s badge counts running or unread conversations for the repository. In either conversation view, selecting a finished session or scrolling its output marks it read. When a run finishes while its conversation is visible, SmartGit marks the result read. To return to it later, select one or more sessions and choose Mark as Unread from the context menu. Use the agent properties to disable the completion beep.
Expand Launch Parameters in the conversation output to inspect the execution Branch and Working Tree path. The Local Session Area identifies the directory containing the stored session data.
Note
Reopened conversations may show Intermediate activity hidden for older runs.
Their complete output remains in the run-*.jsonl logs under Local Session Area.
Note
The low-level property ai.agent.output.commandSummaryCount sets the number of recent invocations summarized in a header (default 10, minimum 1).
The limit applies before grouping.
For Codex, expand a Sub-agent Activity section to see details of delegated work, including its thread ID and agent path.
If agents are still running when you exit SmartGit, the confirmation offers Stop Agents & Exit (Stop Agents & Quit on macOS). SmartGit stops the agents and waits for their processes to exit before closing.
Worktrees
Agents use a dedicated SmartGit worktree by default. The Run Codex in a dedicated SmartGit worktree or Run Claude in a dedicated SmartGit worktree option controls this on the agent’s preferences page. The restricted sandboxing profiles require this option to be enabled.
A new managed conversation creates an agent/ branch in the dedicated worktree.
It starts from the target branch’s tip at launch or the first selected commit.
The user’s original checkout stays on its branch.
Follow-up runs reuse the conversation’s worktree and execution branch.
If the agent advances the branch, SmartGit retains it and associates the conversation with its new tip.
If a newly created branch stays at its initial commit and its worktree is clean, SmartGit removes that branch and its worktree after the run. If the worktree contains local changes or untracked files, SmartGit keeps both for review, and the run can still finish successfully. Use Delete… to clean up a stored conversation and its managed worktree. The worktree must be clean before it can be removed.
Sandboxing
Choose a Sandboxing profile on the agent’s preferences page:
- No restrictions (approval_policy=on-request, approvals_reviewer=auto_review) for Codex or No sandbox (permission-mode auto) for Claude leaves permissions to the agent’s automatic permission handling.
- Write access restricted to workspace restricts writes while keeping the backend’s normal network rules.
- Write access restricted to workspace, network basically disabled for Codex or Write access restricted to workspace, network disabled for Claude adds network restrictions.
The profile with network restrictions is the default and is selected by Auto-Configure. For native Windows Claude, Auto-Configure selects No sandbox instead and asks you to acknowledge the lack of filesystem and network isolation. Both restricted profiles require a dedicated SmartGit worktree.
Codex’s restricted profiles require a native app-server invocation.
Claude’s sandbox requires macOS, Linux, or a supported WSL2 launcher; it is unavailable on native Windows.
Claude’s profile with network disabled requires Claude Code 2.1.219 or newer.
Configure permissions through Sandboxing, rather than through Arguments, New Arguments, Resume Arguments, or Cleanup Arguments.
For older configurations, remove sandbox and approval options such as approval_policy, sandbox_mode, or --permission-mode, or reapply Auto-Configure.
SmartGit rejects these options even when No restrictions or No sandbox is selected.
Note
Restricted profiles allow writes to the repository’s common Git directory, so refs and repository metadata remain shared with other worktrees.
Codex declines requests for command or file-change approval beyond the configured profile.
Its network restriction does not disable its separate web-search capability.
Claude’s operating-system sandbox covers Bash commands and their child processes; its built-in file tools use Claude’s permission rules.
The Claude profile with network disabled also blocks WebFetch and WebSearch.
These network restrictions do not disable the connection to the AI service.
Note
The sandboxing key in each backend’s ai.yml section accepts no-sandbox, profile-write-restricted, or profile-write-restricted-no-network.
Codex’s Working Directory and Cleanup Arguments fields, under Custom containerized Codex, are intended for custom launchers.
Claude’s Cleanup Arguments field is under Custom containerized Claude.
Restricted profiles use the execution worktree as Codex’s working directory.
A custom launcher that manages its own permissions can use the low-level sandboxing overrides.
Prompts and speech input
The menu above the prompt shows the selected preset or model settings. In the compact pane, click the model summary to open this menu. Select a preset, or choose Configure… to open Model Settings. Set Model and Reasoning Effort (Codex) or Effort Level (Claude). The Model list contains the models used by the agent’s presets. You can also enter values supported by your installed agent and model.
For Codex, Service Tier offers <default>, auto, flex, and priority, or a custom value.
<default> clears any service tier saved with the conversation.
Context Window accepts a positive token count; <default> uses the model’s default.
In Model Settings, use the Presets menu to load or manage presets:
- Remember saves the current settings as a fixed preset with a generated name. You can use it to keep a predefined preset’s current settings or save a modified version of an existing preset.
- Set as Default chooses the initial settings for new conversations. The menu marks this preset with (Default).
- Forget removes the selected preset. To remove the current default, first set another preset as the default.
- Re-Add Defaults restores the predefined presets at the top of the list, keeping your fixed presets and chosen default.
Note
Preset management changes take effect immediately, even if you cancel Model Settings.
The Prompts menu lists submitted prompts for this repository and agent, newest first. Linked worktrees share this history. The menu also lists steering instructions for the current conversation and saved global prompts. Selecting a recent prompt changes the text and keeps the current model settings. A global prompt also restores its saved model settings, except when used to steer a running agent.
Choose Save as Global Prompt in this menu to reuse the current prompt and model settings in other repositories with the same agent. To remove it, load the prompt and choose Remove Global Prompt.
New agent configurations include these predefined rolling presets:
- Codex: GPT-6.2 Sol (
gpt-6.2-sol) withmaxreasoning effort, IDsol-max-rolling(factory default). - Codex: GPT-6 Luna (
gpt-6-luna) withxhighreasoning effort, IDluna-xhigh-rolling. - Claude: CLI model alias
sonnetwithmediumeffort, IDsonnet-medium-rolling(factory default). - Claude: CLI model alias
fablewithmaxeffort, IDfable-max-rolling.
These presets leave service tier and context window unspecified. SmartGit passes Claude’s CLI aliases to Claude without resolving them to fixed Anthropic API model IDs.
Rolling presets follow SmartGit’s preset definitions and can change with SmartGit updates. Fixed presets save their model identifier and settings. A saved identifier can itself still be a provider alias whose target changes upstream.
The preset marked Default initializes new conversations. Your chosen default can differ from the factory default.
Note
Use the prompt history limit to change how many submitted prompts are remembered.
The low-level property ai.agent.steeringHistory.maxCount sets the number of recent steering prompts shown in the menu (default 10, range 1 to 100).
Note
Agent settings are stored under codex and claude in ai.yml in SmartGit’s settings directory.
Each agent has its own presets list.
An id entry uses predefined settings that can change with SmartGit updates; a named entry keeps fixed settings.
Codex’s predefined IDs are sol-max-rolling and luna-xhigh-rolling.
Claude’s are sonnet-medium-rolling and fable-max-rolling.
To customize a predefined rolling preset, replace its id entry with a named fixed preset like those below.
Edit named entries to change their names or settings.
Move entries to change their order.
Use default: true on one entry to choose the initial settings for new conversations.
If no entry is marked, the first entry becomes the default.
Close SmartGit before editing ai.yml, and merge the examples into the existing agent sections.
Start SmartGit again to load the presets.
Example
Codex presets for a long context window and priority processing:
The contextWindow value is in tokens.
codex:
presets:
- id: sol-max-rolling
default: true
- name: Astra Long Context
model: gpt-6-astra
reasoningEffort: high
contextWindow: 1050000
- name: Luna Priority
model: gpt-6-luna
reasoningEffort: xhigh
serviceTier: priorityExample
Claude presets with low and high effort:
For Claude, reasoningEffort sets the Effort Level.
claude:
presets:
- id: sonnet-medium-rolling
default: true
- name: Sonnet Quick
model: sonnet
reasoningEffort: low
- name: Fable Thorough
model: fable
reasoningEffort: highNote
Fixed presets require name, model, and a supported reasoningEffort.
Codex also accepts a supported serviceTier and a positive integer contextWindow.
Unknown preset IDs are discarded.
An empty list or an invalid preset entry restores that agent’s predefined preset list.
Note
To customize prompts, create codex.md or claude.md in the same directory.
The file replaces the bundled template and must contain {{ prompt }} for your prompt.
Remove it to use the bundled default again.
Bundled templates include the execution branch and the selected ref or commit IDs.
They also request Markdown responses, lists instead of tables, and commit SHAs with at least 12 hexadecimal characters.
To supply a session title, ask for one to three keywords on the last non-empty line of the initial response, for example SUMMARY: repository cleanup.
Keep this line in plain text, without quotes or trailing punctuation.
Use {% if not followUpPrompt %}...{% endif %} to request it only for the initial prompt.
Note
Auto-detection uses CODEX_HOME and CODEX_INSTALL_DIR for custom Codex installations.
For custom package-manager locations, it uses HOMEBREW_PREFIX, HOMEBREW_CASKROOM, and npm_config_prefix or NPM_CONFIG_PREFIX from SmartGit’s environment.
Startup notification choices are stored under autoDetection in ai.yml.
To undo Ignore, set the agent’s codex or claude entry in its ignored section to false.
Click Dictate to start recording speech.
Click Stop on the same control to finish and insert the transcript into the prompt.
Alternatively, press and hold Dictate, then release it to finish.
SmartGit stops recording with a beep and starts transcription when the size limit is reached.
Speech input requires Built-In AI to be enabled.
It uses the first configured API provider of type openai, which must support audio/transcriptions with the gpt-transcribe model.
The transcription model is independent of the selected chat model.
SmartGit sends the recorded audio to that provider using its API credentials.
Note
The low-level property ai.agent.speech.maxRecordingBytes sets the maximum recording size in bytes, including the WAV header.
It applies to new recordings.
Keep it below your transcription provider’s upload limit.
Deleting sessions
To delete stored data, select one or more sessions and choose Delete… from the context menu. Stop a running agent first. The confirmation includes the session data and any dedicated worktree. If notes exist, Delete Git Note (or Delete Git Notes) is selected by default; clear it to retain the notes. Resolve local changes and untracked files in a dirty managed worktree before deleting the session. SmartGit retains commits on the execution branch.
Related Low-Level Properties
ai.agent.ui.beepOnFinish
Set ai.agent.ui.beepOnFinish to false to disable the beep when an agent run finishes.
The default is true.
ai.agent.output.autoCollapseLineLimit
An active output section is automatically collapsed when it exceeds this many lines.
The default is 10; set it to 0 to disable this limit.
ai.agent.promptHistory.maxCount
This controls how many submitted prompts an agent remembers for each repository’s Prompts menu.
The default is 10, and the permitted range is 1 to 100.
ai.agent.codex.disableSandboxing
Set ai.agent.codex.disableSandboxing to true when a custom launcher should manage Codex permissions instead of SmartGit’s sandboxing profiles.
SmartGit then ignores the stored profile, disables the Sandboxing controls, and passes sandbox and approval arguments through without validating or overriding them.
The default is false.
ai.agent.claude.disableSandboxing
Set ai.agent.claude.disableSandboxing to true when a custom launcher should manage Claude permissions.
SmartGit then ignores the stored profile, disables the Sandboxing controls, and passes permission arguments through without validation.
It also stops adding --permission-mode and --settings arguments.
The default is false.