Files and directories
Reference
Every file and directory mare reads or writes: the four user directories, what is inside each, and the files a project can carry. Paths use ~ for the home directory; on Windows read it as %USERPROFILE%.
This reference page is maintained by hand (not generated by
scripts/gen_docs.py).
Locations
Section titled “Locations”mare uses XDG-style directories on every platform. macOS and Windows do not get Library or AppData locations.
| Directory | Default | Override |
|---|---|---|
| Config | ~/.config/mare |
$XDG_CONFIG_HOME/mare |
| State | ~/.local/state/mare |
$XDG_STATE_HOME/mare |
| Data | ~/.local/share/mare |
$XDG_DATA_HOME/mare |
| Cache | ~/.cache/mare |
$XDG_CACHE_HOME/mare |
MARE_HOME beats all of those: the four directories become $MARE_HOME/config, state, data and cache. See Environment variables. Lua code gets the same paths as mare.paths.config, mare.paths.state, mare.paths.data, mare.paths.auth, mare.paths.sessions and mare.paths.packages.
mare doctor checks that these directories exist and are writable, and on Unix that auth.json is mode 0600 and the sessions and state directories are mode 0700.
Config directory
Section titled “Config directory”Files you write and edit.
| Path | Purpose |
|---|---|
init.lua |
Your configuration. mare init creates it and never overwrites it. See Options. |
.luarc.json |
Lua language server settings pointing at mare’s type files. mare init writes it, and rewrites it only while it still matches what mare last wrote. |
lua/ |
Lua modules you require from init.lua. |
plugins/ |
User plugins. See Plugins. |
skills/ |
User skills, one directory per skill with a SKILL.md. |
prompts/ |
Prompt templates that become slash commands. |
themes/ |
Themes. |
AGENTS.md |
Your own instructions, loaded into every session. Per directory mare loads the first of AGENTS.override.md, AGENTS.md, CLAUDE.md that exists. |
SYSTEM.md |
Replaces the default system prompt. |
APPEND_SYSTEM.md |
Text appended to the system prompt. |
mcp.json |
MCP servers. See MCP. |
auth.json |
Credentials stored by mare login, mode 0600. Next to it: auth.json.lock while a login or refresh runs and auth.json.bak after a repair. |
mare-lock.json |
Package lockfile: the exact revision of every installed package. See Packages. |
plugins.json |
The optional package extras you enabled. |
State directory
Section titled “State directory”Runtime state written by mare. Rebuildable session indexes are marked below. Keep unrecovered quarantine/ records and active session lock, commit, and rollback files (the store reads recovery records when reopening a session).
| Path | Purpose |
|---|---|
state.json |
Runtime choices such as the model picked with /model, used as defaults on the next start. Explicit init.lua values win. state.json.lock guards writes. |
trust.json |
Project trust decisions, written by mare trust and the trust prompt. |
sessions/ |
Saved sessions. See below. |
log/mare.log |
The log. Rotates at 10 MiB and keeps five old files, mare.log.1 to mare.log.5. Set the level with MARE_LOG. |
crashes/<timestamp>/report.txt |
A redacted crash report, written when a panic ends mare. |
history.jsonl |
Prompt history for the editor. |
lua-history |
History of the Lua console. |
permissions.json |
Permission rules you saved from approval prompts. permissions.json.lock guards writes. |
news.json |
Package news state. |
models-cache/<provider>.json |
Model lists fetched by mare model refresh. |
skills-cache/*.json |
Cached skill discovery metadata. |
domains/ns-*.json |
Named domain state files. |
snapshots/run-<pid>-<uuid>/ |
File snapshots for runs without a session file (per-session snapshots live beside <name>.jsonl in <name>.jsonl.snapshots/). |
attachments/<session-id or unsaved>/ |
Fallback directory for images offloaded during compaction when no session file exists (per-session attachments live in <name>.attachments/). |
spill/<prefix>-*.log |
The full output of long commands, named by their writer: bash-*.log for shell commands, hooks-*.log for hook commands. |
spill-results/ |
Recoverable tool output, private to the owning session (see the spill.* methods in RPC). |
host/token, host/.token.lock |
Bearer token for the local HTTP/WS web listener (mare --web, rotated with mare token rotate), mode 0600, and its lock file. |
web/<pid>-<id>.json |
Running host web listener endpoint metadata read by mare web url (stored outside host/, removed on shutdown; stale entries are pruned), mode 0600. |
quarantine/ |
Unsaved session JSONL records quarantined when normal session persistence fails. |
mcp.log |
Output of MCP servers. |
mcp-approvals.json |
Saved project and $MARE_MCP_CONFIG MCP server approvals (keyed by server name and config hash). |
mcp-disabled.json |
Per-project disabled MCP servers. |
mcp-tools/ |
Cached tool schemas for MCP servers. |
mcp-output/ |
The full form of truncated MCP results. |
mcp-oauth/<server>-<hash>.json |
OAuth tokens for MCP servers. |
peers/<pid>.json, peers/<pid>.sock |
The session registry and peer sockets of running sessions. Removed on exit; stale entries are pruned. See RPC. |
pgroups/ |
Registry of process groups started by mare, used to clean up after a crash. |
crash-guard.json |
Requests that crashed mare, so a resumed session does not resend one forever. crash-guard.lock guards it. |
kitty/ |
Markers that keep terminal keyboard-mode state consistent after a crash. Unix only. |
key-conflicts |
The last key-conflict warning shown, so it is not repeated. |
luarc.generated |
The last .luarc.json mare wrote. |
terminal-hint-shown |
Windows only: set after the one-time terminal hint. |
Sessions
Section titled “Sessions”Sessions live under sessions/<project>/, where <project> is the working directory with every character other than letters, digits, . and _ replaced by -, wrapped in --. For /home/me/app that is --home-me-app--.
| Path | Purpose |
|---|---|
<time>_<id8>.jsonl |
One session, an append-only log of entries. This is the source of truth. The name is the start time (2026-11-14T09-30-00) and the last eight characters of the id. |
<time>_<id8>.jsonl.lock |
The single writer’s lock. Next to it, .lock.rollback and .lock.commit files hold crash-recovery data. |
<time>_<id8>.jsonl.v<N> |
Backups made before a session file is rewritten. |
<time>_<id8>.attachments/ |
Images stored with the session. |
<time>_<id8>.jsonl.snapshots/ |
The file snapshot journal for the session. |
agents/<run>/<seq>-<label>.jsonl |
Sub-agent sessions, linked to their parent. |
index.sqlite (in sessions/) |
Rebuildable SQLite index for /resume, -c and id lookups. Stores session metadata and single-line user input summaries (preview for the first qualifying user message and last_input for the latest); full messages live in the JSONL files. Delete it and mare rebuilds it from the session files. |
Data directory
Section titled “Data directory”Files mare installs for itself.
| Path | Purpose |
|---|---|
runtime/ |
Read-only copies of the built-in plugins and Lua type files. mare runtime prints the path. Rewritten when the mare version changes. |
packages/ |
Installed packages, one directory per source. See Packages. |
package-types/ |
Type files mirrored from installed packages for the language server. |
Cache directory
Section titled “Cache directory”| Path | Purpose |
|---|---|
luac/ |
Compiled Lua bytecode. Safe to delete. |
Project files
Section titled “Project files”These live in the project, relative to the working directory.
| Path | Purpose |
|---|---|
.mare/init.lua |
Project configuration, applied after your init.lua. |
.mare/plugins/ |
Project plugins. |
.mare/plugins.json, .mare/mare-lock.json |
Project-scoped optional plugin selections and package lockfile. |
.mare/lua/ |
Lua modules for the project’s init.lua. |
.mare/skills/, .agents/skills/ |
Project skills, resolved once against the project resource root (mare.project.root; startup trust probing also checks ancestor directories up to .git for .agents/skills). |
.mare/prompts/ |
Project prompt templates. |
.mare/SYSTEM.md, .mare/APPEND_SYSTEM.md |
Project system prompt files. They take precedence over the ones in your config directory. |
.mare/mcp.json, .mcp.json |
Project MCP servers. |
AGENTS.md |
Project instructions, read from the working directory and its parents up to the directory that contains .git. Per directory the first of AGENTS.override.md, AGENTS.md, CLAUDE.md is used. |
Everything under .mare/ that can run code or change the prompt (init.lua, plugins, plugins.json, skills, prompts, SYSTEM.md, APPEND_SYSTEM.md) and .agents/skills load only in a trusted project. A bare .mare/ directory needs no decision. See Permissions.
Platform notes
Section titled “Platform notes”| Platform | Difference |
|---|---|
| Linux, macOS | Peer sockets are Unix sockets at <state>/peers/<pid>.sock, mode 0600 in a 0700 directory. Private files get mode 0600. |
| Windows | The same directory layout under %USERPROFILE%. A peer socket is a named pipe with a random name; its path holds an endpoint file that names the pipe. Private files get a restricted ACL instead of mode bits. The enhanced sandbox keeps its setup in %ProgramData%\mare\sandbox (or MARE_SANDBOX_DIR). |