Design Patterns Behind Claude Code

... PLUS: The RL Framework Powering GLM-5.2

In today’s newsletter:

  • Design Patterns Behind Claude Code

  • slime: The RL Framework Powering GLM-5.2

Reading time: 5 minutes.

Claude Code has become one of the best AI coding agents available today. It can understand large codebases, edit files, run shell commands, use external tools, and work through complex engineering tasks with minimal supervision.

It's easy to credit all of that to the model, but a recent research paper suggests otherwise. After analyzing Claude Code's public TypeScript codebase, the researchers found that the reasoning loop at its core is relatively simple.

From an LLM to an AI Agent

What makes Claude Code feel reliable is the harness built around the model, the collection of systems that turn the model's reasoning into reliable actions. The harness includes:

  • Runtime: Orchestrates the agent's execution loop.

  • Permission system: Controls which actions the agent is allowed to perform.

  • Context management: Manages what information stays in the model's working memory.

  • Tool integrations: Connect the agent to files, shells, the web, MCP servers, and other capabilities.

  • Execution environment: Provides the environment where tools and commands actually run.

Together, these pieces transform a reasoning model into an engineering agent that can work on real software projects.

How the Harness Works

The paper went further to explain how Claude Code implements each part of that harness.

Permissions. Claude Code doesn't allow the model to execute every command automatically. A permission layer and safety checks determine which actions can run immediately and which require approval before execution.

Context management. Rather than continuously expanding the prompt, Claude Code keeps the model focused by retaining the most relevant information while compressing or discarding context that is no longer useful.

Extensibility. Skills, MCP servers, Plugins, and Hooks allow Claude Code to gain new capabilities without changing the underlying reasoning loop, making the agent adaptable to different development environments.

Subagents. Large engineering tasks can be delegated to specialized subagents, allowing multiple pieces of work to progress independently before being combined into a final result.

The Bigger Lesson

The paper isn't just about Claude Code. It's about how production AI agents should be built.

A powerful model is only one part of the equation. The harness around it determines how the agent remembers, what tools it can access, how safely it operates, and how reliably it completes long-running tasks.

That's the biggest takeaway from the paper: if you're building AI agents, don't just think about the model. Think about the harness around it.

GLM-5.2 is one of the most talked-about open-weight models recently. Given its strong coding performance, long context window, and open weights, many developers are asking the same question: How was it trained?

The answer isn't just a bigger model or more data. Behind GLM-5.2 is slime, the reinforcement learning (RL) post-training framework that teaches the model how to solve complex, multi-step tasks after pretraining is complete.

The framework is now open-sourced, giving developers a look at the infrastructure behind one of today's strongest open-weight models.

Training Doesn't Stop After Pretraining

Pretraining teaches a model language. But modern frontier models then go through another post-training stage.

This is where the model learns to write better code, use tools, solve long-horizon tasks, interact with environments, and improve through reinforcement learning.

Building that stage is usually difficult. Training, rollout, reward computation, verifier feedback, tool use, and environment interaction are often handled by separate systems stitched together with custom infrastructure.

As workflows become more agentic, that complexity only grows. slime was built to simplify that stack.

One Framework and One Training Loop

slime is an RL post-training framework designed around a simple idea:

Instead of treating rollout, reward models, verifier feedback, and agent interaction as separate services, connect them through one training loop.

The framework combines:

  • Megatron for distributed model training.

  • SGLang for high-performance rollout and inference.

  • Custom data generation pipelines.

  • Reward computation and verifier feedback.

  • Environment and tool interaction.

Everything flows through the same training, rollout, and data buffer pipeline instead of moving data between disconnected systems.

Built for Agentic Training

One of slime’s more interesting design decisions is how it treats agent workflows.

Instead of viewing tool use, sandbox execution, browser interaction, or multi-agent collaboration as separate frameworks, slime treats them as data generation workflows for reinforcement learning.

That means an agent can interact with tools, receive feedback from its environment, execute multi-step tasks, and learn from those experiences without requiring a separate orchestration layer.

The same infrastructure handles rollout, rewards, and learning.

More Than Just GLM-5.2

GLM-5.2 is the latest model trained with SLIME, but it isn't the first. The framework has already powered the RL post-training of GLM-4.5, GLM-4.6, GLM-4.7, GLM-5, GLM-5.1, and now GLM-5.2. It also supports training workflows for other open models, including Qwen, DeepSeek, and Llama.

That makes it more than a framework built for a single release. It's becoming the reusable RL stack behind an entire family of frontier models.

Why Should You Care

Most developers will never train a 700B-parameter model. But many are beginning to build smaller models that need reinforcement learning, verifier feedback, tool use, or long-running agent workflows.

slime offers a practical reference for how those systems can be connected without building separate infrastructure for training, rollout, rewards, and environment interaction.

It's also a reminder that model performance doesn't come from architecture alone. Increasingly, it comes from the quality of the post-training pipeline behind it.

That’s all for today. Thank you for reading today’s edition. See you in the next issue with more AI Engineering insights.

PS: We curate this AI Engineering content for free, and your support means everything. If you find value in what you read, consider sharing it with a friend or two.

Your feedback is valuable: If there’s a topic you’re stuck on or curious about, reply to this email. We’re building this for you, and your feedback helps shape what we send.

WORK WITH US

Looking to promote your company, product, or service to 200K+ AI developers? Get in touch today by replying to this email.