Understanding Open SWE: A Friendly Guide to the Cloud-Native, Open-Source Coding Agent That Writes Pull Requests While You Sleep
Imagine hiring an experienced engineer who never sleeps, reads your entire codebase in minutes, drafts a detailed plan, and opens a ready-to-merge pull request—all before your morning coffee.
That engineer is called Open SWE, and this guide will walk you through everything you need to know.
1. What Exactly Is Open SWE?
Open SWE is an open-source, asynchronous, cloud-native coding agent.
Built on the LangGraph framework, it can:
-
Understand a repository from scratch -
Plan a solution for any task you describe -
Execute code changes across the whole codebase -
Open a pull request that automatically closes the related issue
Think of it as three specialists rolled into one:
Role | Nickname | What It Does |
---|---|---|
Planner | The Architect | Reads code, splits work into steps, presents a plan for your approval |
Programmer | The Coder | Writes and tests code, fixes bugs, follows the plan line by line |
Manager | The Coordinator | Keeps Planner and Programmer in sync, listens to your feedback in real time |
2. Why “Asynchronous” Matters
Traditional scripts run on your laptop:
-
They hog CPU -
They fail if you close the lid -
They block you from starting another task
Open SWE runs inside a cloud sandbox:
-
Parallel by design — start as many tasks as you like -
Resilient — your Wi-Fi can drop; the job keeps running -
Hands-off — you only intervene when the plan is ready or the PR needs review
3. Two Ways to Talk to Open SWE
Entry Point | Best For | How It Works |
---|---|---|
Web UI | Visual learners, quick demos | Visit https://swe.langchain.com, create a task, watch progress in real time |
GitHub Labels | Developers living in Issues | Add the label open-swe to any issue; the agent replies with a plan you can accept or edit |
Pro tip: Add the suffix
-auto
(e.g.,open-swe-auto
) to skip human approval for trivial tasks like typo fixes.
4. Getting Started Locally in 15 Minutes
The following commands are copied verbatim from the official repository instructions.
Prerequisites
-
Node.js 18 or newer -
Yarn 3.5.1 (configured in .yarnrc.yml
; do not use npm)
Step-by-Step
# 1. Clone the repository
git clone <repository-url>
cd open-swe
# 2. Install all workspace dependencies
yarn install
# 3. Build every package in the correct order
yarn build # shared → open-swe → web
After the first build, Turbo will only rebuild what changed, so future iterations are lightning-fast.
5. Repository Layout at a Glance
open-swe/
├── apps/open-swe # LangGraph agent source
│ ├── src/graphs # planner, programmer, manager
│ └── langgraph.json # graph definitions
├── apps/web # Next.js 15 front-end
│ └── src/components # Shadcn UI components
├── packages/shared # Common utilities
│ ├── crypto.ts
│ └── open-swe/types.ts
├── turbo.json # build orchestration
└── .yarnrc.yml # Yarn 3.5.1 settings
Golden Rule
Whenever you need a new utility, search in packages/shared/src
first—duplication is discouraged.
6. Development Rules Cheat-Sheet
Rule | One-Line Reminder |
---|---|
Use Yarn only | npm install will throw an error |
Run commands from root | yarn lint , yarn format , etc. |
No console.log |
Use createLogger('module-name') |
Build shared first | yarn build handles order automatically |
Pre-commit checks | yarn lint:fix && yarn format |
7. Testing Strategy
Types of Tests
Type | File Pattern | Purpose |
---|---|---|
Unit | *.test.ts |
Fast feedback on individual functions |
Integration | *.int.test.ts |
End-to-end agent workflows |
Single file | Any | yarn test:single <file> |
Commands
yarn test # all unit tests
yarn test:int # open-swe integration tests only
Integration tests run inside the cloud sandbox and have a 20-second timeout per test—perfect for catching real-world issues.
8. Your First Real Task: A Walk-Through
Scenario: Add a “Sign In” Button to a React App
Option A — Web UI
-
Visit https://swe.langchain.com -
Click New Task -
Describe: “Add a green ‘Sign In’ button to the top-right corner of the landing page” -
Wait for the Planner to propose tasks (≈ 1 minute) -
Click Approve or edit the plan inline -
Watch Programmer write the code, run tests, push commits -
Receive a pull request that says “Closes #123”
Option B — GitHub Label
-
Open a new issue with the same description -
Add label open-swe
-
The Planner posts a comment with the plan -
Reply LGTM (Looks Good To Me) -
The Programmer force-pushes a branch and opens the PR
9. GitHub Label “Dialects” Explained
Label | Human Approval | LLM Model | Typical Use Case |
---|---|---|---|
open-swe |
Required | Default | New features |
open-swe-auto |
Skipped | Default | Typos, simple refactors |
open-swe-max |
Required | Claude Opus 4.1 | Complex architecture |
open-swe-max-auto |
Skipped | Claude Opus 4.1 | Massive refactor or upgrade |
10. Frequently Asked Questions
Q1: Can I use my own LLM API key?
Yes. In the Web UI, open **Settings** and paste your OpenAI or Anthropic key.
Keys are used only inside your sandbox; they are never sent to external services.
Q2: Does the sandbox support private npm packages?
Yes. Commit an `.npmrc` or `.yarnrc.yml` file at the repository root with your registry token.
The build step injects the token into the container.
Q3: What if the task fails?
1. Open the task log in the Web UI or GitHub comment.
2. Type *“Retry step 3”* in the chat.
3. If it’s an environment issue (e.g., Node version), say *“Upgrade Node to 20”*.
Q4: How do I connect the local front-end to a local agent?
1. Terminal 1: `cd apps/open-swe && yarn dev` (port 8000)
2. Terminal 2: `cd apps/web && yarn dev` (port 3000)
3. The Next.js dev server proxies `/api` requests to port 8000 automatically.
11. Automating Weekly Chores: A One-Line CI Job
Many teams automate dependency bumps.
Add this snippet to .github/workflows/weekly-deps.yml
:
- name: Trigger Open SWE
run: |
gh issue create \
--title "Weekly dependency bump" \
--body "Bump all minor versions, run tests, open PR." \
--label "open-swe-auto"
Every Monday, the agent wakes up, updates packages, runs the test suite, and opens a pull request without human intervention.
12. Roadmap: Where to Go Next
Your Current Step | Recommended Next Move |
---|---|
Just heard of Open SWE | Open the live demo and create a “Hello, World!” task |
Finished the demo | Add your private repository to the GitHub App and tackle a real issue |
Ready to contribute | Read interface contracts in packages/shared , write tests, run yarn test:int before opening a PR |
13. Final Thoughts
Open SWE isn’t here to replace engineers.
It’s here to free you from repetitive chores—dependency updates, boilerplate tests, typo hunts—so you can focus on the creative, high-impact work that only humans can do.
Happy automating!