Configuration Reference
Trace Index configuration selects the rebuildable database, the trace roots used when index sync receives no positional paths, and the database-wide indexing policy. Runtime adapters are detected from Source contents; a root does not select an adapter.
The default configuration path is $XDG_CONFIG_HOME/trace-index/config.toml, falling back to $HOME/.config/trace-index/config.toml. If no configuration exists, built-in defaults remain usable and the root list is empty.
The default database path is $XDG_DATA_HOME/trace-index/index.sqlite, falling back to $HOME/.local/share/trace-index/index.sqlite.
Fields:
schema_version: configuration contract version. It defaults to1for compatibility with files created before this field existed; new files write it explicitly.database: optional path to the rebuildable SQLite index.metadata_database: optional path to independent persistent caller-owned Session metadata. It is not derived fromdatabaseor--db.indexing.max_indexed_record_bytes: maximum bytes retained and parsed for one JSONL Record. The built-in value is16777216.indexing.max_published_text_bytes: maximum UTF-8 bytes published for one Semantic text value. The built-in value is65536.roots: zero or more files or directories recursively searched for.jsonlSources.roots[].label: optional diagnostic label. It does not select Codex, Pi, or Claude Code.roots[].path: Source file or directory path.
roots[].name from configuration files created by Trace Index 0.1.0 remains accepted as an alias for label; new files write label.
Unknown fields, an unsupported schema_version, zero indexing limits, empty paths, and duplicate resolved root paths are errors.
Paths
Every path returned by config show is absolute.
- Relative paths in the configuration file are resolved against that file's directory.
- Relative
--config,--db,TRACE_INDEX_CONFIG, andTRACE_INDEX_DBpaths are resolved against the process working directory. - Empty
TRACE_INDEX_CONFIGandTRACE_INDEX_DBvalues are errors because they are explicit overrides; empty XDG variables are ignored. - A leading
~or~/expands to the current home directory. Other user-home forms such as~otherare rejected. XDG_CONFIG_HOMEandXDG_DATA_HOME, when non-empty, must be absolute.
Paths are not canonicalized during loading because a database or root may not exist yet. config check and index sync canonicalize existing roots when they need physical identity.
Metadata storage
metadata_database optionally selects persistent caller-owned Session data. Its path is resolved like database, but independently: --metadata-db > TRACE_INDEX_METADATA_DB > metadata_database > the platform data directory plus trace-index/metadata.sqlite. Changing --db does not change this selection. config show reports both absolute paths and origins; the files must differ. config init --metadata-db PATH records an explicit metadata path without creating the store. config check validates an existing store read-only; absence is normal before its first write. See Session Metadata.
Older CLI versions reject a configuration containing metadata_database under their existing unknown-field rule. Use version 0.3.0 or later for this field; old configurations without it remain valid.
Precedence and provenance
The configuration file is selected in this order:
--configTRACE_INDEX_CONFIG- the platform default configuration path
The database is selected independently:
--dbTRACE_INDEX_DBdatabasein the selected file- the platform default database path
Indexing limits for a new or empty database come from [indexing] and then built-in defaults. After a database contains Sources, its stored policy is authoritative and ordinary synchronization reuses it. The two index sync --max-*-bytes flags are explicit one-run requests; a request that conflicts with a non-empty database is rejected.
Positional index sync PATHS... replace configured roots for that invocation. There is no environment-variable root list.
config show returns resolved absolute configuration values together with cli, environment, file, or default origin metadata. For indexing limits, these are the values that would initialize a new or empty database. The command does not open the database; use index status for an established policy.
Indexing policy consistency
The two indexing limits change which Source content becomes a published fact, so the first synchronization stores them as one database-wide policy. The database is the single owner of that policy after it contains Sources; changing [indexing] affects new or empty databases, not existing indexed facts. A conflicting CLI override is rejected. Create a new database and reindex every Source when changing policy; --rebuild does not change the policy at any scope.
index status and every synchronization report return the stored policy.
Configuration commands
config initcreates and validates one file without overwriting, creating a database, or synchronizing traces. It records the built-in initial indexing values; an existing non-empty database still owns its established policy.--root PATHis repeatable,--discoveradds only standard Runtime roots that currently exist, and--dbwrites an initial database path.config showresolves values and reports their origins without inspecting the filesystem.config checkperforms a read-only preflight of configured root existence, type, canonical duplication, and database path ancestry. Parse and schema errors exit before a report. In a returned report, Error issues makevalidfalse and cause exit 1; Warning-only reports exit 0.configured_sync_readyadditionally requires at least one configured root.