Every time mini-swe-agent completes a run, it saves a trajectory file — a JSON record of everything that happened. This includes the full conversation between the agent and the model, every command that was executed and its output, API costs, timestamps, the final exit status, and any submitted output (such as a patch). Trajectories are the primary way to review, debug, and audit what an agent did. They can also be used as training data or as input to evaluation pipelines like SWE-bench.Documentation 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.
Where trajectories are saved
By default,mini saves the trajectory to last_mini_run.traj.json in your global config directory. The path to this directory is printed when you start mini.
To save to a custom path, use the -o/--output flag:
output_path in your config file:
Trajectory JSON structure
Trajectory files use themini-swe-agent-1.1 format (introduced in v2.0). The top-level structure has three keys: info, messages, and trajectory_format.
Full trajectory JSON structure
Full trajectory JSON structure
info object
The info object contains metadata about the run:
| Field | Description |
|---|---|
model_stats.instance_cost | Total cost in dollars for all API calls in this run |
model_stats.api_calls | Number of API calls made |
config | Full resolved configuration used for this run (agent, model, environment) |
mini_version | Version of mini-swe-agent that produced this file |
exit_status | Final status: Submitted, LimitsExceeded, or other terminal states |
submission | Final output or patch submitted by the agent, if any |
messages array
The messages array contains the full conversation in OpenAI chat format. Each message has a role and content, plus an extra field added by mini-swe-agent.
| Role | Description |
|---|---|
system | Initial system prompt with agent instructions |
user (task) | The task description sent to the model |
assistant | Model response, including the proposed command in a code block. The extra field contains actions (parsed commands), cost, and timestamp. |
user (observation) | The result of executing a command. The extra field contains returncode and timestamp. |
user (final) | The terminal message when the agent exits. The extra field contains exit_status and submission. |
When using tool-calling model classes (e.g.,
LitellmModel, the default), assistant messages include a tool_calls field instead of a text-embedded command, and observation messages use role: "tool" with a matching tool_call_id.trajectory_format
The trajectory_format field identifies the schema version. The current version is mini-swe-agent-1.1, introduced in v2.0.
Browsing trajectories with the inspector
mini-swe-agent includes a terminal UI for browsing trajectory files interactively. It is built with Textual and lets you step through each turn of a run, inspect messages, and navigate between multiple trajectory files.Inspector key bindings
| Key | Action |
|---|---|
h / LEFT | Previous step |
l / RIGHT | Next step |
j / DOWN | Scroll down |
k / UP | Scroll up |
H | Previous trajectory |
L | Next trajectory |
e | Open current step in jless |
q | Quit |
The preds.json format
When running batch evaluations (e.g., on SWE-bench), mini-swe-agent produces a preds.json file that aggregates results across all instances: