mini-SWE-agent
MIT-licensed 100-line Python coding agent: a language model driving bash with linear history, sandboxed locally or in Docker.

Dhanji Bhagat
Founder, Emiote
Fully hosted platform. Automated backups and SLA.
Not publicly disclosed (no managed cloud; model spend is direct to provider)
Private compute. Zero seat taxes; team runs ops.
Rough operating estimate: $0 on existing hardware; model tokens are pay-as-you-go to your provider
mini-SWE-agent is an open-source Python coding agent from the Princeton and Stanford team behind SWE-agent. Its agent class is about 100 lines: a language model driving bash commands with history and stateless subprocess execution. It runs locally or in Docker and Podman sandboxes, scores above 74 percent on SWE-bench verified, and ships as a CLI, batch runner, and Python library.
Scope and Currency
This review is based on the public repository (SWE-agent/mini-swe-agent, branch main, reviewed 2026-09-29): README.md, pyproject.toml, src/minisweagent/ layout (agents, environments, models, run scripts), LICENSE.md (MIT, verified via API metadata), and the docs site at mini-swe-agent.com. Repository metadata verified the same day: Python, 8,084 stars, 1,108 forks. I did not execute the agent. Benchmark figures below are maintainer-reported values, labeled as such. Note the repo warns this is v2 with a migration guide; the previous version lives on the v1 branch.
1. What It Replaces and Why It Matters
Coding agents accumulate scaffolds: custom tool definitions per operation, stateful sessions, history processors, config schemas. Each layer helps until it becomes the thing you debug. Nearby alternatives: the full SWE-agent with its Agent-Computer Interface and tool set, IDE-bound assistants such as Cline, and terminal pair programmers such as Aider. mini-SWE-agent takes the deletion position: no tools other than bash, no tool-calling interface required, linear message history, every action an independent subprocess.run. The maintainers name it the default choice over SWE-agent for command-line use, fine-tuning baselines, and benchmark evaluation. Good fit: engineers who want a readable baseline they can fork in an afternoon, and researchers who need the model (not the scaffold) to be the variable. Bad fit: anyone wanting tool-rich IDE integration or a managed product.
2. Architecture and Tech Stack Review
| Component | Source Evidence | Evidence Type |
| Agent class | src/minisweagent/agents/default.py (about 100 lines per README) | Repo tree plus docs (fact) |
| Environment | src/minisweagent/environments/local.py, plus docker, podman, singularity, bubblewrap backends | Docs (fact) |
| Model layer | src/minisweagent/models/litellm_model.py, OpenRouter and Portkey support | Repo tree plus docs (fact) |
| Entry points | mini CLI, batch inference, trajectory inspector, Python bindings | Docs (fact) |
| Config | Global config plus YAML configuration files | Docs (fact) |
| Tests | tests/ directory, codecov badge | Repo tree (fact) |
| License | MIT (LICENSE.md) | API metadata (fact) |
The design has three load-bearing choices. First, bash is the only tool, so any model works, even ones without function calling, and sandboxes need nothing installed beyond a shell. Second, history is linear: each step appends to the same message list the model sees next, which makes trajectories trivially debuggable and fine-tunable. Third, actions run via subprocess.run with no persistent shell, so swapping local execution for docker exec is a one-line change and parallel runs share nothing.
Bash-Only Loop
sequenceDiagram
autonumber
participant Dev as Developer
participant CLI as mini CLI
participant LM as Model (via LiteLLM)
participant SH as Sandbox shell
Dev->>CLI: mini "Fix issue #12"
loop Append to linear history
CLI->>LM: Full message history
LM->>CLI: Next bash command (plain text, no tool calls)
CLI->>SH: subprocess.run (local, Docker, Podman, or other backend)
SH->>CLI: stdout plus stderr plus exit code
end
CLI->>Dev: Final patch plus replayable trajectory
3. Visual Tour and Interface Proof

