Configuration

user-owned settings in config.toml

deja reads optional settings from ~/.config/deja/config.toml (or $XDG_CONFIG_HOME/deja/config.toml when XDG_CONFIG_HOME is an absolute path). DEJA_CONFIG_FILE overrides the file path explicitly. Installing, updating, and uninstalling harnesses never create, edit, or delete this file.

Precedence and launcher wrappers

Order from highest to lowest priority:

  1. CLI flags on the invocation (such as --no-embed or --all-projects).
  2. Process environment variables (DEJA_*) set in your shell or wrapper.
  3. config.toml values, loaded before opening the index store.
  4. Built-in defaults.

Generated MCP/hook launcher wrappers inherit explicit process environment variables (including DEJA_CONFIG_FILE and non-default XDG_CONFIG_HOME), while keys populated from config.toml are read at runtime rather than baked into generated harness configs.

Annotated config.toml example

# User-owned configuration — untouched by deja install / update / uninstall.
# Optional top-level shorthand: embed_every = "30m"

[embed]
every = "30m" # Go duration ("30m", "2h") or "0" / "off" to disable
url = "http://127.0.0.1:11434/v1/embeddings"
model = "nomic-embed-text"
# api_key = "sk-..." # keep file mode 0600 on Unix if you store a secret here
# batch = 32
# query_prefix = "search_query: "
# passage_prefix = "search_document: "
# off = false

[hooks]
recall = "safe" # "safe", "aggressive", or "off"
# recall_global = false
# autorecall_local_only = true
# no_source_hints = false
# no_auto_index = false

[index]
# dir = "~/.cache/deja/index.db"
# policy_file = "~/.config/deja/policy.json"
# notes_file = "~/.local/share/deja/notes.jsonl"
# include_subagents = "summary" # "summary", "whole", or "off"
# tool_output = true
# paths = true
# edits = true
# writes = true
# commands = true
# exclude_projects = ["scratch"]
# exclude_harnesses = ["cursor"]
# stores = ["claude", "codex"]
# search_only = false

Periodic background embedding

When [embed].every (or top-level embed_every, or DEJA_EMBED_EVERY) is a positive duration such as "30m", hook-session-end checks whether the interval has elapsed and spawns a detached deja hook-embed worker so your vector sidecar stays current incrementally without blocking the agent exit path.

Three sidecar state files beside the index directory coordinate background runs:

  • <index>.embed-running — active worker claim so concurrent session ends do not launch duplicate embedders; stale claims from dead processes are reclaimed.
  • <index>.embed-last — nanosecond timestamp written after a successful embed pass.
  • <index>.embed-retry — backoff timestamp written after a failed pass (capped at 15 minutes) so offline endpoints do not hammer CPU on every turn.

Secrets and diagnostics

If [embed].api_key is set on a Unix system and the file is group- or world-readable, interactive runs warn on stderr to lock permissions down (chmod 600 ~/.config/deja/config.toml).

Run deja doctor or deja doctor --json to inspect which config path is active, which keys were loaded, any unknown keys ignored by the parser, and syntax errors. Diagnostic output reports key names only and never prints api_key values. Broken or malformed config.toml files emit a warning on interactive commands and fall back to defaults so hooks and search continue running.

Found this useful? Star deja-vu on GitHub.