TL;DR
The 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.
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 readA practical framework for building LLM-powered software that actually ships to production customers - not just demos. 21.8k stars and still climbing.
6 min readRuflo crossed 37,700 GitHub stars this week, adding nearly 1,900 in a single day. It turns Claude Code into a coordinated swarm of 100+ specialized agents with MCP integration, distributed vector memory, and zero-trust agent federation.
7 min readThe humanlayer/12-factor-agents repository crossed 21,000 GitHub stars this week, picking up roughly 733 stars in a single day. That rate is notable for a documentation-first project - no shiny demo, no flashy UI, just principles. The velocity says something: a lot of builders are running into the same walls trying to push AI agents into production, and they are hungry for a framework that names those walls.
The repo draws a direct line from Adam Wiggins' original 12 Factor App methodology to the problems unique to LLM-powered software. Where 12 Factor App addressed config, processes, and logs, 12-Factor Agents addresses context windows, control flow, and human-in-the-loop patterns. The timing lines up with the broader shift from "AI demo" to "AI product" - teams that got prototypes working in late 2024 are now grappling with reliability, cost, and operability.
The repo is a living design guide, not an installable package. It defines 12 principles for building agent systems that are reliable enough to put in front of real customers. Each factor gets its own markdown document with explanation, code samples in TypeScript and Python, and links to production implementations.
The 12 factors are:
The common thread is treating LLM calls as one step inside a deterministic system rather than as the system itself. Factor 8 ("Own your control flow") is probably the most controversial - it directly challenges the premise of frameworks like LangGraph and AutoGen that abstract the agent loop.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
May 17, 2026 • 8 min read
May 17, 2026 • 5 min read
May 16, 2026 • 8 min read
May 16, 2026 • 6 min read
There is no npm install. This is intentional. The project is a reference, not a dependency.
git clone https://github.com/humanlayer/12-factor-agents
cd 12-factor-agents
ls content/
The content/ directory has one markdown file per factor. Start with factor-01-natural-language-to-tool-calls.md and read linearly - each factor builds on the previous one conceptually.
For the code examples, the TypeScript samples are standalone and runnable. The repo also links to HumanLayer, the team's own open-source library for the human-in-the-loop patterns described in Factor 7. If you want a working implementation that embodies these principles, the HumanLayer examples are the fastest path to running code.
The license is worth noting: content is CC BY-SA 4.0 and code is Apache 2.0, so you can adapt the principles into your own internal playbooks without restriction.
This material is aimed squarely at engineers who have shipped at least one agent prototype and are now dealing with the gap between "it works in the notebook" and "it works reliably in production at 3am when no one is watching."
If you are still in the proof-of-concept phase, some factors will feel abstract. Factor 5 (unifying execution and business state) and Factor 12 (stateless reducer) only become painful after you have debugged a few corrupted agent runs in a live database.
If you are a team lead or architect evaluating agent frameworks, this repo is a useful rubric. You can score any framework - LangChain, CrewAI, AutoGen, raw OpenAI function calling - against the 12 factors and get a concrete picture of what each framework makes easy versus what it hides from you.
Founders building AI-native products will find Factor 6 (Launch/Pause/Resume) and Factor 11 (trigger from anywhere) most immediately actionable. Those two factors, taken together, describe the infrastructure shape of a production agent service.
Several of these factors map directly to patterns covered in the DevDigest skills and MCP ecosystem.
Factor 2 (Own your prompts) is what the Claude Code skills system is built around - skills are versioned, composable prompt units that live in your repo, not hidden inside a black-box framework. Every skill in that directory is an applied instance of Factor 2.
Factor 7 (Contact humans with tool calls) is the core design of the Claude Code hooks system at hooks.developersdigest.tech. Hooks intercept agent actions at defined lifecycle points and route them to human approval flows - exactly the pattern 12-Factor Agents recommends.
Factor 11 (Trigger from anywhere) is the design premise of subagent.developersdigest.tech, which covers spawning Claude agents from CLI scripts, GitHub Actions, web hooks, and scheduled tasks. The same agent logic, exposed at multiple trigger surfaces.
If you are using Claude Code as your primary development agent, the 12-Factor Agents principles are a useful lens for auditing whether your CLAUDE.md files, skills, and hooks are set up to be maintainable long-term.
The strengths are real. This is probably the most coherent single-source articulation of production agent architecture currently available in the open. Factor 8 (Own your control flow) and Factor 12 (stateless reducer) alone are worth the read for any team that has struggled to debug an agent mid-run.
The limitations are also real. The repo is documentation-only - there is no reference implementation that demonstrates all 12 factors working together end-to-end. The TypeScript examples are illustrative, not production-ready. Factor 5 (unify execution and business state) in particular gets a fairly thin treatment for something that requires significant database and schema design to implement well.
The framework-agnostic stance is a feature for experienced teams and a potential source of confusion for beginners. If you are just starting with agents, you may find the principles abstract without a concrete framework to apply them against. Read the repo alongside an actual implementation - HumanLayer's own examples or the patterns in the Claude Code ecosystem are reasonable starting points.
Overall, this belongs in your bookmarks alongside the original 12 Factor App, not as a prescriptive checklist but as a vocabulary for discussing what "good" means when shipping LLM software.
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 ToolThe original server-side JavaScript runtime. V8 under the hood, npm ecosystem, and the default backend runtime for most...
View ToolA practical framework for building LLM-powered software that actually ships to production customers - not just demos. 21...
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.