The screenshot shows the official quickstart page, which is admirably short: three install paths and a CLI invocation. The mark on this page is the official docs/assets/mini_square.svg, copied byte-identical. The wide banner variant in the same directory was verified and rejected for card use.
4. Total Cost of Ownership
| Dimension | mini-SWE-agent | Notes | | License | $0 (MIT, verified) | Commercial use permitted with notice | | Compute | $0 on existing hardware | Sandboxes reuse local Docker or Podman | | Model usage | Pay-as-you-go to your provider | Bash-only design works with any model, including cheap ones | | Maintenance | Your responsibility (about 100 lines of agent plus env backends) | Small surface, but v2 migration shows APIs move | | Data ownership | Your machines and trajectory files | Linear history is plain text, easy to store and audit | | Operational burden | Low | The lowest in this batch by design |
Infrastructure figures are labeled estimates. Token spend dominates, and the linear-history design means long runs resend the full transcript every step, so context cost grows with task length. Never assume self-running costs $0: the license is free, the tokens are not.
The Bad: What to Know Before Adopting
- Bash-only is a ceiling as well as a floor. Everything (file edits, test runs, git operations) goes through shell quoting, so paths with spaces, large outputs, and interactive prompts become failure modes that structured tools handle better.
- The 100-line claim covers the agent class, not the system. Environments, models, run scripts, configs, and the inspector are real code you inherit when you fork.
- Stateless execution loses shell state every step. Working directory, environment variables, and virtualenv activation must be re-established per command or baked into each invocation; the FAQ defends this trade explicitly, but the cost is yours.
- Linear history means the transcript only grows. Long tasks resend everything each turn, which raises token cost and risks context-window exhaustion exactly when the task gets hard.
- v2 broke from v1 with a migration guide. A project this young refactors its public surface, so pin versions in anything load-bearing.
- No approval gate, no diff review, no checkpoints in the core loop. The agent runs bash commands until done; containment comes entirely from the sandbox backend you choose.
Security Note
The threat model is one line: model-generated bash executed by subprocess.run. The sandbox backend is the whole boundary, so the backend choice is a security decision, not a deployment preference. Local execution runs agent commands with your user privileges; Docker, Podman, or bubblewrap backends contain filesystem and network reach. Never point the local backend at a checkout containing credentials, and never run trajectories from untrusted problem statements without a sandbox. Model API keys travel through LiteLLM environment configuration, and trajectory files record command output verbatim, so scrub logs before publishing: secrets printed to stdout persist in plain-text history.
Licensing
MIT License (LICENSE.md), verified via repository metadata. Commercial use, modification, and redistribution are permitted with copyright notice preservation. This is the cleanest licensing posture in the SWE family covered here: unlike its bench cousin with no license file, mini-SWE-agent grants rights explicitly. Verify the file at the official repository before commercial integration.
Quickstart and Deployment
Verified against the official README (all three install paths plus Python bindings):
pip install uv && uvx mini-swe-agent
pip install mini-swe-agent
mini
git clone https://github.com/SWE-agent/mini-swe-agent.git
cd mini-swe-agent && pip install -e .
mini
Python bindings (verified snippet shape from README):
agent = DefaultAgent(
LitellmModel(model_name=...),
LocalEnvironment(),
)
agent.run("Write a sudoku game")
No ports or extra environment variables were used beyond model provider keys. For batch inference, the inspector, and YAML configs, follow the official docs instead of improvising flags.
Who Should Use This
Good fit: researchers needing a clean baseline where the model is the variable; engineers who read code before running it and want the whole agent in their head; teams standardizing on Docker or Podman sandboxes with cheap models; fine-tuning workflows that consume linear trajectories. Bad fit: developers wanting IDE diffs and approval gates (see Cline or Aider); teams needing structured tool guarantees for tricky file operations; anyone allergic to pinning versions on a fast-moving v2 codebase.
Deeper Insight
The lesson is subtraction as engineering. Each removed layer (tool schemas, session state, history processing) deleted a failure class along with a feature: no tool interface means any model works, no session means sandboxing is trivial, linear history means debugging is reading. Most agent work adds capability; this project asks what capability costs and whether the model already provides it. When adopting any agent, list what the scaffold does that the model cannot; the shorter that list, the longer the system survives contact with new models.
What I Would Change
If I operated this system, I would add an optional transcript-compaction step that summarizes stale history past a token threshold (keeping the linear invariant for recent steps), and a dry-run mode that prints the next bash command without executing it, giving back a lightweight approval gate for untrusted checkouts. Both preserve the minimal design while bounding its two predictable costs: context spend and unattended execution. These are engineering opinion, not project fact.
Run the simplest agent that still scores
Evidence-led review: bash-only design, stateless execution, sandbox backends, and when mini beats its bigger sibling.
Fixed $199 fee · 100% vendor-neutral review · 3-day delivery guarantee
