Key Moments

How Coding Agents Work: SWE-agent & Claude Code | Stanford CS329Z Lecture 15 with John Yang

Stanford OnlineStanford Online
Education5 min read83 min video
Dec 3, 2026|247 views|33|2
Save to Pod
TL;DR

AI coding agents are evolving rapidly, moving beyond simple code completion to tackling complex software development tasks. However, the challenge remains in creating robust evaluation frameworks that truly reflect real-world software engineering complexities.

Key Insights

1

The evolution of AI coding agents has progressed from early symbolic and neural approaches to complex agentic systems capable of interacting with terminals and developing entire software projects.

2

Evaluation frameworks have shifted from surface-level code similarity metrics like CodeBLEU to execution-based evaluations like HumanEval and SWE-bench, which assess functional correctness.

3

SWE-bench, a benchmark for evaluating coding agents, moved from simple function completion to evaluating agents on entire codebases, significantly increasing complexity and realism.

4

The development of coding agents has seen a trend towards more interactive and iterative processes, mirroring human software development workflows rather than static, single-turn code generation.

5

Recent advancements in coding agents, like SWE-agent and OpenHands, showcase the potential for AI to not only fix bugs but also to create software from scratch and even engage in multi-modal tasks.

6

The future of coding agent evaluation and development is moving towards more proactive and self-improving systems, with a focus on AI performing AI research tasks and generating complex digital products.

Defining coding agents and their historical context

The lecture begins by defining AI coding agents, essentially framing them as an application of the REA (Reflexive, Engaging, Acting) framework specifically to the terminal environment. This involves an agent taking an action (e.g., executing a bash command), receiving an observation (output), and iterating. The historical context of AI in programming dates back decades, moving from procedural code generation based on formal specifications to neural network-based approaches. Early inspirations include compilers, which translate high-level code to machine code, and the broader concept of programming languages as abstractions. Program synthesis, broadly categorized into deductive (from formal specifications) and inductive (from input-output examples) methods, has been a long-standing area of research.

The shift from symbolic methods to neural networks and early benchmarks

The evolution of AI in programming saw a transition from symbolic methods, like inductive synthesis, to neural approaches. Early neural network applications in programming, pre-dating large language models (LLMs), focused on tasks like code classification or predicting the next token. The advent of models like BERT and ELMo in NLP paved the way for applying similar vectorization techniques to code (e.g., code2vec). Early benchmarks like NL to Bash emerged, focusing on translating natural language to bash commands. These were largely seq-to-seq models without true environmental interaction, relying on text-based evaluation metrics like BLEU, which were later adapted for code (CodeBLEU). A significant development was the 'fill-in-the-middle' objective, where models predict code based on preceding and succeeding context, proving effective for code generation.

The limitations of surface-level evaluation and the rise of execution-based metrics

A critical realization in AI coding research was that surface-level code similarity, as measured by metrics like CodeBLEU, is insufficient. Code that looks similar might not be functionally correct due to missing edge cases or subtle errors. This led to the development of execution-based evaluation frameworks, most notably HumanEval. HumanEval assesses models on their ability to generate correct code solutions for programming problems, evaluated by running the generated code against test cases. This marked a significant shift towards verifying functional correctness rather than just syntactic similarity. The 'Pass@k' metric, which calculates the probability of a model passing a test case given 'k' generation attempts, became standard for HumanEval and subsequent benchmarks, acknowledging the stochastic nature of LLMs.

Introducing interactive environments and SWE-bench

While HumanEval and similar benchmarks provided a step forward, they still operated in a static, 'sequence-to-sequence' paradigm. The next major leap involved creating more realistic, interactive environments that mirrored human software development. Benchmarks like InnerCode and subsequently SWE-bench (Software Engineering-bench) were developed to address this. SWE-bench, in particular, moved beyond simple function completion to evaluating agents on real-world GitHub issues. This involved agents interacting with a full codebase, identifying relevant files, and attempting to fix bugs. The development of SWE-bench highlighted the need for more sophisticated tooling and evaluation to handle complex, long-context software engineering tasks, moving away from the limited scope of 'code for code's sake'.

The evolution of agent architectures and evaluation strategies

The field has seen the rise of various agent architectures, including SWE-agent, which emphasizes an open-ended terminal interaction loop, and OpenHands, which integrates diverse tools like web browsers and image viewers. This trend reflects a move towards general-purpose agents capable of handling multi-modal and multi-tool tasks. AgentList incorporates traditional programming language techniques like Abstract Syntax Trees (ASTs) and call graphs to provide richer context to models. There's also a debate between workflow-based agents (e.g., Auto CodeRover) and more autonomous agentic approaches (e.g., SWE-agent). The evaluation has also become more nuanced, with the development of benchmarks like SWE-bench Verified and Terminal Bench, which track agent performance over time and introduce new problem types, including generating complex digital products rather than just fixing bugs.

Simplification of tooling and the future of AI in software engineering

