Overview
The state.* block picks where rousseau persists everything: sessions, messages, cron jobs, JID map, claude cache, FTS5 recall index. Concrete implementation: internal/state/sqlite/store.go.
state.*
| Field | Type | Default | Required | Description | Source |
|---|---|---|---|---|---|
state.path |
string | $XDG_DATA_HOME/rousseau/sessions.db (defaults to ~/.local/share/rousseau/sessions.db) |
no | Absolute path to the SQLite database. Parent directories are created with mode 0755. |
StateConfig.Path in internal/config/config.go; default injected in setDefaults |
That's the only key. Everything else is fixed by the SQLite pragmas applied in sqlitestore.Open:
| Pragma | Value | Rationale |
|---|---|---|
journal_mode |
WAL |
Concurrent readers, single writer, safe under crashes. |
busy_timeout |
15000 |
15s wait before returning SQLITE_BUSY. |
foreign_keys |
1 |
Cascading deletes when a session is removed. |
synchronous |
NORMAL |
Durability + speed compromise (WAL truncates on checkpoint). |
Environment variables
| Variable | Effect |
|---|---|
ROUSSEAU_STATE_PATH |
Overrides state.path. |
XDG_DATA_HOME |
Base directory when state.path is unset. |
Worked examples
# No override needed
Rousseau creates ~/.local/share/rousseau/sessions.db on first launch.
state:
path: /var/lib/rousseau/sessions.db
Combined with the Quadlet unit's Volume=%h/.local/share/rousseau:/var/lib/rousseau:rw,Z, the container writes to a persistent bind mount. See Deployment.
# per-project config
state:
path: /projects/webapp/rousseau/sessions.db
Each project gets its own database, isolating conversation history and FTS5 recall. See Best Practices: Multi-tenant.
Migration paths
- Bare-metal → container: copy the file, adjust
Volume=in the Quadlet unit, restart. WAL/SHM files can travel with the main DB but will be recreated at first open. - Move to a bigger disk: stop rousseau,
cp -a sessions.db* /new/location/, updatestate.path, restart. - Reset:
rm ~/.local/share/rousseau/sessions.db*— you lose all conversation history and cron jobs. Considerrousseau session delete <id> --yesfor targeted removal.
See Migrations: Container migration and Best Practices: Disaster recovery.