The minimal AI software engineering agent: about 100 lines of Python, bash as its only tool
open sourceMITself-hostablefree
mini-SWE-agent is a deliberately small AI coding agent from the Princeton and Stanford team behind SWE-bench and SWE-agent, which it supersedes as their recommended default. Its agent class is about 100 lines of Python, its only tool is bash (so it needs no tool-calling support and works with any model through LiteLLM, OpenRouter or Portkey), each action runs as an independent subprocess, and its history is strictly linear, which makes it easy to sandbox, debug and use as a baseline for benchmarks, fine-tuning and reinforcement learning. It runs as a command-line agent in your shell, in batch over SWE-bench with Docker, Podman, Singularity or Bubblewrap, and has a trajectory browser. MIT licensed, it scores over 74% on SWE-bench Verified.
Problems it solves
- a coding agent simple enough that I can read its whole control loop in a few minutes
- run an AI agent that fixes GitHub issues with any model, even ones without tool calling
- a baseline agent scaffold for SWE-bench evaluations that doesn't overfit to special tools
- run thousands of agent trajectories in Docker or Podman sandboxes for benchmarks or RL
- generate clean, linear agent trajectories for fine-tuning a model
- a lightweight coding agent in my terminal that starts faster than the big ones
- build my own coding agent on a tiny hackable core instead of a giant framework
Features
- agent class of about 100 lines of Python
- bash is the only tool: works with any model, no tool-calling needed
- every action runs as an independent subprocess
- linear message history, identical to the trajectory
- local, Docker, Podman, Singularity/Apptainer, Bubblewrap and other environments
- models through LiteLLM, OpenRouter, Portkey and more
- interactive CLI and batch inference on SWE-bench
- trajectory browser
- scores over 74% on SWE-bench Verified
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what mini-SWE-agent does.
- SWE-agent Lets your language model of choice autonomously fix GitHub issues and other tasks with tools
- GitHub Copilot Move from a single task to a project spanning repositories without losing context.
- Cursor Cursor is your coding agent for building ambitious software.
- OpenHands Open platform for AI software development agents that plan, write and ship code changes end to end
- Claude Code An agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools
- Gemini CLI An open-source AI agent that brings the power of Gemini directly into your terminal.
