---
title: "The codebase is a society: what Luhmann teaches people who build with agents"
url: "https://simonebova.com/en/writing/la-codebase-e-una-societa"
lang: "en"
updated: "2026-11-09"
author: Simone Bova
alternates:
  it: "https://simonebova.com/md/it/writing/la-codebase-e-una-societa"
  en: "https://simonebova.com/md/en/writing/la-codebase-e-una-societa"
  pl: "https://simonebova.com/md/pl/writing/la-codebase-e-una-societa"
---

# The codebase is a society: what Luhmann teaches people who build with agents

2026-11-09 · Frontier

For Niklas Luhmann a society is made of communications. Applied to a codebase where many agents work, it changes how I write handoffs, reviews and stops. A hypothesis, with the rules I took from it.

Niklas Luhmann, the German sociologist (1927–1998), argued in “Social Systems” (1984) that a society is made of communications. People are indispensable, but they sit in its environment. My hypothesis is that a codebase where many agents work behaves the same way. The agents are the environment, and the codebase is made of what they exchange: commits, pull requests, findings, failing tests, fixes, reviews, written decisions. It's a lens, and it is already changing how I build.

I got there through a side quest. I was brainstorming with ChatGPT about Paul Watzlawick and constructivism, and the conversation slid into Luhmann, from cybernetics to the theory of society. The more I read, the more I recognised my repos.

## Luhmann in five ideas

- Society is made of communications. In “Social Systems” a communication is the synthesis of three selections: information, utterance, and understanding, misunderstanding included. Understanding sits on the receiver's side, so nobody can make a communication happen alone. It's the opposite of Shannon's model, where a message travels from a sender to a receiver.
- Autopoiesis. The term comes from “De máquinas y seres vivos” (1972) by the Chilean biologists Humberto Maturana and Francisco Varela: a system that produces the elements it is made of. Luhmann carries it from the cell to society. One communication produces more communications, and that's how the system reproduces itself.
- Minds and society are different systems. Thinking and communicating are different operations: without minds there is no communication, but society is made of the second alone.
- Functional differentiation. Each subsystem observes the world through its own binary code: science through true and false, law through legal and illegal, the economy through paying and not paying. In “The Reality of the Mass Media” (1995) the media become a system too, with the code information and non-information.
- Second-order observation. Luhmann takes it from Heinz von Foerster and from George Spencer-Brown's “Laws of Form” (1969): observing means drawing a distinction, and an observer can't see the distinction it is using. To see it you need someone observing how you observe.

## The agents are the environment. The codebase is the communication.

Agents come and go. A session ends, the context gets compacted, the model changes every release. What remains is what they left where the next one can read it. A brilliant line of reasoning left in a chat never happened, as far as the codebase is concerned.

“The Reality of the Mass Media” opens with an idea that holds word for word for agents: whatever we know about society and the world, we know through the mass media. Whatever an agent knows about the codebase, it knows through what is written in the codebase. It has no other channel.

