claude-baton: Agent for Claude Code

.claude/agents/cli.md

cli is an agent for Claude Code from bakabaka91/claude-baton. It costs 18 tokens per session (447 once invoked), scanned B, original, MIT.

A command-line interface for managing Claude Baton, including setup, status, search, project listing, data export, and import. It also defines how the program starts and handles terminal input.

In plain words
What is it for?
Use it to build or maintain terminal commands for setting up storage, searching saved memories, checking project data, and moving memory data as JSON.
Why use it?
It gives the tool a consistent way to run commands and exchange data from a terminal. Safety rules reduce accidental data deletion and invalid imports.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is bakabaka91/claude-baton's own configuration. It tells Claude Code how to work on claude-baton itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-baton configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import('../dist/cli.js');.

Reuse

Borrowing it

Nothing to install: this file belongs to bakabaka91/claude-baton. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/bakabaka91/claude-baton/main/.claude/agents/cli.md
Clone the repo
git clone --depth 1 https://github.com/bakabaka91/claude-baton

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cli

README.md
[![agentmods](https://agentmods.dev/badge/agents/bakabaka91/claude-baton/cli/github.svg)](https://agentmods.dev/agents/bakabaka91/claude-baton/cli)
Your own site
<a href="https://agentmods.dev/agents/bakabaka91/claude-baton/cli"><img src="https://agentmods.dev/badge/agents/bakabaka91/claude-baton/cli/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cli

Your own site · 80×15
<a href="https://agentmods.dev/agents/bakabaka91/claude-baton/cli"><img src="https://agentmods.dev/badge/agents/bakabaka91/claude-baton/cli.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 447 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.00447
Opus 5.5 $0.00007 $0.00179
Sonnet 5.5 $0.00004 $0.00089
Haiku 4.5 $0.00002 $0.00045

Measured 1mo ago against content hash 8afe8b91af5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

cli scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

1. `claude-baton setup` — create ~/.claude-baton/, init SQLite, configure hooks in ~/.claude/settings.json
.claude/agents/cli.md · 47 lines

What it actually says

CLI Agent

You own the command-line interface and the bin entry point.

Files you own

  • src/cli.ts — All CLI commands using commander.js
  • bin/claude-baton.js — CLI entry point (shebang + import)

Before writing any code

Load this skill:

  1. Read .claude/skills/sql-js-patterns.md (for setup/reset commands that touch the store)

Key rules

  • Use commander for CLI framework — no custom arg parsing
  • All commands use async handlers (.action(async () => {}))
  • Output should be clean, human-readable, no unnecessary decoration
  • setup command must be idempotent — safe to run multiple times
  • reset command must require --confirm flag before deleting data
  • export outputs valid JSON to stdout (pipeable)
  • import validates JSON schema before inserting

Commands (7)

  1. claude-baton setup — create ~/.claude-baton/, init SQLite, configure hooks in ~/.claude/settings.json
  2. claude-baton status — memory counts by type/project, last extraction time, db file size
  3. claude-baton search <query> — full-text search across all memory types, show results with project context
  4. claude-baton projects — list all tracked project paths with memory counts
  5. claude-baton export [project] — export all memories (or project-scoped) as JSON to stdout
  6. claude-baton import <file> — import memories from JSON file, validate schema, skip duplicates
  7. claude-baton reset [project] — clear memories for a project (or all), requires --confirm flag

bin entry point

#!/usr/bin/env node
import('../dist/cli.js');
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 47 lines · 18 tokens per session scan B 8afe8b91af5e

Subscribe to this mod's changes

cli is an agent published in the GitHub repository bakabaka91/claude-baton (25 stars, last pushed 6mo ago), licensed MIT. It adds 18 tokens to every session and 447 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.