Configuration
brainjar’s configuration surface is small on purpose. Effective state comes from a two-tier cascade (workspace → project). State is which soul, persona, procedure, rules, and skills are active. Where things live on disk is governed by ~/.brainjar. The active platform and remote endpoint are bundled into a context. That’s the whole picture.
State cascade
Section titled “State cascade”State merges in two tiers. The lower tier overrides the higher one:
workspace → projectWorkspace state
Section titled “Workspace state”The default everyone in the workspace sees. Every CLI state command (soul use, persona use, procedure use, rule add, rule remove, etc.) writes here:
brainjar soul use craftsman # workspace soulbrainjar persona use engineer # workspace personabrainjar procedure use delivery # workspace procedurebrainjar rule add security # workspace ruleProject state
Section titled “Project state”A per-repo override that only applies inside one project. Workspace settings still flow through — project state only changes the layers you explicitly set at project scope.
Project-scoped state is read at sync/status/compose time but is not writable from the regular CLI commands. brainjar persona use, soul use, rule add, and friends always write to workspace state regardless of cwd. To write a project-scoped override, call the state_set MCP tool with a project field — typically from inside an agent session, where the agent’s MCP client targets a specific repo.
// From an agent — state_set with project field writes a project layer{ "tool": "state_set", "input": { "project": "my-project", "persona_slug": "planner", "rules_to_add": ["no-delete"] }}Once a project layer exists, brainjar status shows both the effective state (resolved across all layers) and the raw layer chain underneath:
workspace: <uuid>home: ~/.brainjar
effective state soul: craftsman persona: planner procedure: (unset) rules: - boundaries - no-delete
layers workspace/<uuid> soul=craftsman persona=engineer procedure=(absent) +[boundaries] -[] project/my-project soul=(absent) persona=planner procedure=(absent) +[no-delete] -[]Each layer entry shows +[…] for rules added at that scope and -[…] for rules masked off. The effective state is the merged view: project overrides workspace where set, otherwise workspace wins.
See brainjar status and brainjar sync.
Project scope resolution
Section titled “Project scope resolution”Project scope is auto-resolved from the working directory. The lookup order:
--project <slug>flag. Always wins. Supported on commands that accept a project (e.g.status,sync).- Nearest
.gitroot basename. The CLI walks up from cwd to the first.gitdirectory and uses its parent’s basename as the project slug — but only if the basename is a valid slug (lowercase, hyphen-separated, must start with a letter and end alphanumeric:^[a-z]([a-z0-9-]*[a-z0-9])?$). - Fallback: workspace scope. If the basename isn’t a valid slug (contains dots, underscores, or capitals — for example
my.projectorMyProject), brainjar falls back to workspace scope and emits a warning on stderr.
There is no .brainjar/ discovery directory and no session scope. State is always either workspace or project.
Environment
Section titled “Environment”The only supported environment variable is:
| Variable | Effect |
|---|---|
BRAINJAR_HOME | Override the brainjar home directory (default ~/.brainjar). Equivalent to passing --home <path> on every invocation. |
There are no env vars for activating a soul, persona, or rule. State is set with soul use / persona use / rule add, and applied to the agent via brainjar sync or brainjar shell.
Config file
Section titled “Config file”~/.brainjar/config.yaml holds the active context pointer and the registered contexts:
active_context: defaultcontexts: default: platform: claude workspace_id: 767a626d-b7a7-4406-997a-0ee27370acabschema_version: 1It is managed by brainjar context … and brainjar workspace switch. Don’t edit it by hand — use the commands. Alongside it, ~/.brainjar/brainjar.db is the SQLite database that stores souls, personas, rules, brains, state, and API keys.
Platforms
Section titled “Platforms”A platform adapter knows where the agent’s config lives, where to install hooks, and where to register MCP. The active context binds to one platform. The default is claude.
List the registered adapters:
brainjar platform listname active sync hooks mcp spawn scopesclaude * yes yes yes yes project, local, usercodex yes yes yes yes project, usercursor yes yes yes no project, userSwitch the active platform by switching contexts. There is no --backend or --platform flag on init or reset:
# Add a Codex context and use itbrainjar context add codex --platform codex --workspace <uuid>brainjar context use codexSee brainjar platform and brainjar context.
Backup & restore
Section titled “Backup & restore”brainjar sync writes only inside a managed section delimited by markers in your platform’s config file:
<!-- brainjar:begin -->… brainjar-managed content …<!-- brainjar:end -->Everything outside the markers is yours. Re-running sync rewrites only what’s between the markers; user content above and below is preserved verbatim.
To pull brainjar out:
brainjar reset --yesThis removes brainjar.db and config.yaml from the brainjar home. Other files in the home (packs, exports) are left alone. reset does not touch the platform’s config file — remove the brainjar-managed block from CLAUDE.md (or AGENTS.md) by hand if you want it gone.
See brainjar reset.
For decomposing an existing monolithic config into souls, personas, and rules, see Migrating from Monolithic Prompts.