Molveau
All guides

AI workflow3 min read

Build an AI brain for your dev work

The exact setup I use to make Claude Code remember my projects, my standards, and my past mistakes — memory files, skills, and subagents, with copy-paste templates.

Most people use AI coding tools with amnesia turned on. Every session starts from zero: re-explain the project, re-explain the conventions, watch it make the same mistake it made last week.

The fix is not a better prompt. It is a brain: a small set of plain text files that your AI reads at the start of every session. I run my studio on this setup. Here is the whole thing.

The three layers

  1. Instructions — a CLAUDE.md file that says who you are, how you work, and what the tool must never do. Read automatically at every session start.
  2. Memory — one file per fact the AI should keep across sessions: project state, decisions, things you corrected it on.
  3. Skills — reusable playbooks for tasks you repeat: your deploy process, your design conventions, your review checklist.

All of it is plain markdown, versioned in git. No vendor lock-in, no database.

Layer 1: the instructions file

Create a CLAUDE.md at the root of your project (or ~/.claude/CLAUDE.md for global rules). Keep it short and blunt. Mine enforces things like: verify before claiming done, never commit unrelated files, lead with the answer.

Copy-paste starter:

# Working rules

## Verification — non-negotiable
- Never report a task complete until typecheck and lint pass.
- A file write is not success. Code must compile.

## Git discipline
- One feature per branch. Scoped commits: add exact files, never `git add .`
- Never push without running the project checklist.

## Output discipline
- Lead with the result. No filler, no restating the question.
- When the answer is one line, give one line.

## Project facts
- Stack: [your stack]
- Commands: typecheck `npx tsc --noEmit`, lint `npx eslint . --quiet`, test `npm test`

The last section matters most: commands the AI can run to check its own work. That single block removes half the babysitting.

Layer 2: memory files

One file per fact, plus an index. The index is loaded every session; individual memories are pulled in when relevant. Structure:

memory/
  MEMORY.md            <- index: one line per memory
  api-rate-limits.md   <- one fact
  client-x-scope.md    <- one fact

Each memory file:

---
name: api-rate-limits
description: Our provider caps at 100 req/min — batch accordingly
type: project
---

The payment provider rate-limits at 100 requests/minute.
Why: hit this in production on 2026-05-02.
How to apply: batch webhook retries, never loop unthrottled calls.

The rule that makes this work: after any correction, write a memory. If you told the AI "no, we use tabs here" once, that sentence belongs in a file, not in your patience.

Layer 3: skills

A skill is a markdown playbook the AI loads when a task matches. Design conventions, deployment steps, review checklists — anything you would otherwise re-explain.

---
name: design-taste
description: Invoke before any UI work — typography, spacing, motion rules
---

## Typography
- Body text max 65 characters per line
- Bold for emphasis, never italic. Underline only for links.

## Motion
- Animate only transform and opacity. Keep under 300ms.
- Always honor prefers-reduced-motion.

Claude Code picks these up from .claude/skills/ automatically. Ten short skills beat one giant document: the AI loads only what the task needs.

Subagents: the multiplier

For big tasks, do not let one session do everything. Have the main session dispatch subagents: one explores the codebase, one implements, one reviews. Each gets a clean context and a single job. The main session stays the orchestrator and keeps the overview.

Practical rule: research and exploration go to subagents, decisions stay with you and the main session.

Start today, small

  1. Write a 20-line CLAUDE.md with your verification commands.
  2. Create memory/MEMORY.md, empty.
  3. Next time you correct your AI, save the correction as a memory file.

That loop — correct once, remember forever — is the whole brain. Everything else is refinement.

Get the next guide by email

One short email when a new guide ships. No noise, no spam, unsubscribe anytime.