So I judge an agent by what it leaves behind: a written decision, a test that fails before the fix and passes after, a PR that says what it tried, what's still open and how to revert. It's the same rule I use in the company brain: a handoff is done when the receiver can read it ([here](https://simonebova.com/en/writing/context-is-gold)). Luhmann would say a communication is completed by whoever understands it.

## One cannot not communicate, not even in a repo

Paul Watzlawick, with Janet Beavin and Don Jackson, wrote “Pragmatics of Human Communication” in 1967, the book of the Palo Alto school. The first of its five axioms is the most quoted: one cannot not communicate. Silence says something too.

In a research project this autumn, a test suite skipped itself whenever the container engine was off, and the run said green ([the story](https://simonebova.com/en/writing/nessuno-legge-ogni-riga)). Nobody had written "all good". The silence said it. An old TODO says "this is how we do it here". A dead file says it's still needed. The next agent reads all of it and builds on top.

That makes cleanup first-class work. Everything left in the repo is a message to someone who wasn't there.

## The other four axioms, read in a repo

- Every communication has a content and a relationship aspect, and the relationship tells you how to read the content. In a repo the relationship is the status of a claim: hypothesis, proposal, decision made. Without it, an agent reads a hypothesis as a decision. We paid for that in the company brain ([here](https://simonebova.com/en/writing/context-is-gold)). In “The Invented Reality”, David Rosenhan's study shows the extreme case: once a label is given, every later behaviour is read through the label.
- Punctuation of the sequence. Each side splits the same exchange into cause and effect its own way. In a review loop the author thinks it's answering the reviewer, the reviewer thinks it's answering the author's new bug, and each is right from where it stands. That's why neither stops by itself.
- Digital and analogic communication. Agents read code two ways: what it says, and the shape it has. Names, structure, the file next door. They copy the shape as faithfully as the content, so one obvious way to do each thing beats any instruction.
- Symmetrical and complementary interaction. Two agents with the same authority drift into symmetrical escalation: every fix produces a finding, every finding a bigger fix. Complementary roles stop it: the bot describes the risk, a person signs ([here](https://simonebova.com/en/writing/nessuno-legge-ogni-riga)).

## Each context observes through its own code

Functional differentiation explains my previous essay better than I did ([multi-context](https://simonebova.com/en/writing/non-e-mai-stato-multi-agent)). CI observes a change through green and red. Review through finding and no finding. The second brain, when I reason about product, through should exist and shouldn't exist. Three systems look at the same change through three codes, the way science, law and the economy look at the same event.

An agent with a single code does its job well. Ask one agent to decide both whether the code is correct and whether the feature makes sense, and it mixes two codes, and usually one of them loses. I give each context one question and let it answer through its own code.

## A blind spot is only visible from outside

A model rereading its own work in the same context uses the same distinctions that produced the mistake, so it sees it poorly. That's why I always get review from a model of another family, in a separate context. It's second-order observation: someone watching how the author watched.

The limit applies to me too. I observe through my own distinctions, and what I discard leaves my field of view. That's why I write product decisions with the alternatives I dropped: whoever comes next can see what I didn't.

## A system that reproduces itself needs a stop

A finding produces a fix, the fix produces a review, the review another finding. That's autopoiesis, and it's why a codebase with many agents keeps moving when you're not looking. It's also why a review loop nobody stops drains your weekly. The system has no internal reason to stop communicating. The stop has to come from outside: a cap on rounds, only the new diff after the first ones, a confidence threshold.

## There is no center that sees everything

For Luhmann modern society has no center that observes and steers the rest. Neither does a codebase with many agents. The orchestrator is an observer like the others, with its own blind spot, and an orchestrator that has to know everything becomes the bottleneck ([here](https://simonebova.com/en/writing/il-modello-intelligente-e-il-collo-di-bottiglia)). What holds the system together is structure every agent reads: types, gates that fail, written decisions, one obvious way to do each thing ([here](https://simonebova.com/en/writing/cambia-il-codice-prima-del-prompt)).

## The first second brain was made of wood

Luhmann worked for decades with an archive of about 90,000 index cards, his Zettelkasten. In 1981, in "Kommunikation mit Zettelkästen" ("Communicating with slip boxes"), he described it as a communication partner: a system to talk with, with many traits of a separate person, able to surprise him. Bielefeld University, where he taught from 1969 to 1993, is now digitising it and publishing it online. My second brain is the same idea in Markdown, with an agent that reads all of it.

In the previous essay the second brain and the repo exchange information and nothing else. In Luhmann's words they are two operationally closed systems in structural coupling: neither enters the other's operations, each reads what the other produces and turns it into information of its own. The closure is what keeps them clean.

## The strongest objection: it's just a metaphor

Maybe. Jürgen Habermas argued with Luhmann for decades, starting from the book they signed together in 1971, “Theorie der Gesellschaft oder Sozialtechnologie” (Theory of society or social technology). Luhmann asked which processes keep a social system alive. Habermas asked under which conditions communication stays free of constraint, and for him reducing it to a system left people out. The risk here is similar, because treating humans as the repo's "environment" sounds cold.

In my work the opposite happens. Agents produce communications faster than anyone can read line by line, and my work moves to where the system can't reach by itself: deciding what should exist, which code each context uses, where the stops go. The lens is worth keeping as long as it makes me decide better. So far it does.

## From Monday

- Judge an agent by what it leaves where the next one reads.
- Treat silence as a message: skipped tests, old TODOs and dead files get read.
- Give each context one question and one code.
- Have the author observed by another model, in another context.
- Put the stop from outside on every loop that reproduces itself.
- Govern with structure everyone reads, and leave the orchestrator its blind spot.
- Write decisions with the alternatives you dropped.

## Further reading

- Niklas Luhmann, “Social Systems”, Stanford University Press, 1995 (German original “Soziale Systeme”, Suhrkamp, 1984). The theory of communication and social autopoiesis.
- Niklas Luhmann, “The Reality of the Mass Media”, Stanford University Press, 2000, trans. Kathleen Cross (German original 1995). A short first Luhmann.
- Niklas Luhmann, "Kommunikation mit Zettelkästen. Ein Erfahrungsbericht", 1981. A few pages on his card archive as a communication partner; English translations circulate online.
- Jürgen Habermas and Niklas Luhmann, “Theorie der Gesellschaft oder Sozialtechnologie”, Suhrkamp, 1971. The debate.
- Humberto Maturana and Francisco Varela, “Autopoiesis and Cognition: The Realization of the Living”, Reidel, 1980 (Spanish original 1972).
- Paul Watzlawick, Janet Beavin and Don Jackson, “Pragmatics of Human Communication”, Norton, 1967. The five axioms.
- Paul Watzlawick (ed.), “The Invented Reality”, Norton, 1984 (German original 1981). Von Foerster, von Glasersfeld, Varela, Rosenhan.

*// it's a hypothesis. if it breaks in a real repo, I'll rewrite it here.*

[simone@yempik.ai](mailto:simone@yempik.ai) · [Book a call](https://calendar.app.google/LKDrQPKGV2EAFCMN9)
