mini-SWE-agent: The 100-Line AI Agent That Solves GitHub Issues and More

mini-SWE-agent Banner

What if Your AI Coding Assistant Could Fit in a Tweet?

Imagine an AI agent powerful enough to solve real GitHub issues, yet simple enough that you could read and understand its entire codebase during your morning coffee break. That’s exactly what mini-SWE-agent delivers—a revolutionary approach to AI programming assistance that proves sometimes less is truly more.

In an era where AI tools are growing increasingly complex, mini-SWE-agent stands out by doing something radical: it works with just 100 lines of Python code. Developed by the Princeton and Stanford team behind SWE-bench and SWE-agent, this minimalist agent achieves impressive results while maintaining remarkable simplicity.

The Evolution of Coding Agents: From Complexity to Clarity

Back in 2024, SWE-bench and SWE-agent helped kickstart the coding agent revolution. At that time, researchers placed significant emphasis on creating complex tool interfaces and specialized agent frameworks. The assumption was that to build a useful AI agent for software engineering tasks, you needed sophisticated infrastructure.

But here’s what we’ve learned in the past year: as language models have become more capable, much of that complexity is no longer necessary. In fact, it might even be getting in the way.

mini-SWE-agent represents a paradigm shift in how we think about AI coding assistants. Instead of building elaborate frameworks around the language model, it puts the model itself at the center and strips away everything unnecessary.

Why Simplicity Matters in AI Development

When you’re working on complex software projects, the last thing you need is an AI assistant that adds more complexity to your workflow. Consider these common frustrations with traditional AI coding tools:

  • Steep learning curves that require hours to understand basic functionality
  • Fragile dependencies that break when you update a single package
  • Opaque decision-making that makes it hard to understand why the agent did what it did
  • Complex sandboxing requirements that prevent safe deployment in production environments

mini-SWE-agent addresses all these issues through its radical simplicity. But don’t mistake simplicity for lack of capability—this agent solves 65% of GitHub issues in the SWE-bench verified benchmark using nothing more than Claude Sonnet 4 and a straightforward design.

The Core Philosophy: Less Code, More Impact

At its heart, mini-SWE-agent embodies three fundamental principles that set it apart from other AI coding assistants:

1. Minimalism as a Superpower

The entire agent logic fits in just 100 lines of Python code. When you add the environment, model, and script components, the total remains remarkably small—around 200 lines total. This minimal footprint provides significant advantages:

  • Transparency: You can actually read and understand the entire system
  • Debuggability: When something goes wrong, you can trace the issue quickly
  • Extensibility: Adding new features is straightforward on a simple foundation
  • Portability: The small size makes it easy to deploy anywhere

2. Power Through Constraint

Rather than trying to create custom tools for every possible scenario, mini-SWE-agent embraces constraints. It uses only one tool: bash. That’s right—this agent doesn’t even use the tool-calling interface of language models. Instead, it relies entirely on the model’s ability to interact with the system through standard shell commands.

This constraint-based approach yields surprising benefits:

  • Universal compatibility: Works with any language model that generates text
  • Zero dependency requirements: Needs only bash in sandboxed environments
  • Consistent behavior: No unexpected interactions between custom tools

3. Linear Thinking for Clear Results

Unlike many AI agents that maintain complex internal states or process history through multiple filters, mini-SWE-agent uses a completely linear approach to message history. Every step simply appends to the conversation history—what you see is exactly what the language model sees.

This linear history design makes debugging remarkably straightforward. When the agent behaves unexpectedly, you can review the exact sequence of messages that led to that decision. There are no hidden transformations or mysterious state changes to decipher.

How mini-SWE-agent Actually Works

Let’s dive into the practical mechanics of this minimalist agent. Understanding how it operates reveals why its simplicity is such a powerful advantage.

The Execution Model: Independence Over State

One of the most innovative aspects of mini-SWE-agent is how it executes actions. Rather than maintaining a stateful shell session (where each command builds on the previous one), it executes every action independently using subprocess.run.

This design choice has profound implications:

  • Stability: Each command starts from a clean state, eliminating unexpected interactions between steps
  • Sandboxing: Makes it trivial to run in secure environments—simply replace subprocess.run with docker exec
  • Scalability: Actions can be distributed across multiple environments without coordination overhead

As the project documentation emphasizes: “This is a big deal, trust me.” For developers concerned about security and reliability, this independent execution model provides significant peace of mind.

