mini-swe-agent: a 100-line coding agent that only uses bash
Added NewCopyable prompt below
Published Last verified Released
Our verdict
The best agent to read if you want to understand or build your own, and a solid terminal agent for scoped fixes. Because it only runs bash commands with a linear message history, you can see exactly what the model was told and swap the local shell for Docker or another sandbox in one setting. The project reports over 74% on SWE-bench Verified, but that depends on the model you plug in. It is not a polished daily driver like Claude Code: no IDE, no built-in PR flow, no permission rules beyond confirm or yolo mode. Pick it for hackability, sandboxed batch runs and model comparisons.
- Who it's for
- Developers who want a transparent, scriptable coding agent, and teams running agents in sandboxes or in batch over many issues or models
- Leverage
- A coding agent you can read in one sitting, run on any model and drop into Docker or CI, instead of a black box you have to work around
- Effort
- Low
- Date added
What mini-swe-agent does
mini-swe-agent (SWE-agent/mini-swe-agent, MIT, Python) is a minimal software engineering agent. The agent class is about 100 lines: the model proposes one bash command, it runs with subprocess.run (each command independent, no persistent shell session), and the output is appended to a single linear history. It has no other tools and does not rely on the model's tool-calling interface, so it works with any model through LiteLLM, OpenRouter, Portkey and others, including local models. The mini CLI starts in confirm mode (you approve each command), with /y for yolo mode, /u to type commands yourself and /c to go back. Environments include local, Docker/Podman, Singularity/Apptainer and Bubblewrap. It also ships batch SWE-bench inference, a trajectory browser and Python bindings. Version 2 changed the config format; the project has a migration guide. The README reports over 74% on SWE-bench Verified, and the SWE-bench bash-only leaderboard uses mini to compare models.
How builders use mini-swe-agent
- Try it without installing anything permanent: pip install uv && uvx mini-swe-agent, then pick a model in the first-run setup wizard (or run mini-extra config setup later).
- Give it a scoped task with mini -t "...", stay in confirm mode and approve each command until you trust the model.
- Switch the environment to Docker so commands run in a container instead of your machine, then use yolo mode inside the sandbox.
- Use the Python bindings (DefaultAgent with LitellmModel and LocalEnvironment) to build your own agent or run it from a script.
- Run the same task on two models and compare trajectories in the inspector to pick the cheaper one that still passes.
mini-swe-agent: limits and gotchas
- No tools beyond bash and no stateful shell, so each command starts fresh (cd, env vars and venv activation must be repeated in the same command).
- Yolo mode runs model commands on your machine without asking; use it only inside Docker or another sandbox.
- No IDE integration, PR workflow or fine-grained permission rules; you tell the model to do those things through bash.
- SWE-bench scores depend on the model you use, not the scaffold alone.
- v2 changed the config format; older v1 configs and guides need the migration guide.
mini-swe-agent compared with other tools here
- OpenHands: A fuller open coding agent with a web UI, more tools and cloud options; more to set up and less to read.
- Aider: Git-aware terminal pair programmer that commits each change; better for daily edits in a repo, less suited to sandboxed batch runs.
- Claude Code: Polished daily driver with permissions, hooks and subagents, but tied to Anthropic models and far bigger to reason about.
When to pick mini-swe-agent
- You want to understand exactly what your coding agent sends the model and runs.
- You run agents in Docker or batch them over many issues or models.
- You want a small baseline to fork and extend.
Copy this: Install + first task
# Official source: github.com/SWE-agent/mini-swe-agent (MIT)
pip install uv && uvx mini-swe-agent # try it in a throwaway env
# or: pip install mini-swe-agent && mini
# Missed the model setup wizard?
mini-extra config setup
# Always include the provider in the model name, e.g. anthropic/<model>
# Run a task (starts in confirm mode: Enter = run, type text = reject)
mini -t "Run the test suite, find the failing tests and fix them. Always make sure to test the final solution."
# In the session: /y yolo, /c confirm, /u type commands yourself
# Python
from minisweagent.agents.default import DefaultAgent
from minisweagent.models.litellm_model import LitellmModel
from minisweagent.environments.local import LocalEnvironment
agent = DefaultAgent(LitellmModel(model_name="anthropic/<model>"), LocalEnvironment())
agent.run("Write a sudoku game")Related discoveries
See the newest picks →- ToolCoding & Shipping Agents
OpenHands
Open-source, self-hosted control center for coding agents and automations, MIT-licensed.
Effort: High#Open source#Self-hostable
- ToolCoding & Shipping Agents
Cursor Cloud Agents
Run Cursor's agent in the cloud so tasks continue while you work on something else.
Effort: Low
Get the best new A.I. picks in your inbox
The best new agent workflows and tools we’ve vetted, with a clear verdict on each. Short, occasional, useful.