Skip to Content

Files and environment

Every folder and file zerd reads or writes, and every environment variable it looks at.

zerd keeps its state in three places: a per-user data folder, a per-user config folder, and a .zerd/ directory inside each repo it works in.

Folders

FolderDefault locationHolds
Data foldermacOS ~/Library/Application Support/zerd, Linux ~/.local/share/zerd, Windows %APPDATA%\zerdEverything zerd remembers between runs, listed below
Config foldermacOS ~/Library/Application Support/zerd, Linux ~/.config/zerd, Windows %APPDATA%\zerdThe user config.toml and user-wide tools/
.zerd/ in a repoThe working directoryProject config, project tools, permission rules and prompt overrides
.zerd/ in your home~/.zerdUser-wide commands, prompts, skills, agents, permission rules and prompt overrides
Install folderFound next to the binary, or ZERD_HOMEprofiles/ and skills/ that ship with zerd, plus an optional .env

ZERD_DATA_DIR replaces the data folder location on every system. On macOS and Windows the data and config folders are the same directory unless you set it.

Inside the data folder

PathWhat it isCreated when
.envKeys you pasted into zerd setup or /connect, one NAME=value per lineYou save a key. Owner-only permissions on macOS and Linux
sessions/<id>.jsonOne saved session per run. --resume, --continue and /sessions read theseA session is saved
checkpoints/<id>.jsonCheckpoints of a sessionA checkpoint is taken
traces/<id>.jsonlEvent trace for a session. Your API_KEY value is scrubbed from itEvery run, unless trace is turned off in config
results/<session id>/Large tool output kept out of the conversation and fetched laterA tool result is archived
transcripts/<id>.jsonlThe full conversation as it was before a compactionThe context is compacted. The summary points at this file
notes/<hash>.mdTask notes for one workspace, kept so a long job survives compaction and /resumeA long job records notes
memory/<hash>.jsonEntries from the memory tool, one file per workspaceThe model saves a memory entry
learned/<hash>.jsonLessons and edit history for one repoYou correct zerd, or run /learn
review_memory/<hash>.jsonFindings earlier reviews already ruled out, per repoA review finishes
graph/<hash>.jsonCode graph cache, one per workspaceThe repo is indexed
trusted_projects.jsonProjects whose .zerd/config.toml you trusted, with a digest of the fileYou pass --trust
calibration.jsonlEstimated and actual round counts of finished requestsA request finishes
last_modelThe model you last choseYou pick a model
models-<provider>.jsonThe model list fetched for a provider/connect lists a provider's models
input_historyPrompts you typed, for recall in the prompt boxYou send a prompt
layoutWhich panels of the full-screen layout are showingYou change /layout

The <hash> names come from a hash of the repo's absolute path, so each repo gets its own file. sessions/ and checkpoints/ are created with owner-only permissions on macOS and Linux.

The data folder holds your keys in .env and the full text of your conversations in sessions/ and transcripts/. Do not sync it to a shared drive or commit it.

Inside a repo's .zerd/

PathWhat it is
config.tomlProject config. Hooks, verify commands and approval need --trust
graph.tomlFolders to ignore, area descriptions and symbol notes for the code graph. Safe to commit
permissions.jsonAllow and deny rules for this repo. See Permissions
tools/*.tomlProject tools that run a shell command. See Extending
commands/Prompt files that become slash commands
skills/Skills for this repo. See Skills and agents
agents/Sub-agent definitions for this repo
SYSTEM.mdReplaces zerd's system prompt
APPEND_SYSTEM.mdAdded after the system prompt

The same names work in ~/.zerd/ for every project, except config.toml, graph.toml and tools/, which only the repo's .zerd/ reads (user-wide tools live in the config folder). ~/.zerd/ also reads prompts/. If both a user and a repo SYSTEM.md exist, the repo's wins. Every APPEND_SYSTEM.md found is applied.

Instruction files

zerd reads AGENTS.md, CLAUDE.md and AGENT.MD from the working directory up to the repo root, plus ~/.claude/CLAUDE.md. Lines like @docs/rules.md pull in another file, up to three levels deep. A file that is very large is shown to the model as an outline instead of in full.

zerd also writes to one of these. A lesson from /learn or a correction is added to the repo's AGENTS.md under ## Learned by zerd, and /forget removes it. Scripted runs never write it. More in Memory and undo.

Which config wins

The user config lives in the config folder, the project config in .zerd/config.toml. The order is in Configuration.

Environment variables

Provider keys

Set these in your shell or save them with /connect. The provider table is in Models and routing.

VariableUsed for
OPENAI_API_KEYopenai
ANTHROPIC_API_KEYanthropic
GEMINI_API_KEYgemini
OPENROUTER_API_KEYopenrouter
GROQ_API_KEYgroq
DEEPSEEK_API_KEYdeepseek
MISTRAL_API_KEYmistral
XAI_API_KEYxai
TOGETHER_API_KEYtogether
FIREWORKS_API_KEYfireworks
CEREBRAS_API_KEYcerebras
MOONSHOT_API_KEYmoonshot
ZAI_API_KEYzai
API_KEYThe gateway, for any model id with no provider prefix
BASE_URLGateway address. Default https://api.commandcode.ai/provider/v1
The name in api_key_envA provider you define in config.toml, such as WORK_LLM_KEY
CODEX_HOMEFolder holding the Codex login (auth.json) used by codex/ models. Default ~/.codex

ollama and lmstudio need no key.

zerd loads .env from the install folder, then from the data folder, at every start. A variable already set in your shell is never overridden by either file. The .env of the repo you are working in is never read.

Locations

VariableWhat it doesDefault
ZERD_DATA_DIRMoves the data folderThe per-system path above
ZERD_HOMEThe install folder with profiles/ and skills/Found by looking up from the binary
HOMEBase for ~/.zerd and the macOS foldersThe account's home directory

Behavior

VariableWhat it doesDefault
ZERD_NO_SETUPAny value stops the first-run setup from starting when no model is usableUnset
ZERD_NO_UPDATE_CHECKAny value stops the once-a-day check for a newer release on launch (zerd update still works)Unset
ZERD_PLAINAny value uses the plain scrolling layout instead of full screenUnset
NO_COLORAny value turns off colorUnset
TERMdumb turns off colorFrom the terminal
SHELLShell zerd reports to the model/bin/zsh on macOS, /bin/bash elsewhere
ZERD_ARG_<NAME>Set by zerd for a project tool, one per argument, for example ZERD_ARG_WHOSet per call

Commands the agent runs get your environment with secret-looking variables removed (names matching patterns such as *KEY* and *TOKEN*). The patterns and any variables to add are under shell_environment in config. See Safety.

On this page