# Agent instructions

## Session start

Before doing anything else, run:

```bash
ctxbaton resume
```

This loads the project spec, open todos, recent decisions, last handoff, and what
changed in code since the last session. Do not skip this — it is the source of
truth for what to work on and what was decided.

## During the session

Mark a todo as started:
```bash
ctxbaton todo start <id>
```

Mark a todo as done:
```bash
ctxbaton todo done <id>
```

Save a design or architecture decision:
```bash
ctxbaton memory save --type decision "<what was decided and why>"
```

Add a new todo:
```bash
ctxbaton memory save --type todo "<task description>"
```

Search past context:
```bash
ctxbaton search "<query>"
```

## Before ending the session or switching agents

Always run this before closing — there is no automatic hook.
Replace `<agent>` with your own name (e.g. `opencode`, `codex`, `cursor`):

```bash
ctxbaton handoff "<what you did, what's next, any blockers>" --agent <agent>
```

If there is nothing specific to hand off, still capture state:

```bash
ctxbaton capture --trigger manual --agent <agent>
```
