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.

  1. 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)
  2. Remove the connector hooks and stop the gateway. This keeps ~/.defenseclaw and the programs, so a later defenseclaw setup guardrail picks up where you left off.

    defenseclaw uninstall
  3. To remove everything, add --all (deletes ~/.defenseclaw: audit log, config, secrets) and --binaries (removes the CLI, gateway and helper programs).

    defenseclaw uninstall --all --binaries --yes

    If you already ran defenseclaw sandbox teardown, add --stop-sandboxes to this command. For copy-mode work, use defenseclaw sandbox pull NAME --apply (or --branch or --patch-out FILE) and confirm the project, branch or patch file contains it. Review mounted work with defenseclaw 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

Every flag is in the CLI reference.