Skip to content

Environment variables

Nexrall Code (CLI and VS Code) reads its configuration from environment variables, all prefixed NEXRALL_. They cover authentication, safety, context management, sub-agents, and low-level timeouts. Most have sensible defaults — you only set one when you need to change a behavior.

The two you'll actually use day-to-day are NEXRALL_TOKEN (CI auth) and, rarely, NEXRALL_ALLOW_DESTRUCTIVE (headless safety).

Authentication & API

VariablePurpose
NEXRALL_TOKENBearer token for non-interactive use (CI, scripts). Always takes precedence over a saved interactive login.
NEXRALL_API_BASEOverride the API endpoint.
NEXRALL_ALLOW_API_OVERRIDESet to 1 to allow NEXRALL_API_BASE to point at a remote host. Guarded because this variable receives your auth token — redirecting it to a host you don't control would leak it.

Safety

VariablePurpose
NEXRALL_ALLOW_DESTRUCTIVESet to 1 to permit irreversible operations (drop table, force-push, terraform destroy) in headless mode, where there's no one to confirm. Blocked by default.
NEXRALL_SECURITY_LINTSet to 0 to disable the security lint pass that flags suspicious patterns in tool results.
NEXRALL_TEST_INTEGRITYSet to 0 to disable the guard that flags weakening a test to make it pass.
NEXRALL_CROSSFILE_CHECKSet to 0 to disable cross-file breakage detection (warns when a renamed/removed export is still referenced elsewhere).
NEXRALL_ALLOW_ELIDED_WRITESet to 1 to permit edits that elide existing code behind a placeholder (// rest unchanged). Refused by default.

Context & compaction

VariablePurpose
NEXRALL_AUTO_COMPACTSet to 0 to disable automatic history summarization near the context limit.
NEXRALL_AUTO_CONTINUESet to 0 to stop the agent from continuing on its own mid-task.
NEXRALL_COMPACT_THRESHOLDFraction of the context window that triggers compaction (default 0.8 — summarize when the prompt exceeds ~80%).
NEXRALL_PRUNE_THRESHOLDFraction that triggers pruning older history (default 0.35).
NEXRALL_MAX_ITERATIONSCap on agent-loop iterations per turn.

Sub-agents & parallelism

VariablePurpose
NEXRALL_MAX_SUBAGENTS_PER_SESSIONCap on how many sub-agents a session may spawn.
NEXRALL_MAX_SUBAGENT_DEPTHCap on sub-agent nesting depth.
NEXRALL_MAX_CONCURRENT_SUBTASKSHow many sub-agents may run in parallel.
NEXRALL_SUBTASK_TIMEOUT_MSTimeout for a single sub-task.

State, memory & sessions

VariablePurpose
NEXRALL_MEMORY_DIROverride where persistent memory lives.
NEXRALL_CHECKPOINT_DIROverride where file checkpoints (for /rewind) are stored.
NEXRALL_CLI_SESSIONS_DIROverride where saved CLI sessions live.
NEXRALL_TRUST_WORKSPACESet to 1 to skip the workspace-trust prompt for a given run (e.g. in CI or automated pty tests).

Timeouts & retry

VariablePurpose
NEXRALL_FIRST_EVENT_TIMEOUT_MSHow long to wait for the first streaming event before giving up.
NEXRALL_HEADER_TIMEOUT_MSTimeout for the response headers.
NEXRALL_MAX_RETRY_MSBackoff ceiling when retrying a failed request.
NEXRALL_PROGRESS_TIMEOUT_MSHow long to wait for progress before a turn is considered stalled.
NEXRALL_VERIFY_NUDGETunes the nudge that asks the agent to verify its own work before finishing.

Network (fetch)

VariablePurpose
NEXRALL_ALLOW_LOCAL_FETCHSet to 1 to allow fetch_url to reach localhost addresses.
NEXRALL_FETCH_BLOCKLISTHosts/paths the fetch tool refuses to touch.

Injected into hooks (read-only)

These are set automatically on the subprocess that runs a hook — you don't set them yourself:

VariableValue
NEXRALL_HOOK_PHASEThe hook phase being run (PreToolUse / PostToolUse).
NEXRALL_TOOL_NAMEThe tool being invoked.
NEXRALL_TOOL_INPUTThe tool's input, JSON-encoded.

Next steps

  • Configuration — the .nexrall/ directory and settings.json hierarchy.
  • Permissions — modes and allow/ask/deny rules.
  • Hooks — where the injected variables above are used.

Built by Maxrall, Inc.