Get StartedNative Windows

Paths and troubleshooting

Native Windows filesystem locations, supported overrides, safe diagnostics, and post-install and post-upgrade verification.

The packaged Windows lifecycle separates product files, user data, installer maintenance state, and each agent's own configuration. Keep those boundaries intact when diagnosing a problem.

Filesystem reference

Default locationPurposeManual editing
%LOCALAPPDATA%\Programs\DefenseClaw\Current-user product root resolved through the Windows User Programs Known Folder.Do not edit. Use Setup repair/upgrade/uninstall.
...\bin\defenseclaw.exeStable CLI/TUI launcher for the embedded managed runtime.Do not replace or wrap.
...\bin\defenseclaw-gateway.exeNative gateway and lifecycle command.Do not replace.
...\bin\defenseclaw-hook.exeNo-console native connector hook runner.Do not invoke with fabricated credentials or replace.
...\bin\defenseclaw-startup.exeHKCU logon helper that starts the adjacent gateway.Do not relocate independently.
...\bin\skill-scanner.exe, mcp-scanner.exePackaged local scanners.Do not replace.
...\runtime\python\Embedded Python and installed DefenseClaw packages.Do not use as a general Python environment or modify packages.
...\runtime\tools\cosign.exePinned verifier used by the packaged upgrade path.Do not replace or add to global PATH.
...\installer\install-state.jsonInstaller-owned product identity and lifecycle metadata.Never edit or copy as a repair technique.
%LOCALAPPDATA%\DefenseClaw\InstallerCache\DefenseClawSetup-x64.exeTrusted maintenance copy for repair, upgrade handoff, and uninstall.Run through documented actions only; do not replace by hand.
%LOCALAPPDATA%\DefenseClaw\InstallerState\Private durable transaction/recovery state and setup.log.Do not delete journals. Read the log locally when troubleshooting.
%LOCALAPPDATA%\DefenseClaw\InstallerTemp\Bounded transient payload staging.Do not reuse as an install source or recovery backup.
%USERPROFILE%\.defenseclaw\config.yamlPrimary operator configuration.Prefer setup/config commands; if edited, run defenseclaw config validate before restart.
%USERPROFILE%\.defenseclaw\.envProtected gateway/provider/destination environment values.Never print or edit for routine diagnosis. Use keys and setup commands.
%USERPROFILE%\.defenseclaw\audit.dbMandatory local SQLite audit and policy state.Do not open with a second writer or attach to a support ticket.
%USERPROFILE%\.defenseclaw\gateway.logAppended detached-gateway stdout/stderr.Read locally; review for sensitive content before sharing excerpts. No size-rotation guarantee is documented.
%USERPROFILE%\.defenseclaw\logs\hook-failures.jsonlHook delivery/response failure records when produced.Treat as sensitive operational data.
%USERPROFILE%\.defenseclaw\hooks\Generated hook assets, runtime state, and connector-scoped credential sidecars.Never edit, print, or copy credentials. Reconcile with setup/doctor.
%USERPROFILE%\.defenseclaw\backups\Managed connector and upgrade recovery material.Do not restore or delete manually; it may contain credential-bearing state.
%USERPROFILE%\.defenseclaw\quarantine\DefenseClaw-owned quarantined skills/plugins and provenance.Use skill restore or plugin restore; do not drag files back.
%USERPROFILE%\.defenseclaw\.upgrade-receipts\Private automatic-upgrade admission/recovery receipts when used.Inspect metadata only; do not edit receipt JSON.
%USERPROFILE%\.defenseclaw\gateway.pid, watchdog.pidProtected process identity records, not bare kill instructions.Do not delete while a process may be running.
%USERPROFILE%\.defenseclaw\gateway.jsonlOptional JSONL destination only when explicitly configured there.Not a default log; manage through observability configuration.
%CODEX_HOME%\managed_config.tomlEffective native Windows Codex hook policy. Default home is %USERPROFILE%\.codex.Do not edit DefenseClaw-managed hooks; use setup/remove.
%CODEX_HOME%\config.tomlCodex user config plus DefenseClaw-marked OTLP/notify fields.Other Codex settings are user-owned; use DefenseClaw teardown to remove managed fields.
%CLAUDE_CONFIG_DIR%\settings.jsonClaude Code user config plus DefenseClaw-marked hooks/OTLP environment entries. Default is %USERPROFILE%\.claude.Do not remove individual managed entries by hand; use setup/remove.
%USERPROFILE%\.config\amp\plugins\defenseclaw.tsDefenseClaw-managed Amp TypeScript system-policy plugin with a connector-scoped credential.Never print, copy, or hand-edit. Use setup/remove; operator-owned sibling plugins are separate.

The installer records the exact connector homes and uses them for later repair, upgrade, and cleanup. Connector configuration backups are ownership records, not a user-facing rollback directory.

Supported path overrides

