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. |
%LOCALAPPDATA%\DefenseClaw\HookRuntime\defenseclaw-hook.exe | Stable protected copy used by native connector registrations that require the shared hook runtime. | Do not replace or invoke directly; Setup and connector reconciliation manage it. |
...\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/upgrade recovery material and timestamped config.yaml.before-redaction-* pre-change policy backups. | Do not restore or delete manually; they may contain credential-bearing or unredacted policy 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. |
%GEMINI_CLI_HOME%\.gemini\settings.json | Retired Gemini CLI integration state only. | New setup is unavailable. defenseclaw setup remove geminicli --yes uses the authenticated receipt to remove only DefenseClaw-owned legacy entries. |
%USERPROFILE%\.gemini\config\hooks.json | Google Antigravity's native hook configuration. | This nested Antigravity document is separate from retired Gemini CLI root settings; lifecycle operations must not cross those ownership boundaries. |
%COPILOT_HOME%\hooks\defenseclaw.json | GitHub Copilot CLI global hook registration; the default home is %USERPROFILE%\.copilot. | Uses Copilot's official powershell field. An explicitly pinned workspace instead uses <workspace>\.github\hooks\defenseclaw.json; keep those scopes separate. |
%USERPROFILE%\.cursor\hooks.json | Cursor user hooks plus DefenseClaw-managed entries. | Cursor has no documented configuration-home environment variable. Setup records this exact native path for repair, upgrade, and teardown. |
%APPDATA%\devin\config.json | Canonical Devin user configuration. DefenseClaw adds one managed command-hook group to each of the eight lifecycle events under hooks and preserves foreign JSONC content. | Do not replace individual managed entries; use setup/remove. |
<workspace>\.devin\hooks.v1.json | Canonical project hook document when an explicit workspace is selected. The hook map is the whole JSONC document. | Keep project and user custody separate; use setup/remove. |
%APPDATA%\devin\mcp_config.json, <workspace>\.devin\mcp_config.json | Canonical Devin MCP read/write locations. Higher-precedence local compatibility files may be inventoried read-only. | Manage through Devin or DefenseClaw MCP commands; do not copy credentials into support output. |
%USERPROFILE%\.defenseclaw\connector_backups\devin\config.json | Managed ownership/restore receipt for the exact Devin hook document. | Do not edit or copy it; setup/teardown use it for exact lifecycle custody. |
%USERPROFILE%\.defenseclaw\connector_backups\windsurf\config.json | Retired predecessor receipt retained only when an older authenticated install still owns cleanup work. | Do not edit or copy it. Upgrade/uninstall consumes only its receipt-bound managed entries; it is not active connector state. |
%USERPROFILE%\.defenseclaw\hook_contract_lock.json | Versioned connector readiness metadata. An active devin entry must identify devin-hooks-v1 and the exact user or project hook document. | If Doctor reports a missing Devin lock, rerun defenseclaw setup devin --yes --restart; another connector setup is not a repair path. |
%OPENCODE_CONFIG_DIR%\plugins\defenseclaw.js | OpenCode bridge plugin. Default config root is %USERPROFILE%\.config\opencode. | Carries a connector-scoped token. Do not edit or copy; Doctor detects digest drift and Setup reconciles it. Restart OpenCode after lifecycle changes. |
%OMNIGENT_CONFIG_HOME%\config.yaml | OmniGent's effective custom-policy configuration; the default home is %USERPROFILE%\.omnigent. | Start OmniGent with the same explicit --config path after setup. DefenseClaw's bridge also binds the exact selected uv tool environment. |
%HERMES_HOME%\config.yaml | Supported Hermes native hook configuration. Default is %LOCALAPPDATA%\hermes. | Do not add a shell wrapper or edit DefenseClaw-owned handlers; use setup/remove. |
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, CLAUDE_CONFIG_DIR, COPILOT_HOME, OPENCODE_CONFIG_DIR,
OMNIGENT_CONFIG_HOME, and HERMES_HOME are the connector
configuration overrides honored by their respective implementations. Set them
to absolute, normalized native Windows paths before initial Setup or connector
setup. The installer validates and records them; reparse ancestors are refused.
Antigravity, Cursor, and Devin publish no equivalent public
configuration-home override. The retired Gemini CLI cleanup path can still read
its previously authenticated GEMINI_CLI_HOME custody record; it is not a
supported new setup override. Antigravity's distinct global hook path is fixed at
%USERPROFILE%\.gemini\config\hooks.json; Setup keeps any predecessor custom
path only as internal custody needed for exact migration and restoration.
Legacy cleanup records Gemini's vendor root and derived .gemini directory
independently from Antigravity's nested home so one connector cannot restore or
delete the other's document. Cursor and Devin likewise record their exact
native paths internally.
Amp has no connector-home override: its supported 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"
$env:COPILOT_HOME = "D:\Agent Profiles\Copilot"
$env:OPENCODE_CONFIG_DIR = "D:\Agent Profiles\OpenCode"
$env:OMNIGENT_CONFIG_HOME = "D:\Agent Profiles\OmniGent"
$env:HERMES_HOME = "D:\Agent Profiles\Hermes"set "CODEX_HOME=D:\Agent Profiles\Codex"
set "CLAUDE_CONFIG_DIR=D:\Agent Profiles\Claude"
set "COPILOT_HOME=D:\Agent Profiles\Copilot"
set "OPENCODE_CONFIG_DIR=D:\Agent Profiles\OpenCode"
set "OMNIGENT_CONFIG_HOME=D:\Agent Profiles\OmniGent"
set "HERMES_HOME=D:\Agent Profiles\Hermes"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 Devin connector has no public configuration-home or executable override in
packaged Windows Setup. Setup resolves %APPDATA%\devin and the fixed
%LOCALAPPDATA%\devin\cli\bin\devin.exe path from the signed-in user's Known
Folders, validates both, and persists them. Repair, upgrade, reconciliation,
and uninstall use only that custody; they do not follow ambient profile drift
or scan another user's configuration.
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. OpenCode does
not consume those ambient process overrides: Setup bakes its persisted fail
mode into the managed plugin, and status/Doctor report drift.
Private Windows DACLs restrict connector assets to the current user, Administrators, and SYSTEM. They reduce access by other standard users but are not tamper-proof against the owning user or administrators. Doctor's digest check and Setup reconciliation are the supported drift/recovery controls.
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" /verifyThose examples are interactive shell syntax. The command stored in Hermes
config.yaml is deliberately different: it is a directly double-quoted
absolute defenseclaw-hook.exe path followed by literal argv, with forward
slashes in the Windows path. It must not contain PowerShell's &, a .ps1,
or any other shell wrapper because Hermes uses shlex.split and
subprocess.run(..., shell=False).
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 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 every intended supported connector row, mode, enabled state, and truthful failure posture. Hermes failures must be reported open even if generic policy provenance isclosed. - 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's hooks or telemetry. Hermes manual block visibility must use a harmless matched tool request and confirm only a valid synchronous JSON block, never a timeout/nonzero test.
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.
- Confirm each configured connector has loaded its configuration, restarting the official client where documented, then repeat the harmless per-connector event check above. For Devin, use the admitted native CLI in the same Windows user session; WSL or a shell substitute is not valid evidence.
- 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 is healthy.
For broader context, see CLI reference, configuration, upgrade, and TUI.
Windows security model
Native Windows loopback authentication, 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.