# SWE-agent: An LLM Agent That Fixes GitHub Issues and Solves CTF Challenges

> SWE-agent is a Python framework from Princeton and Stanford that lets a language model autonomously interact with a code repository through a controlled terminal interface, fix issues, and submit pull requests. The repository now recommends mini-swe-agent for most use cases, as it matches SWE-agent's performance in far fewer lines of code.

**SWE-agent/SWE-agent** — SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024].

- Repository: https://github.com/SWE-agent/SWE-agent
- Website: https://swe-agent.com
- Stars: 20,405 · Forks: 2,233
- Language: Python
- License: MIT
- Published: 2026-08-04 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/swe-agent-swe-agent

## What SWE-agent Does and Who It Is For

SWE-agent gives a language model a structured interface to a real code repository and asks it to fix a GitHub issue or complete another defined task. The agent reads files, runs tests, edits code, and can open a pull request when it believes the fix is complete. The README describes the system as leaving maximal agency to the model: the agent is not scripted through steps; it decides which tools to use and in what order.

The project was built by researchers at Princeton University and Stanford University and was published at NeurIPS 2024. Its primary audience is AI and software engineering researchers who want to benchmark language models on SWE-bench, study agent-computer interfaces, or build on a well-tested open framework. Practitioners looking for a daily-use coding assistant are pointed toward mini-swe-agent.

The repository also contains EnIGMA, a mode for offensive cybersecurity capture-the-flag challenges. The README notes that EnIGMA targets SWE-agent 0.7 while the main branch is updated to 1.x.

## The Agent-Computer Interface Model

SWE-agent's design principle is the agent-computer interface (ACI), the layer between the language model and the system it operates on. Rather than giving the model raw shell access, SWE-agent provides a curated set of tools with predictable output formats, so the model sees consistent feedback regardless of which repository or issue it works on.

Every run is governed by a single YAML configuration file. The config directory in the repository holds the default and example configs. This means the agent behavior, tool set, and model parameters can all be changed without touching Python code, which is why the README describes it as highly configurable.

Run trajectories, the full record of what the agent did on each issue, are stored in the trajectories directory. The README mentions a v1.1.0 release titled "10s of thousands of training trajectories," indicating that trajectory data from the repository is used for training downstream models.

## Installation and a First Run

SWE-agent requires Python 3.11 or 3.12. The pyproject.toml lists the package name as sweagent. A GitHub personal access token is required; the .env.example file shows the expected variable:

```bash
GITHUB_TOKEN=
```

Copy .env.example to a .env file and set the token before running. The token needs the public_repo scope for public repositories or the repo scope for private ones.

The README points to the documentation at swe-agent.com for full installation instructions, including a GitHub Codespaces path that requires no local setup. The Codespaces option lets someone try SWE-agent in a browser without installing Python or configuring an environment locally.

A hello-world run from the command line is documented at swe-agent.com/latest/usage/hello_world. The README does not reproduce the command inline but links to the documentation site for the full walkthrough.

## SWE-agent vs. mini-swe-agent

The README opens with a prominent warning block: most current development has moved to mini-swe-agent, which the project team describes as having superseded SWE-agent. The warning states that mini-swe-agent matches SWE-agent's performance while being much simpler, and links to a FAQ comparing the two.

SWE-agent remains maintained and the README does not say it is deprecated. The project description on the repository lists it as the research tool for studying agent-computer interfaces and running batch evaluations on SWE-bench. SWE-bench itself is a separate repository at SWE-bench/SWE-bench.

The distinction matters practically. SWE-agent is configurable and documented for research customization; mini-swe-agent was built to be 100 lines of Python. Researchers who need to modify how the agent interacts with tools, inspect trajectories, or reproduce NeurIPS 2024 results have reason to stay on SWE-agent. Users who want results quickly without customizing the agent behavior are directed to mini-swe-agent.

## EnIGMA: Cybersecurity CTF Mode

