# Write The Claude Md

> Use when an agent keeps relearning the codebase from a blank page every session and getting it confidently wrong. Reach for it when a founder says "write my CLAUDE.md", "the agent forgot how our system works again", "it reinvents the structure every time", "set up the master file", "do I need AGENTS.md and a Cursor rules file too", "keep memory across sessions", "it broke a rule nobody told it",…

- **Type:** Skill
- **Install:** `agentstack add skill-impactbrussels-ainativeos-write-the-claude-md`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [impactbrussels](https://agentstack.voostack.com/s/impactbrussels)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [impactbrussels](https://github.com/impactbrussels)
- **Source:** https://github.com/impactbrussels/AINativeOS/tree/main/skills/write-the-claude-md
- **Website:** https://impact.brussels

## Install

```sh
agentstack add skill-impactbrussels-ainativeos-write-the-claude-md
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Write the CLAUDE.md

A clever prompt dies the instant the context window clears. The agent forgets, reconstructs a theory
of your system from whatever it can see, and builds against that improvised theory, slightly
differently every session, until one repository houses three half-systems that almost agree. The
master file is the cure. It is the memory the model does not have: the one document read at the top
of every session so the work starts where you left it, not from a guess. Write it before the first
feature, not after the first regression.

## The method

Author one master file, mirror it to every platform, and keep it alive with a session-end ritual.
Full anatomy, worked before-and-after, and anti-patterns: [`references/master-file-anatomy.md`](references/master-file-anatomy.md).

### Step 1: Write the seven sections, and nothing else

The file earns its keep by being short and current. Include the standing context an agent would
otherwise guess; exclude anything that lives better in code or goes stale by Friday.

| Section | What it holds | Keep out |
|---------|---------------|----------|
| What this is | One paragraph: the product and its one closed loop. | Marketing copy. |
| System inventory | The four pillars named: Brain, Memory, Planning, Tools. | API keys, secrets. |
| Principles | The non-negotiable rules of this codebase. | Generic best practice the model already knows. |
| Constraints | The limits a newcomer would break by accident. | Anything enforced by a linter or test. |
| Decisions | Dated trade-offs made and why, newest first. | Decisions already reversed; prune them. |
| Glossary pointers | Links to the domain terms, not the definitions. | Full definitions that drift from source. |
| Update ritual | The one-line rule for keeping this file alive. | A changelog of every commit. |

### Step 2: Mirror it across every platform you use

The same source serves four runtimes. A rule in only one file is a rule the other three agents break.

| Platform | File it reads |
|----------|---------------|
| Claude Code | `CLAUDE.md` |
| Codex | `AGENTS.md` |
| Cursor | `.cursor/rules/.mdc` |
| Gemini CLI | `GEMINI.md` |

Write the content once. Mirror the mirrors so they never disagree; a contradiction between them is
worse than no file, because each agent obeys a different one.

### Step 3: Install the session-end update ritual

At the end of every working session, add exactly one line naming the trade-off you just made. Not a
diff, not a diary. One decision, dated. This is the discipline that keeps the file true; without it,
the file rots into a confident, stale lie that misleads every session after.

## Output

- A populated **master file** (`CLAUDE.md`) with the seven sections filled for the founder's repo.
- The **platform mirrors** (`AGENTS.md`, `GEMINI.md`, `.cursor/rules/.mdc`) carrying the same content.
- A documented **session-end update ritual**: one dated line per session, naming the trade-off made.
- Next: run `agentic-build-loop` to generate against the master file, never a blank page.

## Constraints

- A stale file is worse than none. Forbid shipping the file without the update ritual that keeps it true.
- Do not dump everything. The file is the standing context, not a changelog; anything a linter or test enforces does not belong here.
- Treat a model bump or prompt edit as load-bearing (CACE): if it changes behaviour, it earns a line in Decisions, not a silent commit.
- Stay theme-agnostic; the founder supplies the domain, you supply the structure.

## Dictionary

[context window](../../dictionary/02-context-and-sessions.md#context-window) ·
[CACE](../../dictionary/05-failure-modes.md#cace-changing-anything-changes-everything)

## Copy-paste version

> For non-coders: paste into any chatbot or no-code builder (Claude.ai, ChatGPT, Lovable, Bolt, v0).

```
Act as my lead systems engineer. Write the master memory file for my repo so every AI session starts
where the last one stopped instead of reinventing my codebase.
My product: [ONE_LINER]. Domain: [DOMAIN]. My closed loop: [INTELLIGENCE_LOOP].

Draft a CLAUDE.md with exactly these seven sections, short and current:
1. What this is: the product and its one closed loop, one paragraph.
2. System inventory: name the four pillars (Brain, Memory, Planning, Tools) for my product.
3. Principles: the non-negotiable rules of this codebase.
4. Constraints: the limits a newcomer would break by accident, including [CONSTRAINT] and [GUARDRAIL].
5. Decisions: dated trade-offs, newest first (seed it with today's).
6. Glossary pointers: the domain terms to link, not define.
7. Update ritual: the one-line rule for keeping this file alive.

Then produce the same content as mirrors named AGENTS.md, GEMINI.md, and .cursor/rules/project.mdc,
so Codex, Gemini, and Cursor obey the same rules. Keep them identical.

CONSTRAINTS: do not dump a changelog or anything a linter enforces; keep it the standing context only.
Treat any model or prompt change that alters behaviour as a Decisions entry, not a silent edit.

OUTPUT: the filled CLAUDE.md, the three mirrors, and a one-line session-end ritual I run every time.
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [impactbrussels](https://github.com/impactbrussels)
- **Source:** [impactbrussels/AINativeOS](https://github.com/impactbrussels/AINativeOS)
- **License:** Apache-2.0
- **Homepage:** https://impact.brussels

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-impactbrussels-ainativeos-write-the-claude-md
- Seller: https://agentstack.voostack.com/s/impactbrussels
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
