Skip to content
Skills Library
AI & agents · Tool integration

agent-kill-switch

/agent-kill-switch

Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry. Use when the user asks to stop or kill a runaway agent, see what an agent is doing or spending, cap agent spend, gate risky tool calls behind approval, or "set up a kill switch" for Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Goose, Aider and similar runtimes.

Repository
clawmetry ↗
Licence
MIT
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
9
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry. Use when the user asks to stop or kill a runaway agent, see what an agent is doing or spending, cap agent spend, gate risky tool calls behind approval, or "set up a kill switch" for Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Goose, Aider and similar runtimes.

Triggers from the description

set up a kill switch
Original author description

Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry. Use when the user asks to stop or kill a runaway agent, see what an agent is doing or spending, cap agent spend, gate risky tool calls behind approval, or "set up a kill switch" for Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Goose, Aider and similar runtimes.

How it works

  1. 1. Install and start
  2. 2. See what is running and what it costs
  3. 3. Stop one session (the off switch)
  4. 4. Hold risky tool calls until a human approves (Claude Code)
  5. 5. Cap spend for agents that call the API with a key
  6. Honest limits
  7. Remove
Original SKILL.md headings · 108 lines, 581 words
SKILL.md preview
---
name: agent-kill-switch
description: Give the human an off switch and a cost meter for the coding agents on this machine, using ClawMetry. Use when the user asks to stop or kill a runaway agent, see what an agent is doing or spending, cap agent spend, gate risky tool calls behind approval, or "set up a kill switch" for Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Goose, Aider and similar runtimes.
license: MIT
metadata:
  author: vivekchand
  homepage: https://clawmetry.com
  source: https://github.com/vivekchand/clawmetry
---

# Agent kill switch

An agent that loops, re-reads the same files, or shells out to something it
should not is expensive by the minute. This skill wires up
[ClawMetry](https://github.com/vivekchand/clawmetry), a local, read-only
dashboard that reads the session logs the runtimes already write on disk, and
uses it for three things: see what is running, stop one session, and hold
risky tool calls until a human says yes.

Nothing here modifies the agent. Observation is read-only. Every control
below is opt-in and stated as what it does, so tell the user exactly which
ones you enabled.

## 1. Install and start

```bash
pip install clawmetry && clawmetry
```

The dashboard is at `http://localhost:8900`. It auto-detects the runtimes on
the machine (Claude Code, Codex, Cursor, Gemini CLI, OpenClaw, Goose, Aider,
Cline, OpenCode and others); no config. Confirm it is up:

```bash
curl -s http://localhost:8900/api/overview | head -c 400
```

If the port is taken: `clawmetry --port 8901` and use that port below.

## 2. See what is running and what it costs

```bash
curl -s http://localhost:8900/api/sessions      # live and recent sessions, ids look like claude_code:<uuid>
curl -s http://localhost:8900/api/usage         # tokens and cache-aware cost per model and per session
```

Tell the user in plain words: which sessions are active, which one is
spending the most, and whether any is showing loop signs. The dashboard's
Sessions tab shows the full transcript and every tool call for a session.

## 3. Stop one session (the off switch)

```bash
curl -s -X POST http://localhost:8900/api/sessions/<session_id>/stop
```

- `200` with `"ok": true` and a `pid`: the session's process received SIGTERM.
- `409` with `"ok": false`: ClawMetry could not identify a process for that
  session, for example a Cursor editor conversation, which shares the IDE
  process. Say so instead of claiming it was stopped.

Never call this on your own initiative. Only when the user asks to stop a
session, and confirm which session id first.

## 4. Hold risky tool calls until a human approves (Claude Code)

```bash
clawmetry hooks install      # adds a PreToolUse hook to ~/.claude/settings.json, idempotent
clawmetry hooks status
```

Then one policy gates everything ClawMetry scores `high` or `critical`
(recursive deletes, force pushes, sudo, credential files, reverse shells,
cloud metadata endpoints):

```yaml
# ~/.clawmetry/policies.yml
- name: 'Require approval for high-risk actions'
  min_risk: 'high'
  action: 'require_approval'
  timeout: 604800
  on_timeout: 'deny'
```

A deny blocks that one call; the agent keeps its session. Approvals can be
answered from the Approvals tab or, with cloud sync, from a phone push.
Undo with `clawmetry hooks uninstall` (removes only ClawMetry's entries).

## 5. Cap spend for agents that call the API with a key

```bash
clawmetry proxy start --daily-budget 10
export ANTHROPIC_BASE_URL=http://localhost:4100/v1   # or OPENAI_BASE_URL for OpenAI-backed agents
```

When the cap is hit the proxy returns `BUDGET_EXCEEDED` instead of forwarding
the request. It also detects repeated near-identical requests (loops). This
only covers agents whose traffic you route through it; say that.

## Honest limits

- OpenClaw and NemoClaw are free in the open-source app. The other runtimes,
  and the approvals feature, need ClawMetry Cloud or a self-hosted Pro
  license after the trial. Tell the user before enabling those.
- The stop in step 3 is SIGTERM to a process ClawMetry can identify. It is
  not a guarantee for every runtime; the `409` is the honest answer.
- Data stays on the machine unless the user runs `clawmetry connect`, which
  enables end-to-end encrypted cloud sync.

## Remove

```bash
clawmetry hooks uninstall
clawmetry proxy stop
pip uninstall clawmetry
```

Versions

The database has no other skills named agent-kill-switch.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 62ac9057d3a9 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100agent-oversight
    Adds runtime oversight to an AI agent so it cannot do more than its AI_GOVERNANCE.md allows - default-deny tool access, amount and call limits, human approval for risky actions, spend limits, a kill switch, prompt-injection trust boundaries and a decision log - using the…
  • 95clawmetry-selfcheck
    Read your own agent telemetry from ClawMetry (waste, progress, cost) and act on it before finishing a task. Use when ClawMetry is installed on this machine and you want to check whether you are re-reading files, spinning in loops, or burning budget.
  • 100bootstrap-system-md
    Explore a codebase and generate its first SYSTEM.md, a single tool-agnostic living reference any coding agent (Claude Code, Codex, Cursor, Aider, Gemini CLI) reads before working on the repo, or upgrade an existing SYSTEM.md to the current contract. Use when the user asks to…
  • 90handoff
    Keep a handoff file so another coding agent (Claude Code, Codex, Kimi Code, Gemini CLI, Cursor) or a later session can continue this task without re-explaining. Use when the user asks to start, update or resume a handoff, says they will switch agents, when…
  • 100end-to-end-kill-switch-audit
    Use when verifying that a kill switch or send cap works link by link across a multi-process chain, instead of trusting an aggregate counter that did not move.
  • 10014-ai-agent-architecture-spec
    Use when an approved tool-using AI agent needs a runtime loop, state machine, memory tiers, planner, dispatcher, durability, kill switch and tenant isolation; use AI architecture for non-agent AI services and multi-agent coordination only when several agents share a task.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.