The UI Approach: Convenience Without Complexity

mini-SWE-agent comes with practical user interfaces that transform it from a research artifact into a daily development tool:

  • Simple CLI interface: The mini command works right out of the box
  • Visual mode: Run mini -v for an interactive experience that shows each step
  • Trajectory browser: Review and analyze the agent’s decision process
  • Batch inference capabilities: Process multiple tasks efficiently

These interfaces maintain the project’s minimalist philosophy—they add convenience without introducing unnecessary complexity. The visual mode, for example, lets you see exactly what the agent is doing at each step, making it easy to intervene if needed.

When Should You Use mini-SWE-agent?

With so many AI coding tools available, how do you know if mini-SWE-agent is right for your needs? The answer depends on your specific requirements and workflow.

Choose mini-SWE-agent if:

Your Need Why mini-SWE-agent Fits
Quick command line utility Works locally with minimal setup—install and go
Simple control flow Linear history and straightforward execution make behavior predictable
Secure sandboxing Easy to deploy in containers with no additional dependencies
Research applications Ideal baseline for fine-tuning or reinforcement learning without framework bias

Choose SWE-agent if:

Your Need Why SWE-agent Fits Better
Specialized tool requirements Offers extensive tool customization options
Advanced history processing Provides multiple history processor implementations
Configuration flexibility Powerful YAML configuration without code changes

The key insight here is that mini-SWE-agent isn’t trying to be everything to everyone. It’s specifically designed for developers and researchers who value simplicity, transparency, and direct integration with their existing workflows.

Getting Started with mini-SWE-agent

One of the most appealing aspects of mini-SWE-agent is how straightforward it is to get up and running. Whether you’re a casual user or planning to integrate it into your development pipeline, installation takes just moments.

Installation Options

mini-SWE-agent offers three clean installation methods to suit different preferences:

Option 1: Virtual Environment (Recommended for Most Users)

pip install uv && uvx mini-swe-agent [-v]
# or
pip install pipx && pipx ensurepath && pipx run mini-swe-agent [-v]

This approach keeps your system environment clean while providing immediate access to the tool. The virtual environment ensures no package conflicts with your other projects.

Option 2: Direct Installation

pip install mini-swe-agent && mini [-v]

For developers who already manage their Python environments carefully, this straightforward method installs mini-SWE-agent directly and makes the mini command available system-wide.

Option 3: Source Installation (For Contributors)

git clone https://github.com/SWE-agent/mini-swe-agent.git
cd mini-swe-agent
pip install -e .
mini [-v]

Installing from source allows you to modify the code and contribute back to the project. The -e flag creates an “editable” installation, so changes to the source code take effect immediately without reinstalling.

Basic Usage Patterns

Once installed, using mini-SWE-agent is remarkably simple. The core command structure follows this pattern:

mini "Your task description here"

For example:

mini "Write a sudoku game in Python"

This command will initiate the agent to work on your requested task. If you want to see the process visually, add the -v flag:

mini -v "Fix the login bug in my application"

The visual mode provides a step-by-step view of the agent’s thinking process and actions, making it easier to understand and verify its work.

Python API Integration

For developers looking to integrate mini-SWE-agent into larger systems or custom workflows, the Python API offers elegant simplicity:

from minisweagent.agents.default import DefaultAgent
from minisweagent.models.litellm_model import LitellmModel
from minisweagent.environments.local import LocalEnvironment

agent = DefaultAgent(
    LitellmModel(model_name="claude-3-sonnet"),
    LocalEnvironment(),
)
agent.run("Write a sudoku game")

This four-line example demonstrates the entire integration process—create the agent with your preferred model and environment, then run it with a task description. The API’s minimalism reflects the project’s overall philosophy.

Practical Applications in Real Development Workflows

The true test of any development tool is how well it integrates into real-world workflows. mini-SWE-agent shines in several practical scenarios that developers encounter daily.

Solving GitHub Issues

The most direct application is addressing GitHub issues. When you encounter a bug report or feature request, simply run:

mini -v "Fix the issue where special characters cause application crashes"

The agent will:

  1. Analyze the problem description
  2. Attempt to reproduce the issue
  3. Develop and test a solution
  4. Present the fix with appropriate context

This capability transforms how development teams handle issue tracking—turning what might be a time-consuming debugging session into an automated process.

