Skip to content

Chakshu CLI Reference

Chakshu provides a single-binary command-line interface (chakshu) for running the background transcript watcher, querying agent activity, auditing security and supply-chain risks, analyzing memory usage, managing incidents, and launching the embedded web dashboard.


Global Behavior & Environment Variables

Variable Effect Default
CHAKSHU_DB Override the SQLite database file path ~/.chakshu/chakshu.db
CHAKSHU_SNAPSHOT_DIR Override the directory for content-addressed pre-execution file snapshots ~/.chakshu/snapshots
NO_COLOR Disable ANSI color codes in terminal output Unset (colors enabled)
COLUMNS Override detected terminal width for row truncation Auto-detected TTY width
TERM=dumb Disable styled banner formatting Auto-detected

Short Session IDs (#ab12cd34)

Chakshu assigns collision-resolving short session IDs (8 hex characters prefixed with #, e.g., #ab12cd34). Any command accepting --session ID matches both full session UUIDs/IDs and short session IDs.

Terminal Formatting (internal/formatter)

Log tables automatically: - Unwrap shell command wrappers (bash -lc, zsh -c, etc.) to show the underlying command. - Collapse home directory paths to ~. - Truncate long payloads to fit the terminal width (override with --full or --wide).


Command Reference

Lifecycle Commands

chakshu start [flags]

Starts all background monitoring features and the embedded web UI dashboard in a single process: acquires the single-instance PID lock (~/.chakshu/), backfills tracked approvals, watches all registered agent transcript directories, runs passive agent network polling (10s interval), and serves the local web dashboard.

Flag Description Default
--host Host address to bind 127.0.0.1
--port TCP port to listen on 7777
--no-network Disable passive read-only agent network call polling false
chakshu start
chakshu start --port 9090
chakshu start --no-network

Handles SIGINT and SIGTERM gracefully, shutting down the HTTP server and waiting for in-flight SQLite writes to finish before exiting.

chakshu daemon [--network]

Starts the foreground/background transcript watcher daemon. Acquires a single-instance PID lock (~/.chakshu/), backfills tracked approvals, and polls all registered agent transcript directories (Codex, Claude Code, Gemini CLI / Antigravity, Cursor IDE) every 1 second using transactional byte-offset checkpointing. Also evaluates incoming tool calls against internal/policy, chains violations into security_events, and runs runaway-loop/token-burn guardrails.

Flag Description Default
--network Enable passive read-only agent network call polling false
chakshu daemon
chakshu daemon --network

Handles SIGINT and SIGTERM gracefully, waiting for in-flight SQLite writes to finish before exiting.

chakshu stop

Sends a clean termination signal to the running chakshu daemon using its PID file.

chakshu stop

chakshu reset [--yes] [--from-now]

Clears recorded tool calls and resets transcript file offsets in SQLite. Requires the daemon to be stopped first (chakshu stop).

Flag Description Default
--yes Skip interactive confirmation prompt false
--from-now Fast-forward all transcript offsets to their current EOF so only future events are recorded false
chakshu reset --yes
chakshu reset --yes --from-now

Activity Inspection Commands

chakshu logs [N] [flags]

Displays formatted tool calls and skill invocations.

Flag / Argument Description Default
[N] / --limit N Number of recent calls to display 20
-f, --follow Stream new events in real time (1-second poll) false
--session ID Filter by full or short session ID All sessions
--agent NAME Filter by agent name (case-insensitive, e.g., codex, claude-code, gemini, cursor) All agents
--status STATUS Filter by resolved status: ok (success), fail (failed, error), pending, stale All statuses
--full, --wide Disable payload truncation false
--details Append working directory (CWD) and cleaned output preview false
chakshu logs 50
chakshu logs --status fail --agent codex
chakshu logs --session #ab12cd34 --details --full
chakshu logs -f

chakshu search <query> [flags]

Performs full-text search across recorded tool calls, commands, inputs, and outputs using SQLite FTS5 (tool_calls_fts).

Flag Description Default
--limit N Maximum number of results 25
--session ID Filter by full or short session ID All sessions
--agent NAME Filter by agent name All agents
--kind KIND Filter by call kind (tool, skill) All kinds
--full Disable payload truncation false
chakshu search "npm test"
chakshu search "migration" --agent claude-code --limit 50

chakshu tail [flags]

Streams incoming tool calls in real time (dedicated live-follow mode).

Flag Description Default
--session ID Filter stream by full or short session ID All sessions
--agent NAME Filter stream by agent name All agents
--full Disable payload truncation false
chakshu tail --session #ab12cd34

chakshu count [--by dimension]

Displays grouped call counts and a TOTAL row.

Flag Values Default
--by tool, session, agent, kind tool
chakshu count
chakshu count --by session
chakshu count --by agent
chakshu count --by kind

Observability & Analytics Commands

chakshu stats [flags]

Computes and prints session and agent telemetry: call volume, failure rate, latency distributions, active time, and token/cost breakdowns.

Flag Description Default
--limit N Number of recent calls to analyze 500
--session ID Filter by session ID All sessions
--agent NAME Filter by agent name All agents
chakshu stats
chakshu stats --session #ab12cd34

chakshu memory [--session ID]

Runs the 3-tier Agent Memory Analytics report (see Agent Memory & Context Analytics): 1. Persistent Knowledge & Rule Memories: Scans workspace and user rule files (AGENTS.md, CLAUDE.md, .cursorrules, etc.), reports token counts, $/100 turns token tax, audit status, and cross-memory conflicts. 2. Working Context Window: Analyzes the specified --session (or most recent session) for model capacity, saturation percentage, turns to exhaustion, compaction events, context composition, and bloat hotspots. 3. Agent OS Process Memory (RAM): Lists active agent processes with RSS and VSZ memory usage.

chakshu memory
chakshu memory --session #ab12cd34

chakshu decisions [flags]

Lists and manages extracted Decisions, Constraints, Workarounds, and Dead Ends from the Decision & Constraint Ledger (session_memories).

Flag Description Default
--session ID Filter by session ID All sessions
--type TYPE Filter by memory type: all, constraint, decision, workaround, dead_end all
--state STATE Filter by user state: all, pinned, verified, unreviewed, dismissed all
--limit N Maximum number of entries to display 50
--pin ID Pin a memory ID —
--verify ID Mark a memory ID as verified —
--dismiss ID Dismiss a memory ID —
chakshu decisions
chakshu decisions --type constraint --state unreviewed
chakshu decisions --pin <memory-id>

chakshu mcp-memory

Runs a local, zero-dependency stdio JSON-RPC 2.0 MCP server (chakshu-memory) exposing search_decisions, get_file_context, search_sessions, and record_constraint to Claude Code, Cursor, Codex, and Gemini.

chakshu mcp-memory

chakshu eval [flags]

Runs headless skill/rule evaluation and regression CI gating against recorded executions or a benchmark suite.

Flag Description Default
--suite ID Optional benchmark suite ID to execute All suites / recent executions
--min-score N Minimum passing average score (0–100) 70.0
--ci Exit non-zero if regressions or suite failures are detected false
--json Print machine-readable JSON result false
chakshu eval --ci --min-score 75
chakshu eval --suite suite-code-review --json

chakshu rollback [<call-id>] [flags]

Restores a modified file from a pre-execution content-addressed snapshot captured by chakshu snapshot-hook.

Flag / Argument Description Default
<call-id> Tool call ID whose pre-edit snapshot to restore Required unless --list
--list List captured snapshots without restoring false
--session ID Filter listed snapshots by session ID All sessions
chakshu rollback --list
chakshu rollback <call-id>

chakshu snapshot-hook

Reads PreToolUse JSON from stdin and captures a content-addressed pre-edit file snapshot in ~/.chakshu/ and file_snapshots. Intended for agent pre-tool lifecycle hooks.

chakshu snapshot-hook < pre_tool_use.json

chakshu approvals [flags]

Lists passively observed human-in-the-loop approval requests, decisions, execution outcomes, and risk classifications (see Human Approval & Intervention Tracking).

Flag Description Default
--session ID Filter by full or short session ID All sessions
--agent NAME Filter by agent name All agents
--risk LEVEL Filter by risk level: INFO, LOW, MEDIUM, HIGH, CRITICAL All levels
--decision DEC Filter by decision: APPROVED, REJECTED, PENDING, CANCELLED, TIMED_OUT, EXPIRED All decisions
--category CAT Filter by action category (TERMINAL_SHELL, FILESYSTEM, GIT, MCP_TOOL, NETWORK, INFRASTRUCTURE_DB, AGENT_PERMISSIONS) All categories
--limit N Maximum approval events to display 50
--scan Force a backfill scan across all tracked transcripts false
chakshu approvals --risk HIGH
chakshu approvals --session #ab12cd34 --scan

Security, Supply-Chain & Incident Response Commands

chakshu audit [flags]

Inspects recorded tool calls for security and safety anomalies (see Security Audit, Policy & Incident Response).

Flag Description Default
--limit N Number of recent calls to inspect 200
--session ID Filter by session ID All sessions
--agent NAME Filter by agent name All agents
--level LEVEL Filter by exact highest risk level: low, medium, high, critical All levels
chakshu audit
chakshu audit --level critical

chakshu audit-mcp

Scans the current working directory and standard agent paths for MCP server configurations, reporting trust status (VERIFIED, FLAGGED, UNTRUSTED) and detected environment secrets (see Supply-Chain Auditing).

chakshu audit-skills

Scans local skill packages (SKILL.md and companion files), computes SHA-256 integrity hashes, and flags prompt-injection indicators (see Supply-Chain Auditing).

chakshu plugins

Catalogs installed AI agent plugins across Antigravity, Claude Code, Gemini CLI, Cursor, and workspace environments, showing version, enabled state, trust status, and bundled Skills/MCP/Hooks counts.

chakshu audit-plugins

Audits installed plugins for dangerous lifecycle hooks, exposed credentials, and prompt-injection vectors, displaying SHA-256 manifest fingerprints.

chakshu incidents

Lists active (OPEN) and RESOLVED security incidents (up to 50). If no incidents exist yet, automatically ingests HIGH and CRITICAL findings from recent tool calls.

chakshu ps

Discovers running AI coding agent processes on the host (Claude, Codex, Gemini), displaying PID, process name, RSS RAM (MB), memory status, and command preview.

chakshu kill <pid> [action] [--force]

Emergency process control for runaway or compromised AI agent processes.

Argument / Flag Values Default
<pid> Positive integer process ID Required
[action] terminate (SIGTERM), kill (SIGKILL), pause (SIGSTOP), resume (SIGCONT) terminate
--force, -f Bypass agent-identity PID validation (use with caution) false

By default, Chakshu validates that <pid> belongs to a known AI agent process before sending any OS signal.


Data Ingestion, Export & Web UI Commands

chakshu import <path> [--agent NAME]

Retroactively ingests a single transcript file or an entire directory of historical agent logs into SQLite in batch commits.

Flag Description Default
--agent NAME Restrict ingestion to a specific agent adapter Auto-detect all adapters
chakshu import ~/.codex/sessions/
chakshu import /path/to/rollout.jsonl --agent codex

chakshu export [flags]

Exports recorded tool calls to stdout in structured JSON or CSV format.

Flag Description Default
--format Output format: json or csv json
--limit N Maximum recent calls to export 1000
--session ID Filter by session ID All sessions
--agent NAME Filter by agent name All agents
chakshu export --format json > telemetry.json
chakshu export --format csv --agent claude-code > claude_calls.csv

chakshu ui [flags]

Starts the embedded Next.js web observability dashboard and local REST API server (see Web Dashboard Guide).

Flag Description Default
--host Host address to bind 127.0.0.1
--port TCP port to listen on 7777
chakshu ui
chakshu ui --port 9090