TL;DR
A practical framework for building LLM-powered software that actually ships to production customers - not just demos. 21.8k stars and still climbing.
Read next
humanlayer/12-factor-agents crossed 20k stars with a simple argument: most AI agents fail in production because they ignore decades of software engineering wisdom. Here are the twelve principles fixing that.
5 min readThe humanlayer/12-factor-agents repo distills hard-won lessons from shipping AI agents into 12 concrete principles. It crossed 21,000 stars on GitHub this week.
6 min readRuflo hit the top of GitHub trending this week with 35k stars. It turns Claude Code into a multi-agent platform with swarm coordination, vector memory, and cross-machine federation.
7 min readhumanlayer/12-factor-agents picked up nearly 2,000 stars in a single week, pushing it past 21.8k total and onto GitHub's trending list. The velocity makes sense when you look at what the AI development community is running into right now.
Teams prototype quickly with frameworks. They ship impressive demos. Then they try to put those demos in front of real customers and hit a wall somewhere around 70-80% production quality. Getting past that wall means reverse-engineering the framework, fighting implicit behaviors, and rewriting more than expected. Dex Horthy and the HumanLayer team surveyed roughly 100 SaaS founders building agentic features and found this pattern everywhere. Their response: a principled guide that names the wall explicitly and offers a way around it.
The result is 12-Factor Agents - a structured methodology inspired by the original 12factor.net methodology that redefined how web apps are built. The same clarity-of-principle approach, applied to agents.
12-Factor Agents is not a library, a CLI, or a framework. It is a design guide - a set of principles you read, internalize, and apply to your own code. That distinction matters, because the guide's central claim is that relying on frameworks is itself part of the problem.
The project opens with a question: "What are the principles we can use to build LLM-powered software that is actually good enough to put in the hands of production customers?" The answer is twelve factors, each addressing a specific failure mode in how teams typically build agents.
The core thesis is direct: "The fastest way I've seen for builders to get good AI software in the hands of customers is to take small, modular concepts from agent building, and incorporate them into their existing product." In other words, agents are mostly just software. They are not magic loops. The guide traces the history from deterministic code to DAG orchestrators like Airflow and Prefect, then to the current agent-loop pattern, and explains where naive application of that pattern breaks down.
Here are all twelve factors:
The repo also includes a thirteenth "honorable mention": pre-fetch all context you might need. A practical latency and token optimization that did not quite make the canonical twelve.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
May 23, 2026 • 7 min read
May 23, 2026 • 8 min read
May 22, 2026 • 5 min read
May 22, 2026 • 8 min read
Because this is a reference guide rather than a package, there is no install command. The starting point is the repository itself:
https://github.com/humanlayer/12-factor-agents
Clone it locally if you want the full content alongside your project:
git clone https://github.com/humanlayer/12-factor-agents.git
The guide includes a 17-minute video deep dive from AI Engineer World's Fair, linked from the README. If you prefer written content, Dex Horthy publishes related material in The Outer Loop newsletter. The HumanLayer team also maintains an open-source agents project at github.com/got-agents/agents that demonstrates these principles in working code.
The content is licensed under CC BY-SA 4.0 and the code examples under Apache 2.0, so you can fork and adapt freely.
The guide is most valuable for builders who are past the prototype stage and hitting friction in production. If you have an agent that works in testing but behaves unpredictably with real users, factors 3, 5, 8, and 12 are the most immediately actionable.
It is also essential reading before choosing or committing to any agent framework. Factor 2 ("Own Your Prompts") and Factor 8 ("Own Your Control Flow") explain why framework lock-in erodes quality over time. Reading those two factors before evaluating LangGraph, CrewAI, or any orchestration layer will sharpen your evaluation criteria considerably.
Engineers building multi-agent systems where one agent hands off to another will find Factor 10 and Factor 6 directly applicable - small focused agents with clean pause/resume APIs compose far more reliably than monolithic agents that try to manage their own state across complex flows.
Teams integrating human-in-the-loop review - approvals, escalations, corrections - should read Factor 7 closely. The insight that human contact is just another tool call sounds simple but changes the entire architecture of how you handle escalation paths.
Claude Code users building multi-step workflows will recognize several of these factors in the patterns Claude Code itself uses. Factor 10 (Small, Focused Agents) maps directly to how skills at skills.developersdigest.tech are structured - each skill does one thing, has a clear trigger, and hands control back cleanly. Factor 7 (Contact Humans with Tool Calls) is exactly how Claude Code's permission system works: the agent treats a human approval prompt as a tool invocation result.
Factor 3 (Own Your Context Window) is increasingly relevant to Claude Code hook workflows. Hooks run in response to specific events, and the data injected into context at each hook point is deliberate and constrained - you never want an unbounded context dump polluting a hook's decision scope.
For developers building agents with Claude's API, Anthropic's own Building Effective Agents engineering guide overlaps significantly with 12-Factor Agents. The two documents read well together: Anthropic's guide explains the mechanics of what the model does, and 12-Factor Agents explains the software architecture surrounding it.
The guide is genuinely useful and the principles are sound. Factors 3, 8, 10, and 12 in particular represent hard-won lessons that teams usually learn through painful production incidents rather than up-front design.
The limitations are worth naming. First, this is a guide, not runnable code. There are no test suites, no reference implementations beyond the separate got-agents project, and no automated way to audit whether your codebase follows a given factor. Applying the principles requires judgment and experience that the guide cannot fully substitute for.
Second, the framing can come across as more framework-skeptical than the situation strictly requires. Some frameworks - especially narrower ones like BAML, which the guide references approvingly - do not exhibit the lock-in problems the guide describes. The real lesson is "understand your framework well enough to own the parts that matter," not "avoid all frameworks."
Third, the 12-factor format forces some concepts into cleaner boxes than they occupy in practice. Factors 5 and 12 (Unify State, Stateless Reducer) are in tension with each other in systems that need both stateful business logic and stateless execution - the guide acknowledges this implicitly but does not resolve it.
These are minor criticisms. At 21.8k stars with active contribution and a clear articulation of a problem every production AI team runs into, this belongs in your reading list if you are shipping agents.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
TypeScript-first AI agent framework. Agents, tools, memory, workflows, RAG, evals, tracing, MCP, and production deployme...
View ToolMulti-agent orchestration framework built on the OpenAI Agents SDK. Define agent roles, typed tools, and directional com...
View ToolType-safe SQL builder and ORM for TypeScript. Zero runtime overhead, honest schema migrations, bring-your-own-DB.
View ToolThe original server-side JavaScript runtime. V8 under the hood, npm ecosystem, and the default backend runtime for most...
View ToolStep-by-step guide to building an MCP server in TypeScript - from project setup to tool definitions, resource handling, testing, and deployment.
AI AgentsPersistent project instructions loaded every session; supports nested dirs.
Claude CodeThe humanlayer/12-factor-agents repo distills hard-won lessons from shipping AI agents into 12 concrete principles. It c...
humanlayer/12-factor-agents crossed 20k stars with a simple argument: most AI agents fail in production because they ign...
agentmemory is a self-hosted MCP server that gives Claude Code, Cursor, and Gemini CLI searchable long-term memory acros...
agentmemory gives AI coding agents a persistent brain - capturing session context automatically via 12 Claude Code hooks...
AgentMemory hit GitHub's daily trending list with 400 new stars today, offering a persistent memory layer for AI coding...
Ruflo crossed 37,700 GitHub stars this week, adding nearly 1,900 in a single day. It turns Claude Code into a coordinate...

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.