A recent trend in coding agent development is a return to simplicity in tooling. As models become more capable, the need for overly complex, multi-tool environments diminishes. Projects like Mini SWE-agent demonstrate that simpler, customizable wrappers can achieve impressive results. Live SWE-agent further pushes this by enabling agents to dynamically create their own tools. The ultimate goal is to create agents that can perform AI research tasks, improve themselves, and generate complex software from scratch. The future of evaluation likely involves even more challenging, proactive benchmarks and competitive scenarios, such as cybersecurity red-teaming, where AI not only solves problems but also defines them and competes to solve them.

Common Questions

A programming agent is essentially the React framework applied to a terminal environment. It's an AI model that can issue commands (like Bash commands) and receive output as feedback, allowing it to interact with and manipulate a development environment.

Topics

Mentioned in this video

Software & Apps
HumanEval

A benchmark for evaluating code generation models, similar to LeetCode problems, focusing on execution-based evaluation.

Claude Code

A coding tool mentioned as an example of current AI coding assistants.

Lean

A formal proof language used as an analogy for deductive program synthesis.

BERT

A natural language processing model that influenced the application of similar techniques to code.

MBPP

A dataset and benchmark for evaluating code generation models, similar to HumanEval.

sed

A command-line utility for text manipulation, mentioned as a difficult tool for programming agents to use effectively due to its syntax.

Live SWE-agent

An evolution of Mini SWE-agent that allows the model to create its own tools during the problem-solving process.

Sweep Sweep

A project related to Sweep Bench that focuses on proactive problem identification by the agent.

SWE-Bench

A benchmark for evaluating programming agents, involving realistic environments and tasks sourced from GitHub pull requests.

Bash

A command-line interpreter used by programming agents, where agents issue Bash commands and receive standard output as feedback.

Bird SQL

A common programming benchmark at the time of InnerCode's development, focused on generating SQL queries from natural language.

Python

A programming language mentioned in the context of building file editing tools and linters for agent environments.

Ruby

A programming language mentioned as an example of something AI models might be tasked to write from scratch.

Terminal Bench

A benchmark for evaluating programming agents that operates in a terminal environment.

NL to Bash

An early system for translating natural language into Bash commands, representing a seq2seq approach to code generation.

GPT-3

An early language model from OpenAI, associated with the release of the Codex programming model and the HumanEval benchmark.

BM25

A retrieval algorithm used in RAG systems to identify relevant files based on a given problem description.

MLE bench

A benchmark mentioned in the concluding remarks of the lecture.

Codex

A coding tool developed by OpenAI, mentioned as a predecessor to current coding assistants and used in early benchmarks.

Code BLEU

A metric adapted from BLEU for measuring the similarity of code, used in early evaluations.

InnerCode

A research paper and framework that evaluated programming models in an interactive terminal environment.

Docker

Containerization technology used to create consistent development and execution environments for programming agents.

Darwin Gadel machine

A system mentioned in the context of 2025 research on programming agent environments.

meta harness

A system from Stanford University, mentioned in research on programming agent environments in 2025.

Devon

A programming agent tool mentioned as an example of systems that OpenAI's models are trained to work with.

Opus 5.5

A model mentioned in relation to SWE-bench performance, indicating high success rates.

Terminal Bench 4

A later version of the Terminal Bench benchmark, showing a shift towards evaluating the creation of end-to-end digital products.

Paper bench

A benchmark mentioned in the concluding remarks of the lecture.

Post-train Bench

A benchmark mentioned in the concluding remarks of the lecture.

Deep Suite

A benchmark mentioned as part of ongoing developments in programming agent evaluation.

SymPy

A Python library for symbolic mathematics, mentioned as an example of a library that AI models might reimplement.

Program Bench

A project related to AI agents writing codebases from scratch, with increasing difficulty levels.

LeetCode

A platform for competitive programming, used as a reference for inductive program synthesis and the nature of typical coding problems.

Tau-bench

A benchmark that specifically addresses reward design for interactive agents, focusing on result-based rewards.

SWE-agent

A programming agent framework designed to solve GitHub issues by interacting with a terminal environment, representing a move towards more autonomous agents.

code2vec

A model for learning vector representations of code, inspired by word2vec.

GPT-4

A powerful language model whose performance trends on programming tasks were noted as particularly interesting.

ChatGPT 3.5

An earlier version of ChatGPT that exhibited humorous failure modes when dealing with terminal output.

Cloud Code

An AI coding assistant tool whose underlying interaction loop was noted as surprisingly simple.

Mini SWE-agent

A simplified and customizable version of SWE-agent, consisting of only 100 lines of code, representing a trend towards simpler agent frameworks.

Blender

A 3D creation suite mentioned as an example of a tool that could be used by AI agents to programmatically create content like movies.

More from Stanford Online

View all 206 summaries

Ask anything from this episode.

Save it, chat with it, and connect it to Claude or ChatGPT. Get cited answers from the actual content — and build your own knowledge base of every podcast and video you care about.

Get Started Free