Uninstall Agent Keeper
One non-interactive command. Removes every endpoint artifact Agent Keeper places on a machine:
- LaunchAgent / systemd timer + running
agentkeeper.shprocesses - Legacy CLI binary (
~/.local/bin/agentkeeper.sh) and thegumhelper if present - Claude Code hooks in
~/.claude/settings.json(leaves other vendors' hooks untouched) - Claude Code plugin cache +
installed_plugins.jsonentries - Cursor / Copilot / Windsurf adapter hooks in the current project
- Cowork MCP registration
- State directories (
~/.agentkeeper,~/.agentkeeper-plugin) - Shell profile
PATHentries added by the installer - macOS Keychain entries (best-effort)
It's idempotent, safe to run twice, and writes a timestamped backup of ~/.claude/settings.json before modifying it.
One-liner (individual machine)
curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash
Preview what would be removed without changing anything:
curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash -s -- --dry-run
Keep your local config/api-key (useful if you plan to reinstall):
curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash -s -- --keep-data
Quiet mode for MDM log readability:
curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash -s -- --quiet
Kandji, one-button Self Service
Deploy as a Self Service item so users can uninstall themselves, or as an on-demand Library Item for helpdesk-triggered cleanup.
Option A: Self Service (recommended)
-
In Kandji, go to Library → Add New → Custom Script.
-
Name:
Uninstall Agent Keeper -
Execution Frequency:
Run on-demand(Self Service) orAudit & Enforceif you want to force-remove at scale. -
Run as:
Logged-in user, this ensures$HOMEresolves to the real user's directory. -
Audit Script (leave empty, or paste a one-line check such as
test -f "$HOME/.agentkeeper/config/api_key"). -
Remediation Script: paste:
#!/bin/bash /bin/bash -c "$(curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh)" -- --quiet -
Assign to the Blueprint(s) that target the devices you want to clean.
-
Save. Users will see "Uninstall Agent Keeper" in Self Service, one button, runs silently, reports success/failure to Kandji.
Option B: Run as root (if your Library Item requires it)
If you can't set "Run as Logged-in user," wrap the curl to resolve the console user first:
#!/bin/bash
CONSOLE_USER=$(stat -f %Su /dev/console)
su - "$CONSOLE_USER" -c "curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash -s -- --quiet"
Jamf Pro
Same script, different library type:
- Computers → Management Settings → Scripts → New.
- Paste the script from Option A above.
- Create a Policy with this script, scoped to the target smart group, trigger =
Self Service(orRecurring Check-infor forced removal).
Intune (Windows/macOS)
macOS: add as a Shell Script under Devices → macOS → Shell scripts. Set "Run script as signed-in user" to Yes.
Manual / offline use
If you can't curl from the endpoint, save the script locally and run it. The script is self-contained, no runtime dependencies beyond bash, python3, and standard POSIX utilities, all of which are on macOS and most Linux distros by default.
What gets preserved
- Repo-level hooks committed in a project's
.claude/settings.json. The uninstaller only touches user-scoped settings (~/.claude/settings.json). Repo hooks have to be removed from the repo itself. - The
agentkeeper-securityconnector if you added it at the Claude Enterprise org level. That's a web console setting, not an endpoint artifact. - Your device record in the Agent Keeper dashboard. Revoke it manually at YOUR_AGENTKEEPER_URL/hosts when you're ready.
Exit codes
0, success (including "nothing to remove").1, could not determine target user (happens only when running as root with no logged-in console user and noSUDO_USERset).
Source
The script is open and available at /uninstall.sh. Review it before deploying to a fleet.