Docs

Claude Code Setup

Two ways to connect Claude Code to Agent Keeper: the plugin (individual) or repo hooks (team).

Option 1: Plugin Recommended

Install the Agent Keeper plugin and connect your account. Hooks are written to ~/.claude/settings.json automatically. No repo changes needed.

  1. 1

    Add the Agent Keeper marketplace

    $ /plugin marketplace add agentkeeper/security
  2. 2

    Install the Agent Keeper plugin

    $ /plugin install agentkeeper
  3. 3

    Connect your account

    $ /agentkeeper:connect

    The plugin opens a device approval flow and stores the API key locally after you sign in.

  4. 4

    Approve the device in your browser

    Sign in to Agent Keeper and confirm the device authorization.

  5. 5

    Restart Claude Code

    Hooks are loaded at startup. A full restart is required for changes to take effect.

  6. 6

    Run one harmless action

    Ask Claude Code to run ls, then check Workstations and Activity.

What happens

The plugin writes HTTP hooks to ~/.claude/settings.json. Every prompt, tool call, and session is monitored. No repo changes needed.

Option 2: GitHub Repo Hooks Teams

For security teams who want to protect all developers working in a repo. Commit hooks once, every developer who clones gets automatic coverage.

  1. 1

    Get your API key from Settings → API Keys in the dashboard

  2. 2

    Add a .claude/settings.json to your repo

    {
      "hooks": {
        "UserPromptSubmit": [
          {
            "matcher": "*",
            "hooks": [
              {
                "type": "http",
                "url": "https://YOUR_AGENTKEEPER_URL/api/v1/claude-code/evaluate",
                "headers": {
                  "Authorization": "Bearer YOUR_API_KEY"
                }
              }
            ]
          }
        ],
        "PreToolUse": [
          {
            "matcher": "Bash|Edit|Write|Read|Glob|Grep|WebFetch|WebSearch",
            "hooks": [
              {
                "type": "http",
                "url": "https://YOUR_AGENTKEEPER_URL/api/v1/claude-code/evaluate",
                "headers": {
                  "Authorization": "Bearer YOUR_API_KEY"
                }
              }
            ]
          }
        ],
        "PostToolUse": [
          {
            "matcher": "Bash|Edit|Write|Read|Glob|Grep|WebFetch|WebSearch",
            "hooks": [
              {
                "type": "http",
                "url": "https://YOUR_AGENTKEEPER_URL/api/v1/claude-code/audit",
                "headers": {
                  "Authorization": "Bearer YOUR_API_KEY"
                }
              }
            ]
          }
        ],
        "SessionStart": [
          {
            "matcher": "*",
            "hooks": [
              {
                "type": "http",
                "url": "https://YOUR_AGENTKEEPER_URL/api/v1/claude-code/checkin",
                "headers": {
                  "Authorization": "Bearer YOUR_API_KEY"
                }
              }
            ]
          }
        ]
      }
    }
  3. 3

    Commit to the repo

    Every developer who clones gets automatic coverage. No individual setup required.

What Gets Monitored

Prompts

Every user message sent to Claude

Tool calls

Bash commands, file reads/writes, web fetches, grep/glob

Sessions

Start time, duration, hostname, Claude Code version, sandbox status

Threats

Credential exfiltration, reverse shells, prompt injection, 55+ patterns

Verifying It Works

  1. 1

    Make a tool call in Claude Code, ask it to run ls

  2. 2

    Check the Workstations page in your dashboard

  3. 3

    You should see the tool call in the Activity tab

Troubleshooting

No activity showing

Restart Claude Code after setup. Hooks are loaded at startup.

Workstation not appearing

Run /agentkeeper:connect again to re-register.

"Hook error" messages

Update Claude Code to the latest version (claude update).

Prompts not captured

Ensure UserPromptSubmit hook is present in settings.json.

Plugin updated upstream but local version didn't change

Claude Code only re-copies the plugin cache when the version number changes. If new commits were pushed without a version bump, the stale cache stays in place even after a restart. Fix: pull the marketplace manually, delete the cached version, then restart.
git -C ~/.claude/plugins/marketplaces/agentkeeper/ pull rm -rf ~/.claude/plugins/cache/agentkeeper/agentkeeper/<version>/

Plugin updated but skills still not appearing

After a cache refresh the plugin may still bail on the skill scan if HTTP hooks are already active in ~/.claude/settings.json. In that case the scan is handed off to ~/.agentkeeper/cc-session-start.sh, which requires AGENTKEEPER_API_KEY in ~/.agentkeeper/config. Add it and restart. See Agent Skills, Troubleshooting for the full checklist.

Uninstall

Removes every endpoint artifact, CLI, LaunchAgent, Claude Code hooks, plugin cache, Cowork MCP, shell PATH edits, and Keychain entries. Non-interactive and idempotent; safe to run twice.

$ curl -fsSL https://YOUR_AGENTKEEPER_URL/uninstall.sh | bash

For Kandji, Jamf, and Intune one-button deployment see the full uninstall guide.