mini-swe-agent is a minimal software-engineering agent from the team behind SWE-bench and SWE-agent. The agent class is about 100 lines of Python, with small additional modules for the environment, the model, and the run script, and it is built on the premise that a capable language model needs little scaffolding to be useful.
Three design choices follow from that. The agent has no tools other than bash and does not use the model's tool-calling interface, so it runs with any model and needs nothing installed in a sandbox beyond a shell. Each action is executed with subprocess.run rather than a stateful shell session, so running actions in a container is a matter of swapping subprocess.run for docker exec. History is linear: every step appends to the message list, so the trajectory and the prompt the model sees are the same thing, which suits debugging and fine-tuning. It scores above 74% on SWE-bench Verified and backs the bash-only SWE-bench leaderboard, Ramp SWE-Bench, the DeepSWE evaluation harness, and the ProgramBench benchmark.
Version 2 is current, with a migration guide from v1. Compared with SWE-agent, mini-swe-agent is suggested for a local command-line tool, a simple control flow, faster sandboxed benchmark runs, and fine-tuning or RL work that should not overfit to a scaffold; SWE-agent remains the choice for experimenting with tool sets and history processors.
Features
- mini CLI: an interactive agent for local tasks and GitHub issues
- Batch inference: runs SWE-bench style evaluations at scale
- Trajectory browser: inspects saved runs step by step
- Python bindings: DefaultAgent(LitellmModel(...), LocalEnvironment()).run("...") embeds the agent in your own code
- Environments: local, Docker or Podman, Singularity or Apptainer, Bubblewrap, contree, and more
- Models: any model through LiteLLM, OpenRouter, or Portkey, with /completion and /response endpoints and interleaved thinking
- Configuration: global settings plus YAML configuration files and a cookbook of extensions