CODEX_HOME and CLAUDE_CONFIG_DIR are the supported connector configuration overrides. Set them to absolute, normalized native Windows paths before initial Setup or connector setup. The installer validates and records them; reparse ancestors are refused. Amp has no connector-home override: its certified system plugin path is fixed beneath the current %USERPROFILE% at .config\amp\plugins\defenseclaw.ts.

$env:CODEX_HOME = "D:\Agent Profiles\Codex"
$env:CLAUDE_CONFIG_DIR = "D:\Agent Profiles\Claude"
set "CODEX_HOME=D:\Agent Profiles\Codex"
set "CLAUDE_CONFIG_DIR=D:\Agent Profiles\Claude"

Changing an environment value after installation does not authorize lifecycle commands to abandon the recorded home. Re-run supported connector setup or repair deliberately; do not move the directory and edit installer state.

The generic runtime recognizes DEFENSECLAW_HOME, but the native packaged Setup, launchers, logon helper, repair, and upgrade lifecycle deliberately pin the data root to the current profile's .defenseclaw. Relocating a packaged installation with DEFENSECLAW_HOME, DEFENSECLAW_CONFIG, or an executable override is not supported.

DEFENSECLAW_FAIL_MODE and DEFENSECLAW_STRICT_AVAILABILITY are runtime behavior overrides, not path controls. Prefer the persisted defenseclaw guardrail fail-mode command for normal operation.

Quoting, long paths, and case

Quote every path that can contain spaces. In PowerShell, use the call operator for an executable path:

& "$env:LOCALAPPDATA\DefenseClaw\InstallerCache\DefenseClawSetup-x64.exe" /verify

In cmd, quote the executable itself:

"%LOCALAPPDATA%\DefenseClaw\InstallerCache\DefenseClawSetup-x64.exe" /verify

DefenseClaw product executables are long-path-aware, and installer journal and process-identity tests cover paths beyond the legacy MAX_PATH limit. That does not certify arbitrary third-party agents, plugins, network filesystems, or shell wrappers. Protected connector and transaction paths reject reparse redirection; remote Windows filesystems are not a supported transaction target.

Windows comparisons are case-insensitive where required for environment keys and owned path identity. Do not rely on two connector homes, files, or environment variables that differ only by letter case.

First diagnostics

Run these before changing state:

Get-Command defenseclaw
Get-Command defenseclaw-gateway
defenseclaw version
defenseclaw-gateway status
defenseclaw status
defenseclaw guardrail status
defenseclaw config validate
defenseclaw doctor
where defenseclaw
where defenseclaw-gateway
defenseclaw version
defenseclaw-gateway status
defenseclaw status
defenseclaw guardrail status
defenseclaw config validate
defenseclaw doctor

version detects a stale launcher/gateway mismatch. status reports the configured connector roster and authenticated runtime state. doctor checks the installed agent contract, native registration, credentials, endpoints, and connectivity without printing credential values.

For repairable findings, preview before mutation:

defenseclaw doctor --fix --dry-run

Only use --fix --yes after reviewing the exact proposed fix. The token-drift fix can restart the gateway. Doctor does not tear down inactive connector residue automatically.

Troubleshooting

Post-install checklist

Complete this without real secrets or destructive tools:

  • Open a new native PowerShell or cmd window and confirm defenseclaw and defenseclaw-gateway resolve from the product bin directory.
  • Run defenseclaw version; require the CLI and gateway generation to agree.
  • Run defenseclaw-gateway status, defenseclaw status, and defenseclaw guardrail status; require the intended Codex, Claude Code, and/or Amp rows, mode, fail mode, and enabled state.
  • Run defenseclaw config validate and defenseclaw doctor; resolve every connector registration or authentication failure.
  • Restart each configured Codex or Claude Code agent; fully exit and relaunch Amp. In an empty disposable directory, submit a non-sensitive prompt such as “Reply with the word ready.” For amp -x, include --plugin-ready-timeout 30. An authenticated Amp live turn additionally requires AMP_API_KEY; do not paste it into the command or diagnostics. Do not use customer data, credentials, or a destructive tool call.
  • Open defenseclaw tui or use defenseclaw alerts and confirm new activity is attributed only to the agent you exercised.
  • If multiple connectors are installed, repeat the harmless prompt once in each; one connector's success does not prove another connector's hook, plugin, or OTLP settings.

Post-upgrade checklist

  • Run defenseclaw version, defenseclaw migrations status, and defenseclaw config validate.
  • Require defenseclaw-gateway status and defenseclaw doctor to pass with the exact upgraded generation.
  • Compare defenseclaw guardrail status with the pre-upgrade connector roster, modes, fail modes, enabled state, and optional watchdog state.
  • Confirm the command path still resolves to the installed product directory, not a stale checkout or copied binary.
  • Restart Codex and Claude Code, fully exit and relaunch Amp, then repeat the harmless per-connector event check above.
  • Verify optional destinations with defenseclaw observability plan and the destination-specific test command. A destination failure does not erase the mandatory local audit, but it must be treated as degraded delivery.
  • Keep private receipts and backups untouched until the upgraded gateway and every configured connector are healthy.

For broader context, see CLI reference, configuration, upgrade, and TUI.