YAML configuration files give you precise control over how mini-swe-agent behaves. Rather than passing many flags on every invocation, you write a config file once and reuse it. Configs are especially useful when you want to customize prompt templates, set cost limits, change the action parsing format, or target a specific execution environment. The defaultDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/swe-agent/mini-swe-agent/llms.txt
Use this file to discover all available pages before exploring further.
mini CLI uses a built-in config file called mini.yaml. You can override it — or layer additional settings on top of it — using the -c/--config flag.
Passing a config file
-c arguments are merged recursively, with later values taking precedence.
Top-level config keys
A config file uses four top-level keys:Agent configuration
Theagent section controls the agent’s behavior, prompts, and resource limits.
| Field | Type | Description |
|---|---|---|
system_template | string | Jinja2 template for the system message sent to the model. |
instance_template | string | Jinja2 template for the first user message (the task). |
format_error_template | string | Template sent back to the model when action parsing fails. |
step_limit | integer | Maximum number of steps before the agent stops. |
cost_limit | float | Maximum cost in dollars for a single run (0 = no limit). |
wall_time_limit_seconds | integer | Maximum wall-clock time in seconds for a run. |
output_path | string | Path to write the trajectory JSON file. |
mode | string | Starting mode: confirm, yolo, or human. |
Jinja2 templating
Prompt templates use Jinja2 syntax. Include variables with double curly braces:| Variable | Source |
|---|---|
task | The task string passed to the agent at runtime |
step_limit | From agent config |
cost_limit | From agent config |
output | Output of the last action execution (has .output and .returncode) |
| Agent config fields | Any field set under agent: in the config |
| Environment config fields | Any field set under environment: in the config |
| Environment variables | Available in LocalEnvironment only |
Action parsing
By default, mini-swe-agent parses actions from fenced code blocks taggedmswea_bash_command:
action_regex under model: and updating your prompt templates to match. The regex must capture the command in its first group.
Example: XML action format
Example: XML action format
This config uses When writing
<action> tags instead of markdown code blocks. All templates must be updated to match so the model wraps commands consistently.action_regex in YAML, keep the regex on a single line and do not use quotation marks. You do not need to escape characters. For example:Global configuration (environment variables)
Global settings apply across all runs and can be set as environment variables or in the.env file in your config directory. Environment variables take precedence over .env file values.
| Variable | Description |
|---|---|
MSWEA_MODEL_NAME | Default model name (e.g., anthropic/claude-sonnet-4-5-20250929) |
MSWEA_GLOBAL_COST_LIMIT | Global cost cap in dollars across all runs (0 = no limit) |
MSWEA_GLOBAL_CALL_LIMIT | Global limit on total model API calls (0 = no limit) |
MSWEA_CONFIG_DIR | Additional directory to search for config files by name |
MSWEA_MINI_CONFIG_PATH | Default config file path for the mini CLI |
MSWEA_COST_TRACKING | Set to ignore_errors to suppress cost tracking errors (e.g., for free models) |
mini-extra config to manage these settings interactively: