Skip to content

Environment Variables

This page lists every environment variable that changes what Bifrost does. Each entry gives the accepted values, the default, the effect, and what happens when the value is invalid. Variables that exist only for benchmarks, differential testing, fuzzing, profiling of Bifrost itself, or Bifrost’s own test suite are not listed.

Most variables on this page are read by the bifrost binary. The sections Agent Plugins, Language Server, and Install Script list variables that other programs read.

No command-line flag has an environment-variable equivalent. For flags, see CLI Reference.

VariableValuesDefaultEffectInvalid value
BIFROST_PARALLELISMPositive integerNumber of logical CPUsSize of the analyzer worker pools in the CLI, MCP server, and libraries.0 or a non-integer is ignored, and the default applies.
BIFROST_POLICY_PARALLELISMPositive integerHalf the analyzer pool width, clamped to 1 through 8Number of policies the policy coordinator evaluates concurrently, for scan and the MCP policy tools. Each worker holds its own in-flight query results, so a smaller value lowers peak memory at the cost of wall time, and 1 forces strictly serial evaluation. The derived default never follows the core count past eight workers.0 or a non-integer is ignored, and the default applies.
BIFROST_MAX_LINE_LENGTHNon-negative integer16000An explicit positive value rejects source files with longer physical lines. At the default setting, C/C++ analysis can exclude bounded numeric initializer data from line accounting; see Workspace Scope. 0 turns the line limit off. NUL bytes prevent parsing unless BIFROST_ADMIT_NUL_BYTES=1. Rune IR counts full physical lines and refuses over-limit input with an error.A non-integer is ignored, and the default applies.
BIFROST_ADMIT_NUL_BYTES1Not setParse source files that contain NUL bytes, reading each NUL as a space so byte offsets still match the file. Without it, a file with a NUL byte is treated as binary and never parsed. Meant for benchmark harnesses that analyze real repositories with a raw NUL inside a string literal. Choose it before starting Bifrost.Any other value is ignored, and the default applies.
BIFROST_CHA_CONCRETE_OVERRIDESAny valueNot setWhen set, a call that resolves to a method with a body also lists the workspace methods that override it, as unproven candidates. Without it, Bifrost lists overrides only for a call to a method with no body, such as an interface or abstract method. The process reads the variable once.Not possible; any value means on.
BIFROST_TIMINGAny value; empty, 0, false, and off (any case) mean offOffWrite [bifrost-timing] timing lines to stderr. When a query stops at an execution limit, also write its work counters, such as scanned files and fact nodes, to stderr.Not possible; any other value means on.

The cache layout is described in Data and Trust Boundaries and Configuration Files.

VariableValuesDefaultEffectInvalid value
BIFROST_CACHE_DIRDirectoryNot setUse exactly this directory for the analyzer database bifrost_cache.v<N>.db and the semantic-pack catalog. Every repository that a process opens uses the same directory. Takes precedence over BIFROST_CACHE_ROOT for the repository cache.An empty value is treated as not set. An unwritable directory is an error when the cache opens.
BIFROST_CACHE_ROOTDirectoryNot setRelocate every Bifrost cache to one machine-local root. Each primary repository gets the child <repository-name>-<hash>/. The machine-level cache also moves to this root.An empty value is treated as not set.
BIFROST_ALLOW_UNSAFE_NETWORK_CACHE1Not setOn Linux, allow the SQLite cache on NFS or SMB. Without it, Bifrost refuses to create the cache there.Any other value is the same as not set.
BIFROST_CACHE_GC0, off, or disabled turn it offOnTurn off automatic collection of unreachable data in the analyzer cache. Use it for a cache that several repositories share on purpose.Any other value leaves collection on.
BIFROST_SQLITE_WRITER_CACHE_KIBPositive integer, in KiB, up to 2147483647524288 (512 MiB)Upper limit of the SQLite page cache for each connection to the analyzer database. Lower it to reduce memory use.Opening the analyzer database fails with an error that names the variable.
BIFROST_SEMANTIC_PACK_CACHE_ROOTDirectoryNot setKeep the semantic-pack catalog at <value>/semantic-pack-catalog.v<N> instead of beside the analyzer database. When set, generated packs are not shared through the machine-level cache. The binary’s open-pack bootstrap supplies a cache-local default only when this variable is unset.An empty value is treated as not set.

The first four variables apply to bifrost --mcp and to the no-argument server. See MCP Tools Reference for the limits they change.

The last three variables are read each time a tool session activates semantic packs for a workspace. That happens in the MCP server, --tool, --query-file, and --repl. See Semantic Packs Reference.

VariableValuesDefaultEffectInvalid value
BIFROST_MCP_REQUEST_BUDGET_SECSPositive integer number of secondsNot set: 60 s for most tools, 240 s for run_policy, 4.5 s for most tools while the workspace is still building, and no budget for refresh, activate_workspace, update_paths, and get_active_workspaceOne time budget for every analyzer request.The server does not start; exit 1.
BIFROST_MCP_TASK_TTL_MSInteger of 1 or more, in milliseconds600000 (10 minutes)Lifetime and execution deadline of an MCP task for run_policy.Ignored with a warning on stderr; the default applies.
BIFROST_MCP_FILE_WATCHERon or offonoff stops the server from watching workspace files. Call the refresh tool after edits.The server does not start; exit 1.
BIFROST_MCP_LOGoff, error, warn, info, debug, or tracewarnLevel of MCP protocol diagnostics written to stderr.The server does not start; exit 1.
BIFROST_WORKSPACE_SEMANTIC_MODELSon, 1, enabled, off, 0, or disabledOffLoad reviewed workspace models from .bifrost/semantic-models/ when a workspace binds.Semantic-pack activation is unavailable for the session, with a message on stderr.
BIFROST_SEMANTIC_PACK_CATALOGDirectory of a semantic-pack catalogNot setActivate packs from this catalog, using the evidence in BIFROST_SEMANTIC_PACK_EVIDENCE. Must be set together with that variable. Bifrost opens the catalog read-only. This older configuration cannot be combined with a workspace .bifrost/packs.json.Semantic-pack activation is unavailable for the session, with a message on stderr.
BIFROST_SEMANTIC_PACK_EVIDENCENon-empty JSON array of evidence objectsNot setActivation evidence for BIFROST_SEMANTIC_PACK_CATALOG. Each object has language and ecosystem (strings), optional package, module, and toolchain (each {"name": ..., "version": ...}, version optional), and optional target, configuration, and artifactSha256 strings. Unknown fields are rejected.Semantic-pack activation is unavailable for the session, with a message on stderr. An empty array is invalid.
VariableValuesDefaultEffectInvalid value
BIFROST_POLICY_PACK_ROOTDirectory of an extracted policy rules tree, or several such directories as an OS path list (:-separated on Unix, ; on Windows)Not setReplace the embedded built-in policy catalog for --list-policies, --version, scan, policy evaluation, and the MCP policy tools. Several roots, such as separately acquired public and premium releases, load as one catalog; a pack or policy ID that appears in two roots is an error. Manifests and authored hashes are verified. The former name BIFROST_OPEN_POLICY_PACK_ROOT is still read until v0.15.0; if both are set they must name the same roots. prepare-open-packs still writes the former name to its environment file until then. See Policies Reference.An empty value, an empty list entry, two names that disagree, a missing directory, or an invalid tree is an error: scan and policy runs exit 2, and --version exits 1.
BIFROST_POLICY_BUNDLE_ROOTDirectory of an extracted policy bundle (a policy-bundle.json index and its .rqlp files), or several as an OS path listNot setMake each bundle policy available to explicit selection by ID (--policy-id, or policy_ids in the MCP policy tools). Bundle policies never run through default, pack, category, or scan selection, and carry no catalog metadata. Every indexed file must match its SHA-256 and size, and each policy’s index ID must equal its document :id. A bundle ID that the catalog also defines is an error.An empty list entry, an unreadable bundle, or a verification failure is an error: policy runs exit 2.
BIFROST_OPEN_SEMANTIC_PACK_BUNDLEDirectory of a native semantic-pack bundleNot setInstall the bundle’s packs instead of the packs embedded in the binary. The bundle replaces the embedded packs; it is not merged with them. See Semantic Packs Reference.An empty value, an unreadable bundle, or a bundle with no compatible pack makes pack activation fail. A policy report shows pack-activation-failed and the run exits 2.
BIFROST_OPEN_PACKS_OFFLINE1 or trueNot setMake the bifrost binary select open packs from its verified local cache only. If selection cannot be satisfied, it reports a diagnostic and uses embedded packs.Any other value is the same as not set.
BIFROST_OPEN_PACKS_DISABLE1 or trueNot setDisable open-pack acquisition. Commands make no network requests and do not read the open-pack cache. Explicit BIFROST_POLICY_PACK_ROOT and BIFROST_OPEN_SEMANTIC_PACK_BUNDLE values are still used; without them, commands use embedded packs. prepare-open-packs writes a failed outcome with class invalid-configuration and exits 1 without reading its cache.Any other value is the same as not set.
BIFROST_OPEN_PACKS_REFRESH1 or trueNot setIgnore the cached open-pack manifest inventory and discover releases again. The inventory is otherwise reused for one hour. Cannot be combined with offline mode.Any other value is the same as not set.
VariableValuesDefaultEffectInvalid value
NO_COLORAny valueNot setWhen set, --color auto produces plain human policy output.Not applicable.

