Uninstall
Remove DefenseClaw for your account on macOS, Linux or Windows, with or without its data and programs.
defenseclaw uninstall removes DefenseClaw for your account. It works the same on macOS, Linux and Windows.
Close your agent sessions first. A session that stays open goes on without DefenseClaw: its hooks fail and nothing checks its tool calls. The plan says so before it asks to proceed.
If an agent session is still open, uninstall --all --binaries can stop with Directory not empty and leave the programs in place. Close the session and run defenseclaw uninstall again.
If you set up an editor with defenseclaw acp setup or defenseclaw setup acp, uninstall also removes the guarded ACP entries it wrote in the editor's settings, with their contract locks in ~/.defenseclaw/acp. Every other entry in that file stays. The plan lists them under ACP editor entries. An older release's uninstall left these entries behind, and such a leftover entry can start the agent unchecked, refuse every message, or fail to start. defenseclaw acp detect lists the guarded entries, and defenseclaw acp remove --client <client> --agent <agent> removes one without uninstalling. On a managed computer the enrollment owns the entry; see ACP guard.
-
See what would be removed. Nothing changes.
defenseclaw uninstall --dry-run------------------------ Plan ------------------------ * active connector: claudecode * connector teardown: claudecode - an agent session that is open now goes on without DefenseClaw (its hooks fail and nothing checks its tool calls): close it first, or restart it once DefenseClaw is back * sandbox teardown: no (no OpenShell sandbox state) * stop sidecar: yes * wipe ~/.defenseclaw: no * remove binaries: no (dry-run - nothing modified) -
Remove the connector hooks and stop the gateway. This keeps
~/.defenseclawand the programs, so a laterdefenseclaw setup guardrailpicks up where you left off.defenseclaw uninstall -
To remove everything, add
--all(deletes~/.defenseclaw: audit log, config, secrets) and--binaries(removes the CLI, gateway and helper programs).defenseclaw uninstall --all --binaries --yesIf you already ran
defenseclaw sandbox teardown, add--stop-sandboxesto this command. For copy-mode work, usedefenseclaw sandbox pull NAME --apply(or--branchor--patch-out FILE) and confirm the project, branch or patch file contains it. Review mounted work withdefenseclaw sandbox review NAME. Then use--stop-sandboxes, which stops and deletes running sandboxes.
An agent config file you have not changed since setup is restored from its checked backup. If you edited it, only DefenseClaw's entries are removed.
If you set up Claude Cowork with defenseclaw setup cowork, uninstall cannot remove the plugin from your Claude account, and defenseclaw reset cannot either. In Claude Desktop, open Customize > Plugins, then the ... menu on DefenseClaw, and choose Remove. Until you remove the plugin, Cowork tool calls are blocked. --dry-run lists this step. See Remove the Cowork plugin.
--all deletes the audit log. Export what you need first with defenseclaw-gateway audit export.
Sandboxes
If you set up sandboxes, uninstall also removes DefenseClaw's OpenShell sandboxes and images. A running sandbox stops the uninstall before any change. For copy mode, use defenseclaw sandbox pull NAME --apply (or --branch or --patch-out FILE) and confirm the project, branch or patch file contains the work. For mount mode, use defenseclaw sandbox review NAME. Then stop the sandbox and retry. --stop-sandboxes stops and deletes running sandboxes; copy-mode work not yet pulled back is lost. If teardown fails, rerun without --all and --binaries and add --skip-sandbox-teardown, then run defenseclaw-gateway sandbox teardown once Docker and OpenShell work.
Windows
On Windows the programs are in %USERPROFILE%\.local\bin and the data in %USERPROFILE%\.defenseclaw. The commands are the same, and --binaries removes the programs. There are no sandboxes to tear down.
Other ways to remove
- A source build:
defenseclaw.cmd uninstall --binaries --yeson Windows before building again; see Build from source. - Turn the guardrail off without removing anything: Turn off the guardrail.
- Managed computers: removal is an administrator task (Enterprise lifecycle).
Every flag is in the CLI reference.
Upgrade DefenseClaw
Upgrade with one command. The latest release's own installer performs the upgrade, keeps your configuration and data, and rolls back on failure.
Unified LLM key
Set DEFENSECLAW_LLM_KEY, the one environment variable for the LLM judge, the MCP, skill and plugin scanners and other LLM calls made through Bifrost.