Code Explanation and Documentation

Struggling to understand a complex codebase? mini-SWE-agent can help:

mini "Explain how the authentication module works"

The agent will analyze the relevant code and provide a clear explanation, making it invaluable for onboarding new team members or refreshing your memory on infrequently touched parts of the system.

Feature Implementation

Need to add new functionality? Describe what you want:

mini "Implement user profile picture upload feature"

The agent will generate the necessary code, respecting your existing patterns and conventions. While human review remains essential, this dramatically accelerates the implementation process.

Error Diagnosis

When faced with mysterious errors, ask:

mini "Why is my API request timing out?"

The agent will investigate potential causes, check relevant configurations, and suggest solutions—acting as an always-available debugging partner.

Why the Minimalist Approach Actually Works Better

At first glance, the idea of an AI agent with no tools beyond bash might seem limiting. But this constraint is precisely what makes mini-SWE-agent so effective. Let’s explore why.

Leveraging Language Model Strengths

Modern language models have been trained on vast amounts of code and technical documentation, including extensive shell scripting knowledge. By relying solely on bash, mini-SWE-agent taps directly into this knowledge base without intermediaries.

When you ask the agent to perform a task, it can use the full power of shell commands—grep, sed, awk, git operations, and more—without needing custom tool implementations. This approach recognizes that language models already understand these tools; they just need the right context to use them effectively.

The Sandboxing Advantage

One of the most significant benefits of the minimalist design is how effortlessly it integrates with containerized environments. Because mini-SWE-agent only requires bash, running it in Docker, Podman, Singularity, or Apptainer becomes trivial.

The project documentation highlights this critical advantage: “When running in sandboxed environments you also don’t need to take care of installing a single package—all it needs is bash.” This makes mini-SWE-agent uniquely suited for secure, production-grade deployments where environment control is essential.

Debugging Made Simple

In complex AI systems, debugging often becomes a nightmare of tracing through multiple layers of abstraction. With mini-SWE-agent’s linear history approach, debugging is remarkably straightforward:

  • The message history exactly matches what the language model sees
  • Each action executes independently with no hidden state
  • The entire system is small enough to comprehend at a glance

This transparency transforms what’s typically a frustrating process into something manageable—even for developers new to AI agent technology.

The Research Perspective: Why Minimalism Matters

For researchers studying AI agent capabilities, mini-SWE-agent offers a crucial advantage: it removes the agent framework as a variable. When evaluating language model performance, you want to measure the model’s abilities, not how well it works with a particular agent scaffold.

A Clean Baseline System

By stripping away everything except the essential interaction between the language model and the environment, mini-SWE-agent provides a pure baseline for research. This allows researchers to:

  • Accurately measure the language model’s inherent capabilities
  • Identify true limitations rather than framework artifacts
  • Develop improvements that target the model itself

As the project documentation states: “This makes it perfect as a baseline system and for a system that puts the language model (rather than the agent scaffold) in the middle of our attention.”

Enabling Better Fine-Tuning and Reinforcement Learning

The linear history and simple control flow make mini-SWE-agent particularly well-suited for fine-tuning and reinforcement learning applications. When training models to work with AI agents, you want to avoid overfitting to specific framework behaviors.

With mini-SWE-agent, the training signal comes directly from the task itself rather than from navigating a complex agent framework. This leads to models that generalize better across different environments and tasks.

Frequently Asked Questions

How can something with only 100 lines of code be effective?

The effectiveness comes from focusing on what truly matters: the interaction between the language model and the development environment. By removing unnecessary abstractions and leveraging the model’s existing knowledge of shell commands, mini-SWE-agent achieves remarkable results with minimal code.

You can verify the code size yourself by checking the default.py file on GitHub—it genuinely contains about 100 lines of core agent logic.

Does it really solve 65% of GitHub issues?

Yes, according to evaluations on the SWE-bench verified benchmark using Claude Sonnet 4. This performance is particularly impressive given the agent’s simplicity. The key insight is that modern language models have become capable enough that much of the complex scaffolding previously thought necessary is no longer required.

What models does it work with?

mini-SWE-agent works with any language model that can generate text. While the documentation mentions Claude Sonnet 4 achieving 65% success on SWE-bench, you can configure it to work with:

  • OpenAI’s GPT models
  • Anthropic’s Claude series
  • Open-source models through the LiteLLM interface