Bifrost reads these standard variables. It does not change them.

VariableRead byEffect
HOME (USERPROFILE on Windows)Cache, JVM and .NET discovery, REPL, --install, ~/ in Git pathsLocates ~/.cache/bifrost, ~/Library/Caches/bifrost, ~/.m2/repository, ~/.gradle/caches, ~/.nuget/packages, and ~/.bifrost_code_query_repl_history.
XDG_CACHE_HOMEMachine-level cache on Linux and other Unix systemsMachine-level cache is $XDG_CACHE_HOME/bifrost when set.
LOCALAPPDATAMachine-level cache on WindowsMachine-level cache is %LOCALAPPDATA%\bifrost\cache.
JAVA_HOMEJVM standard-library discoveryThe JDK at JAVA_HOME is a candidate source of JDK declarations. It does not bind a JDK to source files; .bifrost/jvm-toolchains.json does that.
GRADLE_USER_HOMEJVM dependency discoveryGradle module cache is $GRADLE_USER_HOME/caches/modules-2/files-2.1 instead of ~/.gradle/caches/modules-2/files-2.1.
NUGET_PACKAGESC# dependency discoveryAn additional approved NuGet package root.
PATH, PATHEXT--install; git subprocessesFind coding-host commands and the git executable.
XDG_CONFIG_HOME, APPDATA--install for OpenCodeLocate opencode/opencode.json.
PATH, HOME, USERPROFILE, LOCALAPPDATA, GOCACHE, TMPDIR, TEMP, TMP, SYSTEMROOT, WINDIRGo dependency discovery in a CLI policy runPassed to the go list subprocess. Bifrost removes every other variable, including GOPATH, GOMODCACHE, and GOFLAGS, and sets GOTOOLCHAIN=local, GOPROXY=off, GOSUMDB=off, GOENV=off, GOFLAGS=-buildvcs=false, and CGO_ENABLED=0. go list therefore uses the default module cache under HOME.

The agent and dsh plugins ship the same launcher, which manages the bifrost executable. The binary also honors BIFROST_LAUNCHER_AUTO_INSTALL as a cache-only control and uses BIFROST_LAUNCHER_CACHE_DIR as the base for its open-pack cache, including when started directly.

VariableValuesDefaultEffect
BIFROST_WORKSPACE_ROOTDirectoryNot setWorkspace root for an MCP launch. The launcher passes it to bifrost as --root. It takes precedence over the launcher’s --root or --workspace-root argument. A value that still contains an unexpanded placeholder such as ${...} is ignored. The dsh plugin also reads it, when the plugin configuration sets no root.
BIFROST_BINARY_PATHPath to a bifrost executableNot setUse this binary when its version is compatible with the plugin.
BIFROST_LAUNCHER_ALLOW_PATH1 or true (any case)Not setAllow a compatible bifrost found on PATH.
BIFROST_LAUNCHER_AUTO_INSTALL0Not set (downloads allowed)0 disables managed binary downloads in the launcher and makes pack-activating binary commands use only their verified open-pack cache.
BIFROST_LAUNCHER_CACHE_DIRDirectory~/Library/Caches/bifrost-agent on macOS, %LOCALAPPDATA%\Bifrost\AgentPlugin on Windows, $XDG_CACHE_HOME/bifrost-agent or ~/.cache/bifrost-agent elsewhereRoot for managed binaries and the binary’s open-pack-releases/ cache.

The bifrost binary selects open packs before policy or MCP activation. Setting either BIFROST_OPEN_SEMANTIC_PACK_BUNDLE or BIFROST_POLICY_PACK_ROOT (or its former name) supplies host-owned content and prevents automatic acquisition. If neither is set, the binary supplies both roots from its verified cache; it does not overwrite an explicit BIFROST_SEMANTIC_PACK_CACHE_ROOT.

The separate bifrost-lsp program reads these variables. The bifrost binary does not. The VS Code extension sets them from its settings. See LSP Server.

VariableEffect
BIFROST_LSP_DEBUG1 logs the start and end of every LSP request and notification.
BIFROST_LSP_SLOW_MSLogs LSP requests and notifications that take at least this many milliseconds.

install.sh reads these variables. See Install Bifrost.

VariableValuesDefaultEffect
BIFROST_INSTALL_DIRDirectoryNot setInstall directory. Takes precedence over INSTALL_DIR.
INSTALL_DIRDirectory~/.local/binInstall directory.
BIFROST_VERSIONRelease tag, for example v0.8.17Latest releaseRelease to install.
BIFROST_GITHUB_OWNERGitHub ownerBrokkAiOwner of the release repository.
GITHUB_TOKENTokenNot setSent to the GitHub API to raise rate limits.
PROFILEShell profile pathDetected from the shellProfile to update when the install directory is not on PATH.