Repolode
SWE-agent

SWE-agent/mini-swe-agent

A minimal AI software engineering agent that solves GitHub issues or helps in the command line, using only bash and about 100 lines of core Python.

Open-source alternative to:Claude CodeCodex

Stars
8,664
Forks
1,201
Open issues
100
Last commit
8 hours ago

What is it?

mini-swe-agent is a small AI agent for software engineering tasks. It can work on GitHub issues or act as a command-line assistant. Its agent class is roughly 100 lines of Python, and it depends on no heavy frameworks.

The agent's only tool is bash. It does not rely on the model's tool-calling interface, so it can work with any language model that LiteLLM, OpenRouter or Portkey can reach. Each action runs through subprocess.run, so actions are independent of one another and can be moved into sandboxes such as Docker, Podman, Singularity/Apptainer or Bubblewrap by swapping the execution call. The message history is strictly linear, which makes runs easy to debug and to use as fine-tuning data.

The project ships a `mini` CLI, Python bindings, batch inference for SWE-bench, and a trajectory browser. It is built by the Princeton and Stanford team behind SWE-bench and SWE-agent.

Key features

  • 01Agent core is about 100 lines of Python with no heavy dependencies.
  • 02Uses bash as the only tool and does not require tool-calling support from the model.
  • 03Runs each action with subprocess.run, so execution can be sandboxed via Docker, Podman, Apptainer or Bubblewrap.
  • 04Works with models through LiteLLM, OpenRouter and Portkey.
  • 05Includes a CLI, Python bindings, SWE-bench batch inference and a trajectory browser.

Use cases

  • Running a quick AI coding assistant from the terminal against a local project.
  • Using a minimal, hackable agent as a baseline for agent or model research.
  • Evaluating language models on SWE-bench with a bash-only scaffold.
  • Running agents inside sandboxed containers for safer automated code changes.

Quick start

  1. 1

    Install and try the CLI in an isolated environment with uv

    pip install uv && uvx mini-swe-agent
  2. 2

    Or install the CLI and Python bindings in your current environment

    pip install mini-swe-agent
  3. 3

    Run the CLI

    mini

Things to know

  • Model access requires an API key or a compatible model endpoint, which the README does not detail beyond litellm and openrouter support.
  • Full SWE-bench-style runs and sandboxed environments need extra setup such as Docker, Podman, or Apptainer.

Topics

FAQ

What is mini-swe-agent?
A minimal AI software engineering agent that solves GitHub issues or helps in the command line, using only bash and about 100 lines of core Python. mini-swe-agent is a small AI agent for software engineering tasks. It can work on GitHub issues or act as a command-line assistant. Its agent class is roughly 100 lines of Python, and it depends on no heavy frameworks.
Is mini-swe-agent free to use? What license does it have?
mini-swe-agent is open source under the MIT license. Check the license terms before using it in commercial products.
Is mini-swe-agent still maintained?
Actively maintained. The last commit to mini-swe-agent was on Oct 19, 2026.
What can I use mini-swe-agent for?
Running a quick AI coding assistant from the terminal against a local project. Using a minimal, hackable agent as a baseline for agent or model research. Evaluating language models on SWE-bench with a bash-only scaffold. Running agents inside sandboxed containers for safer automated code changes.
How do I install mini-swe-agent?
Install and try the CLI in an isolated environment with uv: pip install uv && uvx mini-swe-agent Or install the CLI and Python bindings in your current environment: pip install mini-swe-agent Run the CLI: mini
Where can I get mini-swe-agent?
The source code and installation instructions are on GitHub: https://github.com/SWE-agent/mini-swe-agent

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects