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
| Variable | Purpose |
|---|---|
NEXRALL_TOKEN | Bearer token for non-interactive use (CI, scripts). Always takes precedence over a saved interactive login. |
NEXRALL_API_BASE | Override the API endpoint. |
NEXRALL_ALLOW_API_OVERRIDE | Set 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
| Variable | Purpose |
|---|---|
NEXRALL_ALLOW_DESTRUCTIVE | Set 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_LINT | Set to 0 to disable the security lint pass that flags suspicious patterns in tool results. |
NEXRALL_TEST_INTEGRITY | Set to 0 to disable the guard that flags weakening a test to make it pass. |
NEXRALL_CROSSFILE_CHECK | Set to 0 to disable cross-file breakage detection (warns when a renamed/removed export is still referenced elsewhere). |
NEXRALL_ALLOW_ELIDED_WRITE | Set to 1 to permit edits that elide existing code behind a placeholder (// rest unchanged). Refused by default. |
Context & compaction
| Variable | Purpose |
|---|---|
NEXRALL_AUTO_COMPACT | Set to 0 to disable automatic history summarization near the context limit. |
NEXRALL_AUTO_CONTINUE | Set to 0 to stop the agent from continuing on its own mid-task. |
NEXRALL_COMPACT_THRESHOLD | Fraction of the context window that triggers compaction (default 0.8 — summarize when the prompt exceeds ~80%). |
NEXRALL_PRUNE_THRESHOLD | Fraction that triggers pruning older history (default 0.35). |
NEXRALL_MAX_ITERATIONS | Cap on agent-loop iterations per turn. |
Sub-agents & parallelism
| Variable | Purpose |
|---|---|
NEXRALL_MAX_SUBAGENTS_PER_SESSION | Cap on how many sub-agents a session may spawn. |
NEXRALL_MAX_SUBAGENT_DEPTH | Cap on sub-agent nesting depth. |
NEXRALL_MAX_CONCURRENT_SUBTASKS | How many sub-agents may run in parallel. |
NEXRALL_SUBTASK_TIMEOUT_MS | Timeout for a single sub-task. |
State, memory & sessions
| Variable | Purpose |
|---|---|
NEXRALL_MEMORY_DIR | Override where persistent memory lives. |
NEXRALL_CHECKPOINT_DIR | Override where file checkpoints (for /rewind) are stored. |
NEXRALL_CLI_SESSIONS_DIR | Override where saved CLI sessions live. |
NEXRALL_TRUST_WORKSPACE | Set to 1 to skip the workspace-trust prompt for a given run (e.g. in CI or automated pty tests). |
Timeouts & retry
| Variable | Purpose |
|---|---|
NEXRALL_FIRST_EVENT_TIMEOUT_MS | How long to wait for the first streaming event before giving up. |
NEXRALL_HEADER_TIMEOUT_MS | Timeout for the response headers. |
NEXRALL_MAX_RETRY_MS | Backoff ceiling when retrying a failed request. |
NEXRALL_PROGRESS_TIMEOUT_MS | How long to wait for progress before a turn is considered stalled. |
NEXRALL_VERIFY_NUDGE | Tunes the nudge that asks the agent to verify its own work before finishing. |
Network (fetch)
| Variable | Purpose |
|---|---|
NEXRALL_ALLOW_LOCAL_FETCH | Set to 1 to allow fetch_url to reach localhost addresses. |
NEXRALL_FETCH_BLOCKLIST | Hosts/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:
| Variable | Value |
|---|---|
NEXRALL_HOOK_PHASE | The hook phase being run (PreToolUse / PostToolUse). |
NEXRALL_TOOL_NAME | The tool being invoked. |
NEXRALL_TOOL_INPUT | The tool's input, JSON-encoded. |
Next steps
- Configuration — the
.nexrall/directory andsettings.jsonhierarchy. - Permissions — modes and
allow/ask/denyrules. - Hooks — where the injected variables above are used.