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 location | Purpose | Manual 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.exe | Stable CLI/TUI launcher for the embedded managed runtime. | Do not replace or wrap. |
...\bin\defenseclaw-gateway.exe | Native gateway and lifecycle command. | Do not replace. |
...\bin\defenseclaw-hook.exe | No-console native connector hook runner. | Do not invoke with fabricated credentials or replace. |
...\bin\defenseclaw-startup.exe | HKCU logon helper that starts the adjacent gateway. | Do not relocate independently. |
...\bin\skill-scanner.exe, mcp-scanner.exe | Packaged 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.exe | Pinned verifier used by the packaged upgrade path. | Do not replace or add to global PATH. |
...\installer\install-state.json | Installer-owned product identity and lifecycle metadata. | Never edit or copy as a repair technique. |
%LOCALAPPDATA%\DefenseClaw\InstallerCache\DefenseClawSetup-x64.exe | Trusted 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.yaml | Primary operator configuration. | Prefer setup/config commands; if edited, run defenseclaw config validate before restart. |
%USERPROFILE%\.defenseclaw\.env | Protected gateway/provider/destination environment values. | Never print or edit for routine diagnosis. Use keys and setup commands. |
%USERPROFILE%\.defenseclaw\audit.db | Mandatory local SQLite audit and policy state. | Do not open with a second writer or attach to a support ticket. |
%USERPROFILE%\.defenseclaw\gateway.log | Appended detached-gateway stdout/stderr. | Read locally; review for sensitive content before sharing excerpts. No size-rotation guarantee is documented. |
%USERPROFILE%\.defenseclaw\logs\hook-failures.jsonl | Hook 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.pid | Protected process identity records, not bare kill instructions. | Do not delete while a process may be running. |
%USERPROFILE%\.defenseclaw\gateway.jsonl | Optional JSONL destination only when explicitly configured there. | Not a default log; manage through observability configuration. |
%CODEX_HOME%\managed_config.toml | Effective native Windows Codex hook policy. Default home is %USERPROFILE%\.codex. | Do not edit DefenseClaw-managed hooks; use setup/remove. |
%CODEX_HOME%\config.toml | Codex 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.json | Claude 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.ts | DefenseClaw-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" /verifyIn cmd, quote the executable itself:
"%LOCALAPPDATA%\DefenseClaw\InstallerCache\DefenseClawSetup-x64.exe" /verifyDefenseClaw 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 doctorwhere defenseclaw
where defenseclaw-gateway
defenseclaw version
defenseclaw-gateway status
defenseclaw status
defenseclaw guardrail status
defenseclaw config validate
defenseclaw doctorversion 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-runOnly 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
defenseclawanddefenseclaw-gatewayresolve from the productbindirectory. - Run
defenseclaw version; require the CLI and gateway generation to agree. - Run
defenseclaw-gateway status,defenseclaw status, anddefenseclaw guardrail status; require the intended Codex, Claude Code, and/or Amp rows, mode, fail mode, and enabled state. - Run
defenseclaw config validateanddefenseclaw 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 requiresAMP_API_KEY; do not paste it into the command or diagnostics. Do not use customer data, credentials, or a destructive tool call. - Open
defenseclaw tuior usedefenseclaw alertsand 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, anddefenseclaw config validate. - Require
defenseclaw-gateway statusanddefenseclaw doctorto pass with the exact upgraded generation. - Compare
defenseclaw guardrail statuswith 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 planand 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.
Telemetry and security
Native Windows telemetry channels, local audit persistence, credential scope, signing, and operational security boundaries.
Upgrade DefenseClaw
Upgrade DefenseClaw safely with verified artifacts, automatic v7-to-v8 observability migration, backups, rollback, local-dashboard refresh, and health checks.