# Claude Code memory starter

A small, boring system for people whose agent keeps forgetting context.

This is not magic memory. It is a filing cabinet Claude can read.

## 1. Root CLAUDE.md

Create `CLAUDE.md` in the project root:

```md
# Project briefing

## What this is
[One paragraph. Product, stack, users, current stage.]

## Commands
- Install: `[command]`
- Dev: `[command]`
- Test: `[command]`
- Build: `[command]`

## Current work
- Active objective: `[what we are doing now]`
- Current branch/worktree: `[branch name]`
- Stop condition: `[what counts as done]`

## Hard rules
- Do not edit `[paths]` without asking.
- Do not run `[dangerous commands]`.
- Always verify with `[test/build command]` before claiming done.

## Project map
- `[path]` = `[meaning]`
- `[path]` = `[meaning]`

## Memory routine
At the end of a meaningful session, update `docs/session-log.md` with:
- what changed
- decisions made
- files touched
- verification run
- open questions
```

Keep this under ~150 lines. If it grows, split details into `docs/` and link them.

## 2. Session log

Create `docs/session-log.md`:

```md
# Session log

## YYYY-MM-DD — short title

### Goal
[What we tried to do.]

### Changed
- `[file]`: [what changed]

### Decisions
- [Decision + why]

### Verification
- `[command]` → [result]

### Open threads
- [Question / next step]
```

## 3. Decision file

Create `docs/decisions.md`:

```md
# Decisions

## YYYY-MM-DD — [decision]

We chose [X] instead of [Y] because [reason].
This matters later because [constraint/tradeoff].
```

## 4. Session closer prompt

Paste this before ending a Claude Code session:

```text
Before we stop, write a compact session closeout.
Update CLAUDE.md only if a durable project instruction changed.
Append docs/session-log.md with what changed, decisions, verification, and open threads.
Append docs/decisions.md only for decisions that will still matter in a month.
Do not dump the transcript. Save distilled state only.
```

## 5. What not to do

- Do not paste raw chat logs into memory.
- Do not turn CLAUDE.md into a company wiki.
- Do not save every tiny observation.
- Do not trust stale docs. Date things.
- Do not sell yourself a RAG system before you can maintain three markdown files.

The useful bit is discipline, not the tool.
