cli

CLI agent for src/cli.ts and bin/ — commander.js CLI commands and entry point.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/bakabaka91/claude-baton/cli
Clone the repo
git clone --depth 1 https://github.com/bakabaka91/claude-baton

Made for: Claude Code.

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. Scan, not verified.
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 $0.00018 $0.00447
Opus 5 $0.00009 $0.00224
Sonnet 5 $0.00004 $0.00089
Haiku 4.5 $0.00002 $0.00045

Measured yesterday against content hash 8afe8b91af5e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 yesterday.

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. yesterday 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 5mo ago), licensed MIT. It adds 18 tokens to every session and 447 once invoked, about $0.0001 per session on Opus 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.