# Where everything lives

One data folder + one .planning/ inside your chosen project = Kaptain's whole footprint.

## The map
| Thing | Where |
|---|---|
| Configuration | kaptain.json in the data folder — private; holds this device's credentials |
| Conversations | sessions.db |
| Models, agents, provider keys | models.db |
| Kapsules | kapsules/<name>/kapsule.json (persona, schedule, grants — editable) |
| Project working notes | .planning/ inside your chosen project folder |
| Logs | kaptain.log (data folder); `kaptain status` prints the path |
| Server pid (via `start`) | kaptain.pid |
| Update backup | previous binary as <binary>.bak next to the installed one |

## Per-OS data folder
- Linux: ~/.local/share/kaptain/
- Windows: %LOCALAPPDATA%\Kaptain
- macOS: ~/Library/Application Support/Kaptain

## Back up / move a box
1. `kaptain stop` (never copy the DBs under a running server).
2. Copy the data folder (+ .planning/ if wanted).
3. New machine: install Kaptain, put the folder in place, start.
4. Certificate is per-machine: `kaptain device register` on the new box — fresh access code; devices re-pair once. https://chynj.ca/kaptain/docs/how-to/fix-402/

## Overriding the data folder
`KAPTAIN_DATA_DIR=/path kaptain start` — the only override honoured, deliberately. Good for a sandboxed second instance.