The configuration is straightforward—typically just changing a model name parameter.

Is it safe to use in my codebase?

mini-SWE-agent includes several safety features:

  • It operates in a sandboxed environment by design
  • All actions are visible and reviewable before execution (especially in visual mode)
  • It doesn’t automatically commit changes—you maintain full control

The independent action execution model further enhances safety by preventing unexpected state accumulation between steps.

How does it compare to other AI coding tools?

Unlike many AI coding assistants that function as black boxes with complex interfaces, mini-SWE-agent prioritizes transparency and integration with existing workflows. While some tools might offer more features out of the box, mini-SWE-agent provides:

  • Better understandability
  • Easier customization
  • Simpler deployment
  • More reliable behavior in constrained environments

Can I extend it with custom functionality?

Absolutely. The minimalist design makes extension remarkably straightforward. Because the core is small and well-understood, adding custom functionality—whether through environment modifications or agent extensions—is significantly easier than with more complex frameworks.

The project documentation encourages this approach: “Want it to do something specific like opening a PR? Just tell the LM to figure it out rather than spending time to implement it in the agent.”

The Future of Minimalist AI Agents

mini-SWE-agent represents more than just a practical tool—it signals an important shift in how we approach AI agent design. As language models continue to improve, we can expect to see more tools embracing this minimalist philosophy.

Implications for Development Workflows

The success of mini-SWE-agent suggests that future AI development tools will:

  • Focus on seamless integration rather than standalone interfaces
  • Leverage existing model knowledge rather than building complex custom tooling
  • Prioritize transparency and debuggability
  • Work within developers’ existing environments rather than requiring new workflows

Opportunities for Innovation

This minimalist approach opens new avenues for innovation:

  • Specialized agents for specific domains that build on the simple foundation
  • Hybrid workflows that combine human and AI efforts more effectively
  • Lightweight integrations with existing development tools and platforms

Rather than creating monolithic AI systems, the future likely belongs to small, focused tools that solve specific problems exceptionally well.

Getting the Most Out of mini-SWE-agent

To maximize the value you get from mini-SWE-agent, consider these practical tips:

Start Small

Begin with straightforward tasks before tackling complex issues. Try:

mini "Explain this function"

on a piece of code you’re familiar with to build confidence in the agent’s capabilities.

Use Visual Mode for Important Tasks

Always use the -v flag when working on critical issues. This allows you to:

  • Verify each step before proceeding
  • Intervene if the agent goes down an unproductive path
  • Learn how the agent approaches problems

Combine with Your Existing Workflow

Rather than treating mini-SWE-agent as a replacement for your current tools, integrate it as a complementary resource:

  • Use it for initial investigation of issues
  • Have it generate first drafts of code changes
  • Employ it for documentation and explanation tasks

Contribute to the Project

As an open-source project, mini-SWE-agent benefits from community contributions. If you find ways to improve it, consider:

  • Reporting issues you encounter
  • Submitting pull requests for enhancements
  • Sharing your use cases and experiences

The project maintains clear contribution guidelines to help you get started.

Conclusion: The Power of Focused Simplicity

In a world where technology often equates complexity with capability, mini-SWE-agent stands as a powerful counterexample. By focusing on what truly matters—effective interaction between language models and development environments—it achieves remarkable results with minimal overhead.

This project demonstrates that sometimes the most powerful innovations come not from adding features, but from removing everything unnecessary. For developers seeking a practical, reliable AI coding assistant, mini-SWE-agent offers a refreshing alternative to the bloated tools that dominate the landscape.

Whether you’re a researcher looking for a clean baseline system, a developer wanting a daily productivity boost, or an engineer concerned with secure deployment, mini-SWE-agent provides a compelling solution. Its minimalist design isn’t a limitation—it’s the source of its strength.

As the project documentation succinctly states, mini-SWE-agent is for:

  • Researchers who want to benchmark, fine-tune or RL without assumptions, bloat, or surprises
  • Developers who like their tools like their scripts: short, sharp, and readable
  • Engineers who want something trivial to sandbox & to deploy anywhere

In an era of increasingly complex AI systems, sometimes what we need most is a tool that just works—simply, reliably, and effectively. mini-SWE-agent delivers exactly that.

SWE Ecosystem
SWE-rex
SWE-bench
SWE-smith
SWE-CLI