<!-- https://zerolog.ch/docs/project-brain · Docs / Agents -->
# Project Brain: decisions and requirements

> Project Brain keeps the product knowledge of a container in one place: what the project is for, its requirements, architecture decisions with their reasons, milestones and dependencies.

Project Brain keeps the product knowledge of a container in one place: what the project is for, its requirements, architecture decisions with their reasons, milestones and dependencies. A new chat on the container gets a short version of it in its context, so the model knows why the code looks as it does, not only what it contains.

## Where it lives and how to open it

- The knowledge is one JSON file in your workspace, `/work/.zerolog/brain.json`. It sits next to your code, so you can commit, review and revert it together with the code. The agent in the container can read and update it with its normal tools. The file may be up to 64 KB.
- The page **Project Brain** in the sidebar (`/brain`) lists your containers. Pick one, edit the sections (summary, requirements, decisions, milestones, dependencies, change log) and save. Only you, the owner, can open it. A paused container has to be started before you can save.
- If an agent changed the file while you were editing, saving is refused and the page offers a reload instead of overwriting the agent's change.

## What the model sees

- Every chat on the container gets a compact block after your project rules: purpose, active decisions with their reason, open requirements, open milestones, dependencies and the last eight changes. The block is capped at 4 KB. If it does not fit, whole lines are dropped and the block says how many.
- The model is told to name a decision and its reason before it acts on a request that contradicts it, and to append significant changes to the change log.
- In a shared workspace the brain is not added to the chat context, so a member cannot plant instructions with the owner's authority.

## Guards on decisions

- A decision can carry a guard: **Forbidden paths** and **Forbidden text** mark a change as a conflict, **Watched paths** only report that a change touches the decision's area. Paths work like `.gitignore` patterns. Text is matched case-insensitively.
- When a chat agent writes a file with `write_file` or `edit_file` and the path or the new text hits a conflict guard, the tool result names the decision and its reason. The agent then has to tell you and ask. Writing `brain.json` itself never warns.
- **Check a change** on the page runs the guards against paths and text you paste, so you can test a rule before relying on it.

## Limits

- The check is rule-based and does not understand meaning. Whether a request contradicts a decision is judged by the model from the reasons in its context.
- Changes made through shell commands are not checked by the server. Terminal agents such as Claude Code or Codex in the container see the file only if they read it themselves; the automatic context applies to ZeroLog chats.

Related: [Containers](https://zerolog.ch/docs/containers), [Compaction](https://zerolog.ch/docs/compaction), [Memory](https://zerolog.ch/docs/memory).