The EnIGMA mode within SWE-agent targets offensive security capture-the-flag challenges rather than software bugs. The README states it achieves state-of-the-art results on multiple cybersecurity benchmarks, with results listed at enigma-agent.com. EnIGMA adds interactive commands and a summarizer that help the model track the state of a CTF problem across many tool calls.

The README notes that EnIGMA is currently being updated for the 1.0 release; users who need it should use the SWE-agent 0.7 tag until the update is complete. This is a practical constraint: installing from the main branch gives a 1.x codebase that the EnIGMA documentation has not yet caught up with.

Cybersecurity use is within the project's stated scope for offensive CTF challenges and authorized testing, matching the MIT license grant.

## Limitations: Context Window, Environment Setup, and Scope

SWE-agent's effectiveness is bounded by the language model's context window and its ability to locate the relevant code in a large repository. The model must find the right files, understand the issue, make targeted edits, and run verification without exceeding the context limit. On large codebases with many files, this is harder.

The framework requires Docker or a configured Python environment to run the code safely. The README points to installation documentation rather than providing a one-command setup, which means there is a setup cost before running the first issue.

SWE-agent is designed for single-issue fixes and coding challenges. It is not a continuous integration runner or a long-horizon planning system. Tasks that require coordinating changes across many issues, managing deployment, or maintaining state over weeks are outside the project's design.

## License and Research Origin

SWE-agent is MIT-licensed. The pyproject.toml lists the authors as Carlos E. Jimenez (Princeton), John Yang (Stanford), and Kilian Lieret, with contact emails provided in the README. The project cites an arXiv paper at arXiv:2405.15793 and the NeurIPS 2024 proceedings.

The repository requires Python 3.11 or 3.12, as specified in both pyproject.toml and the project classifiers. Key dependencies include litellm for the LLM abstraction layer (pinned to at least 1.44.12 with specific versions excluded), GitPython for repository operations, Flask for a local web interface, and pydantic for configuration validation. The last push was on 2026-09-21.

## Conclusion

SWE-agent is the right choice for researchers who want a well-documented, hackable codebase for studying LLM-based software engineering or running SWE-bench evaluations. For production use or day-to-day automated issue fixing, the README now explicitly recommends mini-swe-agent, calling it simpler and matching SWE-agent in performance. Check the mini-swe-agent FAQ before committing to the full framework.

## FAQ

### What is SWE-agent?

SWE-agent is a Python framework that gives a language model a controlled terminal interface to a code repository and asks it to fix GitHub issues or complete other coding tasks. It was published at NeurIPS 2024 by researchers from Princeton and Stanford.

### How do I use SWE-agent?

Install the sweagent package with Python 3.11+, set a GITHUB_TOKEN in a .env file, and follow the hello-world walkthrough at swe-agent.com/latest/usage/hello_world. A GitHub Codespaces option lets you try it without local setup.

### How does SWE-agent compare to Claude Code?

SWE-agent is a research framework that gives a language model a curated terminal interface to fix GitHub issues in batch or interactively, governed by a YAML config file. Claude Code is an interactive AI coding tool. The README does not document a direct comparison between the two.

### Is SWE-agent free?

The SWE-agent code is MIT-licensed and free to use. Running it requires a language model API key, which has its own costs depending on the provider. There is no licensing fee for the framework itself.

### What is mini-swe-agent and how does it differ from SWE-agent?

mini-swe-agent is a newer project from the same team. The SWE-agent README states that mini-swe-agent matches SWE-agent's performance while being much simpler, and recommends it for general use. SWE-agent remains the choice for research that requires the full configurable framework or NeurIPS 2024 reproducibility.

## Sources

- [Official documentation](https://swe-agent.com)
- [Official README](https://github.com/SWE-agent/SWE-agent#readme)
- [Project repository](https://github.com/SWE-agent/SWE-agent)
- [Release notes](https://github.com/SWE-agent/SWE-agent/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/swe-agent-swe-agent
