Skip to content

Configuration File

symtrace automatically loads configuration options from TOML files, enabling team-wide standards for diffing rules, parse limits, and output settings without requiring explicit CLI flags on every run.

symtrace searches for configuration files in the following order:

  1. CLI Flags (highest precedence — overrides all configuration file settings)
  2. Repository Local Config: .symtracerc or symtrace.toml in the repository root directory
  3. User Global Config: ~/.config/symtrace/symtrace.toml (Unix) or %USERPROFILE%\.config\symtrace\symtrace.toml (Windows)
  4. Built-in Defaults (lowest precedence)

If both .symtracerc and symtrace.toml exist in the repository root, .symtracerc takes precedence.

Create a file named .symtracerc or symtrace.toml in your repository root:

[default]
logic_only = false # Skip comments and whitespace-only nodes
json = false # Emit JSON output by default
no_incremental = false # Force full AST re-parse (disable cache reuse)
no_pager = false # Disable piping output to $PAGER
[limits]
max_file_size = 10485760 # Skip files larger than 10 MiB (default: 5 MiB = 5242880)
max_ast_nodes = 500000 # Skip files with more AST nodes than specified (default: 200000)
max_recursion_depth = 2048 # Maximum AST parsing recursion depth (default: 2048)
parse_timeout_ms = 3000 # Per-file tree-sitter parse timeout in ms (default: 2000)
[output]
color = "auto" # Terminal color controls: "auto", "always", or "never"

Controls standard execution behavior:

OptionTypeDefaultCLI EquivalentDescription
logic_onlybooleanfalse--logic-onlyFilters out comments and formatting/whitespace nodes
jsonbooleanfalse--jsonEmits structured JSON output instead of ANSI text
no_incrementalbooleanfalse--no-incrementalDisables incremental AST parsing and cache reuse
no_pagerbooleanfalse--no-pagerPrevents piping terminal output into $PAGER

Guards against excessive memory usage or parse hangs on large or adversarial files:

OptionTypeDefaultCLI EquivalentDescription
max_file_sizeinteger5242880 (5 MiB)--max-file-size <BYTES>Maximum file size in bytes; larger files are skipped
max_ast_nodesinteger200000--max-ast-nodes <N>Maximum allowed AST nodes per file
max_recursion_depthinteger2048--max-recursion-depth <N>Maximum recursion depth allowed during AST traversal
parse_timeout_msinteger2000 (2s)--parse-timeout-ms <MS>Timeout in milliseconds per file parse (0 = disabled)

Controls formatting and terminal rendering:

OptionTypeDefaultCLI EquivalentDescription
colorstring"auto"--color <auto|always|never>ANSI color mode. "auto" respects TTY state and NO_COLOR env var

Any setting configured in .symtracerc or symtrace.toml can be overridden directly on the command line:

Terminal window
# Enable logic-only and JSON output regardless of .symtracerc defaults
symtrace . HEAD~1 HEAD --logic-only --json
# Override parse timeout for large refactor reviews
symtrace . HEAD~1 HEAD --parse-timeout-ms 10000 --max-file-size 20971520