Reference

Configuration, Permissions & Security Sandbox

Highbeam layers project settings over user defaults while keeping strict Ring-0 safety checks, read-only SQLite reads, and local-only ports.

1. Unified Config Schema (.attention-horizon.json)

Built into src/core-isomorphic/config/horizonConfig.mjs, Highbeam merges settings from lowest to highest priority: built-in defaults → global ~/.attention-horizon/config.json → project <workspace>/.attention-horizon.json.

.attention-horizon.json (Complete Default Schema)
{
  "schemaVersion": "1.0.0",
  "detectorNamespace": "claude-code",
  "flightMode": "COACH",
  "detectors": {
    "DET-01": "default",
    "DET-02": "default",
    "DET-03": "default",
    "DET-04": "default",
    "DET-05": "default",
    "DET-06": "default",
    "DET-07": "default",
    "DET-08": "default",
    "DET-09": "default",
    "DET-10": "default",
    "DET-11": "default",
    "DET-12": "default",
    "DET-13": "default",
    "DET-14": "default",
    "DET-15": "default",
    "DET-16": "default",
    "DET-17": "default",
    "DET-18": "default",
    "DET-19": "default",
    "DET-20": "default"
  },
  "semanticDetectors": {
    "formatter-bypass": "default",
    "drip-feed": "default",
    "vague-prompt-rubric": "default",
    "effort-overkill": "default",
    "post-commit-handoff": "default",
    "vision-screenshot-coach": "default",
    "micro-skills": "default",
    "relay-breaker": "default"
  },
  "thresholds": {
    "safeLimitTokens": 147000,
    "reminderAtPct": 75,
    "subagentOffloadTokens": 12000,
    "blindSearchLimit": 6,
    "consecutiveFailureLimit": 3,
    "enableLocalKeepAlive": false,
    "microSkillConfirmSessions": 2,
    "minSwitchPenaltyUSD": 0.02,
    "notableAllowPenaltyUSD": 0.02,
    "outputShrinkageMinTurns": 5,
    "outputShrinkagePriorTokens": 500
  }
}

2. Antigravity Router Schema (default_flightcheck.json)

Antigravity's PreInvocation router loads defaults from config/default_flightcheck.json and applies your changes from ~/.gemini/flightcheck/config.json. See Antigravity Router Levels & Cooldowns for how hook_level works with halt_cooldown_turns:

Key Default Operational Meaning
hook_level "guard" Router mode: "guard" stops with a scorecard; "advisory" adds soft warnings only.
halt_cooldown_turns 3 Turns skipped between router stops to avoid nag loops (Context Truncation Crisis skips cooldown).
cold_session_max_turns 3 Early turns checked for missing file or scope anchors.
trust_decay_turn_threshold 10 Turn count where deeper context drift checks turn on.
warm_cache_lock_tokens 50000 Cached token count that locks rule files so edits do not break a warm cache.
subagent_min_cache_tokens / subagent_min_purity_pct 25000 / 70.0 Warm main-chat threshold that triggers STEER_SUBAGENT tips for broad repo searches.
compact_halt_purity_pct 45.0 Signal Purity floor where high-effort turns suggest trimming or running /compact.
amputation_token_threshold 140000 Token limit that raises amputationCrisis (Context Truncation Risk).
quota_floor_fraction 0.10 5-hour quota floor (10%) that triggers HALT_EFFORT_OR_QUOTA quota-saving tips.
max_single_write_lines / max_tool_payload_tokens 600 / 25000 Max lines for one file write and max raw tool output size before archiving.
uncheckpointed_dirty_file_limit 4 Dirty file count that nudges you to run a test or git check.
consecutive_error_strike_limit 3 Repeat identical tool errors allowed before the 3-strike breaker stops the loop.
plan_revision_warn / split_recommend_minutes 3 / 45 Plan rewrite count and chat length in minutes that suggest starting a fresh session.
handoff_audit_enabled / deprecated_paths true / ["**/legacy/**", "**/deprecated/**", "**/v1/**"] Turns on 5-point State Baton checks and lists path globs tagged as LEGACY_POISON.
Platform Quirks & WebView Window Settings Schemas

config/platformQuirks.json: Sets two host safety guards. First, visionOverageHttp400 warns via DET-20 when AI Credit Overages are on and an image would fail with HTTP 400 ("Unable to process input image"). Second, hybridQuotaLockout (DET-16) caps workers to 1 at 80% quota, asks at 90%, and limits subagents to 40,000 tokens or 12 turns to prevent 168-hour lockouts.

<cacheDir>/settings.json (src/core/settings.mjs): Saves WebView slider values { safeLimitTokens, reminderAtPct, modelOverrides }. Values stay clamped to 20,000..1,048,576 tokens and 50%..99%, and save safely via atomic rename.

3. Environment Variables Reference

Variable Read By Effect & Default
AH_COLUMNS bin/ah-statusline.mjs Sets terminal width (80, 110, or 144+ columns) when --columns is not passed.
AH_INTERCEPTION_LOG_PATH hooks/handlers/pre-model-switch.mjs Optional JSONL file path to log PreModelSwitch break-even math, weights, and results.
AH_MODEL_SWITCH_TELEMETRY_PATH src/utils/modelSwitchTelemetry.mjs Custom path for scrubbed switch stats (defaults to ~/.attention-horizon/cache/model_switch_telemetry.json).
AH_TIER1_MOD_ACTIVE hooks/register.js & Tier-2 handlers Set to "1" by the in-process module so command hooks skip duplicate work. Current Claude Code does not load that module, so this is not set today.
CLAUDE_BIN src/diagnostics/claudeHookCapabilities.mjs Path to the Claude Code binary or bundle checked for hook support flags.
CLAUDE_PLUGIN_ROOT hooks/hooks.json & bin/ctxtop.mjs Set by Claude Code so hooks find plugin scripts and hooks/register.js.
CLAUDE_CODE_ENABLE_TELEMETRY otelExporter.mjs Turns on local OpenTelemetry metric output when set to "1".
CLAUDE_HEADLESS hooks/register.js Skips side-panel UI setup during headless CI runs.
ANTIGRAVITY_CONVERSATION_ID / AGY_CONVERSATION_ID server.mjs & agy_cli_compressor.mjs Pins the sidecar server or CLI log trimmer to one Antigravity chat ID.
ANTIGRAVITY_SIDECAR_WEB_PORT / PORT sidecars/horizon-daemon/server.mjs Sets a custom local port (default 62935, range 62935..62945).
ANTIGRAVITY_SIDECAR_UI_TOKEN sidecars/horizon-daemon/server.mjs Optional local bearer token checked on WebView requests when set by Antigravity.
ATTENTION_HORIZON_HOME_DIR src/core/constants.mjs Moves Highbeam's local home folder (handy in test sandboxes).
CTXTOP_FORCE_NO_SQLITE src/engine-node/db/probe.mjs When "1", skips node:sqlite and uses read-only JSONL byte-offset reads.
CTXTOP_FORCE_FTS5_POLYFILL src/engine-node/db/probe.mjs When "1", uses the built-in SQLite FTS5 polyfill even if native SQLITE_ENABLE_FTS5 exists.
CTXTOP_IPC_PATH src/engine-node/ipc/protocol.mjs Custom path for the user Unix socket or Windows Named Pipe.
CTXTOP_NO_BROWSER src/cli/init.mjs Stops agy-horizon ui from opening a browser tab on launch.
HORIZON_DEMO / HORIZON_DEMO_SCENARIO server.mjs & horizon_hud.mjs Loads sample test scenes (1..5) without reading real chat logs.
HORIZON_DIAGNOSTICS_DIR src/core/hook_diagnostics.mjs Custom folder for hook error logs read by highbeam doctor.
HORIZON_DEBUG / DEBUG classifier.mjs, quota.mjs, init.mjs Prints extra local debug lines to stderr when troubleshooting.
HORIZON_TEST_NO_SPAWN sidecars/horizon-daemon/server.mjs Blocks OS file explorer launches on POST /api/open-brain during tests.
CTXTOP_ED25519_PUBLIC_KEY_PEM / CTXTOP_PRO_DEV src/core/pro_license.mjs Custom Ed25519 public key for offline enterprise tests, or local dev flag.
CTXTOP_ED25519_PRIVATE_KEY_PEM / CTXTOP_POLAR_WEBHOOK_SECRET polar_webhook_worker.mjs Server signing keys for the Polar license worker (never needed on dev machines).

4. Zero-Trust Security Sandbox & Branch Isolation

Backed by SECURITY.md and checked in test/mod_static_compliance.test.mjs, Highbeam enforces five strict safety rules:

  1. Zero Outbound Network Calls: The CLI, hooks, MCP server, and local HTTP server never make external HTTP or DNS requests.
  2. Localhost Binding & Size Caps: sidecars/horizon-daemon/server.mjs binds only to 127.0.0.1 and drops POST bodies over 4,096 bytes.
  3. Read-Only Session Reads: Every Antigravity SQLite database opens with { readOnly: true } (SQLITE_OPEN_READONLY) inside try / finally, and JSONL files open with 'r'.
  4. No Self-Edits to Guard Configs: DET-18 stops agents from editing .claude/settings.json or hooks.json to turn off safety checks mid-chat.
  5. Safe Parallel Worktrees: When two or more agents write code at once, pair Git worktrees (workspace: "share" or git worktree add) with .agents/locks/active_scopes.json file locks (DET-20) so edits never clash.