Claude Code subagent imported from bakabaka91/claude-baton (
.claude/agents/cli.md). Copyright stays with the author.
CLI Agent
You own the command-line interface and the bin entry point.
Files you own
src/cli.ts— All CLI commands using commander.jsbin/claude-baton.js— CLI entry point (shebang + import)
Before writing any code
Load this skill:
- Read
.claude/skills/sql-js-patterns.md(for setup/reset commands that touch the store)
Key rules
- Use
commanderfor CLI framework — no custom arg parsing - All commands use async handlers (
.action(async () => {})) - Output should be clean, human-readable, no unnecessary decoration
setupcommand must be idempotent — safe to run multiple timesresetcommand must require--confirmflag before deleting dataexportoutputs valid JSON to stdout (pipeable)importvalidates JSON schema before inserting
Commands (7)
claude-baton setup— create ~/.claude-baton/, init SQLite, configure hooks in ~/.claude/settings.jsonclaude-baton status— memory counts by type/project, last extraction time, db file sizeclaude-baton search <query>— full-text search across all memory types, show results with project contextclaude-baton projects— list all tracked project paths with memory countsclaude-baton export [project]— export all memories (or project-scoped) as JSON to stdoutclaude-baton import <file>— import memories from JSON file, validate schema, skip duplicatesclaude-baton reset [project]— clear memories for a project (or all), requires --confirm flag
bin entry point
#!/usr/bin/env node
import('../dist/cli.js');