TokenPolice shows what every user, plan, session and workflow costs your AI product, and caps it before the next LLM call. This repository holds the skills that let your coding agent do the SDK integration for you.
| Skill | What it does |
|---|---|
token-police-sdk |
Integrates the TokenPolice SDK (Python or Node.js) into your app. It reads your code, asks you a few questions, shows you a plan, wires the SDK, and proves the integration works. You write no integration code. |
Claude Code
claude plugin marketplace add tokenpolice/skills
claude plugin install tokenpolice@tokenpoliceThe skill loads the next time you start Claude Code. If a session is already open in another terminal, run
/reload-plugins there. No GitHub SSH key on this machine? Set CLAUDE_CODE_PLUGIN_PREFER_HTTPS=1 for both
commands (export it, or prefix each) — Claude Code clones owner/repo marketplaces over SSH by default.
Cursor, GitHub Copilot, OpenAI Codex, Google Antigravity
npx skills add tokenpolice/skills -yRun it at the root of your repo. It writes the skill to .agents/skills/token-police-sdk/ plus a
skills-lock.json at the repo root, and — depending on which agents it detects on your machine — a symlink
to it from that agent's own folder, such as .claude/skills/token-police-sdk. Commit everything it reports;
the lock file is designed to be checked in. Drop -y and it prompts for scope (Project, or Global — under
your home directory instead of the repo) and lets you pick agents when it cannot tell which one you use.
skills is a third-party CLI by Vercel Labs; set
DISABLE_TELEMETRY=1 to opt out of its usage telemetry.
Manual (any agent)
Run at the root of your repo:
mkdir -p .agents/skills
curl -fsSL https://github.com/tokenpolice/skills/archive/refs/heads/main.tar.gz \
| tar -xzf - -C .agents/skills --strip-components=2 skills-main/skills/token-police-sdkFor Claude Code use .claude/skills in both lines.
You need a TokenPolice API key (a show-once tp_sk_… key from
app.tokenpolice.ai/keys). Then, in your project, tell the agent:
Integrate TokenPolice into this app.
The agent reads your repo, finds your LLM calls and where your user, plan and session values live, asks for your API key, and shows you a plan. It changes nothing until you say yes. It wires the SDK in dry-run mode by default (nothing is blocked until you choose to enforce), you run your app once, and it checks that TokenPolice received the data. Walkthrough: tokenpolice.ai/docs/get-started/coding-agent/walkthrough.
- Claude Code:
claude plugin marketplace update tokenpolice && claude plugin update tokenpolice@tokenpolice npx skills:npx skills update token-police-sdk -y- Manual: run the manual commands again.
.claude-plugin/— the Claude Code plugin marketplace and plugin manifest (plugintokenpolice).skills/<name>/— one folder per skill in the Agent Skills format:SKILL.mdplus areferences/folder the skill links to. Copy the whole folder, not justSKILL.md.
Issues and pull requests are welcome; see CONTRIBUTING.md. Security reports: SECURITY.md.
Apache-2.0. See LICENSE.