Top AI Coding Agent Frameworks for 2026 Development
Ready-made coding agents are great, but sometimes you need your own. Maybe you want an agent that fixes failing tests in CI, upgrades dependencies every Monday, or answers questions about your internal codebase in Slack. For that, you need a framework or SDK.
This post picks the top 5 frameworks from the Awesome AI Coding Agents list and shows a small, working coding-agent example for each.
Quick comparison
| Framework | Language | Style | Best for |
|---|---|---|---|
| Claude Agent SDK | Python, TypeScript | The engine behind Claude Code | Getting Claude Code power in your own app |
| OpenAI Agents SDK | Python, TypeScript | Agents, tools and handoffs | Simple multi-agent workflows |
| LangGraph | Python, JavaScript | Graph of steps with state | Long-running agents with loops and retries |
| OpenHands | Python | Full agent platform | An open-source Devin-style agent |
| SWE-agent | Python | Research agent | Fixing GitHub issues automatically |
1. Claude Agent SDK
The Claude Agent SDK is the toolkit behind Claude Code, opened up so you can build your own agents. You get the same tools Claude Code uses (read, edit, bash, search), plus MCP, subagents and a permission system, without writing the agent loop yourself.
Install
pip install claude-agent-sdk
export ANTHROPIC_API_KEY=your-key
Example: an agent that fixes a failing test
import anyio
from claude_agent_sdk import query, ClaudeAgentOptions
async def main():
options = ClaudeAgentOptions(
cwd="./my-repo",
allowed_tools=["Read", "Grep", "Edit", "Bash"],
permission_mode="acceptEdits",
system_prompt="You are a careful engineer. Make the smallest change that fixes the problem.",
)
async for message in query(
prompt="Run pytest, find the failing test, fix the code (not the test), and run pytest again.",
options=options,
):
print(message)
anyio.run(main)
allowed_tools limits what the agent can do, and permission_mode decides whether edits need your approval. That makes it easy to run the same agent safely in CI.
Pick it when: you want Claude Code’s abilities inside your own product or pipeline with very little code.
2. OpenAI Agents SDK
The OpenAI Agents SDK is a light framework for agents that use tools and hand work off to each other. It has only a few core ideas: agents, tools, handoffs and guardrails.
Install
pip install openai-agents
export OPENAI_API_KEY=your-key
Example: a test runner tool plus a triage agent that hands off to a fixer
import subprocess
from agents import Agent, Runner, function_tool
@function_tool
def run_tests(path: str) -> str:
"""Run pytest on a path and return the output."""
result = subprocess.run(["pytest", path, "-q"], capture_output=True, text=True)
return (result.stdout + result.stderr)[-4000:]
@function_tool
def read_file(path: str) -> str:
"""Read a file from the repo."""
with open(path) as f:
return f.read()
fixer = Agent(
name="Fixer",
instructions="Read the failing code and explain the exact change needed to fix it.",
tools=[read_file],
)
triage = Agent(
name="Triage",
instructions="Run the tests. If anything fails, hand off to the Fixer with the error output.",
tools=[run_tests],
handoffs=[fixer],
)
result = Runner.run_sync(triage, "Check the tests in tests/")
print(result.final_output)
The SDK also gives you tracing out of the box, so you can see every tool call and handoff.
Pick it when: you want a small, clean framework and you like the idea of agents passing work to each other.
3. LangGraph
LangGraph, from the LangChain team, models an agent as a graph. Each node is a step, edges decide what happens next, and the state is saved between steps. That makes it a good fit for coding agents, which naturally loop: write code, run tests, fix, repeat.
Install
pip install langgraph langchain-anthropic
Example: a write, test, retry loop
import subprocess
from typing import TypedDict
from langgraph.graph import StateGraph, END
from langchain_anthropic import ChatAnthropic
llm = ChatAnthropic(model="claude-sonnet-4-5")
class State(TypedDict):
task: str
code: str
test_output: str
attempts: int
def write_code(state: State) -> State:
prompt = f"Task: {state['task']}. Last test output: {state['test_output']}. Return only the full contents of solution.py."
code = llm.invoke(prompt).content
with open("solution.py", "w") as f:
f.write(code)
return {**state, "code": code, "attempts": state["attempts"] + 1}
def run_tests(state: State) -> State:
r = subprocess.run(["pytest", "-q"], capture_output=True, text=True)
return {**state, "test_output": r.stdout[-2000:]}
def next_step(state: State) -> str:
if "failed" not in state["test_output"] or state["attempts"] >= 3:
return END
return "write_code"
graph = StateGraph(State)
graph.add_node("write_code", write_code)
graph.add_node("run_tests", run_tests)
graph.set_entry_point("write_code")
graph.add_edge("write_code", "run_tests")
graph.add_conditional_edges("run_tests", next_step)
app = graph.compile()
app.invoke({"task": "Implement slugify(text) so tests/test_slugify.py passes", "code": "", "test_output": "", "attempts": 0})
The loop stops when tests pass or after three tries. You can add a human approval node, save checkpoints, and resume later.
Pick it when: your agent has many steps, loops or branches, or needs to pause and resume.
4. OpenHands
OpenHands (formerly OpenDevin) is a full open-source platform for coding agents. Its agents write code, run commands and browse the web inside a sandbox. You can use it as a ready-made agent (CLI or web UI) or build on its SDK.
Install the CLI
uv tool install openhands --python 3.12
openhands
Or start the local web UI
uvx --python 3.12 --from openhands-ai openhands serve
Then open the browser, add your model key, point it at a repo and give it a task:
Add a Dockerfile and a docker-compose.yml for this Django app with Postgres. Build it and make sure the app starts.
OpenHands runs each task in an isolated runtime, so commands do not touch your host directly.
Pick it when: you want an open-source, self-hostable alternative to commercial autonomous agents, with room to customise.
5. SWE-agent
SWE-agent from Princeton is a research agent that takes a GitHub issue and tries to fix it on its own. It is the reference agent for SWE-bench, the best-known benchmark for coding agents. It is a great way to learn how coding agents are built, and it works well for batch issue fixing.
Install
git clone https://github.com/SWE-agent/SWE-agent.git
cd SWE-agent
pip install -e .
Example: fix a real GitHub issue
sweagent run --agent.model.name=claude-sonnet-4-20250514 --env.repo.github_url=https://github.com/SWE-agent/test-repo --problem_statement.github_url=https://github.com/SWE-agent/test-repo/issues/1
SWE-agent clones the repo into a Docker container, reads the issue, explores the code with its own simple commands, edits files and saves a patch you can review.
Pick it when: you want to study how coding agents work, run benchmarks, or fix many issues in batch.
Honourable mentions
- CrewAI: role-based teams of agents, easy to read and set up.
- Microsoft AutoGen: agents that talk to each other to solve a task.
- MetaGPT: gives agents software-company roles like PM, architect and engineer.
- GPT Engineer and Smol Developer: early, simple agents that scaffold whole apps from a prompt.
Tips for building your own coding agent
- Start with tools, not prompts. A coding agent is only as good as its tools: read file, edit file, run tests, search code.
- Always give it a check. Running tests or a linter after each change is what turns a guesser into an engineer.
- Limit what it can touch. Allow only the tools and folders it needs.
- Run it in a sandbox. Your agent will run code it wrote itself. Put it in a container or a microVM, not on your laptop or CI host directly.
How to choose
- Claude Code power in a few lines: Claude Agent SDK
- Small and simple, with handoffs: OpenAI Agents SDK
- Complex loops and long-running state: LangGraph
- A full open-source agent platform: OpenHands
- Research and issue fixing at scale: SWE-agent
Wrapping up
You do not need to build an agent from scratch anymore. Pick the framework that matches the shape of your problem, give your agent good tools and a way to check its work, and keep it inside a sandbox.
See the full list at github.com/collabnix/awesome-ai-coding-agents.