What is context as code?

Definition

The approach treats agent context as a maintained part of the software system instead of an improvised prompt. Files can define goals, design choices, workflows, acceptance criteria and lessons learned in a form that changes alongside the repository.

Version control makes context reviewable, comparable and recoverable. The files still need ownership and validation because stale or contradictory instructions can reliably guide every agent in the wrong direction.

ELI5

Context as code means keeping the important background for AI agents in maintained project files. The agents can read the same goals, architecture and working rules instead of rebuilding that understanding from each conversation.

For example, a repository can store its design decisions and completion rules beside the source code. When a new coding agent begins, it receives the current version, and reviewers can see exactly when those instructions changed.

Frequently asked questions

What information belongs in context-as-code files?

Project goals, architecture, conventions, decisions, workflows, acceptance criteria and reusable lessons can belong there.

Why version agent context?

Versioning makes changes reviewable, attributable, reversible and synchronized with the software they describe.

Videos explaining context as code

  1. Portraits of David Ondrej, Alex Lieberman and Dan Zakon beside the words Context Is the System