chakshu

agent
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 6 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Local-first observability, security guardrails, token & cost intelligence dashboard for AI coding agents (Codex, Claude Code, Gemini CLI, Antigravity).

README.md

Chakshu Logo

Chakshu (चक्षु)

Sanskrit for "eye": a guardian eye for your AI agents.

Chakshu is a local-first observability and security monitoring tool for AI coding agents (Codex, Claude Code, Gemini CLI / Antigravity, Cursor IDE, etc.). It watches what your AI agents actually did: which tools they called, which skills they used, how long operations took, real token consumption & costs, and whether dangerous or sensitive commands were attempted.

It works with any agent that leaves a session log on disk, with zero configuration required per agent.

Status: Local observability daemon, terminal monitor, security audit engine, policy engine, incident management, emergency agent process controls, REST API, and Next.js web dashboard.


Why

Coding agents run dozens of tool calls and shell commands autonomously on your machine. Afterwards, it's hard to answer basic questions:

  • What did it just execute and what output did it produce?
  • Did it touch sensitive files (.env, SSH keys) or execute dangerous operations (rm -rf, git reset --hard)?
  • How many tokens were consumed and what was the estimated API cost?
  • How much active tool execution latency did the session consume?
  • Which sessions are currently active and in flight?

Chakshu records and audits this in one secure, local place.


Design Principles

  • Not a proxy. Chakshu never sits between your agent and anything else. It only reads what the agent already writes to disk.
  • Agent-agnostic, zero config. Each supported agent has a lightweight adapter that knows where its transcripts live and how to parse them.
  • Privacy-first & local only. Everything stays in a local SQLite file (~/.chakshu/chakshu.db). Nothing is sent to any remote server.
  • Guardian security audit. Actively analyzes tool invocations for security anomalies, sensitive file access, and destructive commands.
  • Real token consumption & cost tracking. Tracks precise prompt and completion tokens parsed from agent APIs, with blended pricing models per agent.
  • Lightweight & single-binary. Core backend is written in pure Go with zero CGO and zero external runtime dependencies. The web UI is compiled into production static assets and embedded directly into the Go binary.

Features

  • Session Cockpit: Inspect full session chronology, auto-generated titles from user prompts, active in-flight status indicators, session reliability scores (0–100 clean | moderate | fragile), parallel batch grouping, and total duration.
  • Cross-Agent Full-Text Search: Instant SQLite FTS5 search across all tool calls, commands, inputs, and outputs via chakshu search or Cmd+K / Ctrl+K in the Web UI.
  • Session Model-Wise Analysis: Dedicated breakdown of all LLM models used within a session (call share %, prompt/completion tokens, duration, and subtotal cost per model).
  • Execution Trace: Step-by-step accordion with duration badges, model tags, exit codes, unwrapped command previews, and one-click copy for payloads and terminal outputs.
  • Token & Cost Intelligence: Measures real input_tokens and output_tokens directly from assistant API logs, displaying prompt vs completion breakdown, API-measured vs estimated badges, and model-specific API pricing.
  • Agent Memory Analytics & Decision Ledger: Comprehensive 3-tier memory observability: working context window saturation gauge, remaining turns to exhaustion forecast, turn-by-turn growth curve, context bloat hotspots, persistent knowledge memory bank cataloging (AGENTS.md, CLAUDE.md, .cursorrules, etc.), extracted Decision & Constraint Ledger (chakshu decisions, Pin/Verify/Dismiss), Global Memory view (#/memory), continuous prompt token tax calculation, and real-time OS process RAM (RSS & %MEM).
  • Cross-Agent Local MCP Memory Server: Zero-dependency stdio JSON-RPC 2.0 MCP server (chakshu mcp-memory) exposing search_decisions, get_file_context, search_sessions, and record_constraint to Claude Code, Cursor, Codex, and Gemini.
  • Pre-Execution File Snapshots & Rollback: Content-addressed pre-edit file backups via chakshu snapshot-hook, interactive CLI chakshu rollback, and one-click rollback in the Session Files view.
  • Runaway Loop & Token Burn Guardrails: Real-time sliding-window retry-loop and token-spike detector with live Web UI alert banners and CLI tail/logs -f warnings.
  • Human Approval & Intervention Tracking: Passive observability into when agents request permission, what operation requires approval, why permission is required, human decisions & approval latency, post-decision execution outcomes, independent risk classification, session-level approval timelines, and cross-session approval analytics. See Approval Tracking Docs.
  • Safety & Security Audit: Real-time anomaly detection for destructive shell commands, credential leaks, remote script execution (curl | bash), path traversal, runtime policy evaluation, SHA-256 hash-chained security_events, and MCP config pinning/drift detection.
  • Skill Intelligence & Benchmarking: Content-addressed skill revision tracking (SKILL.md + companion files), repeatable Benchmark Studio with built-in templates & YAML/JSON import/export, 1-click evaluation of observed agent sessions (chakshu-eval-v1.0), headless CI regression gate (chakshu eval --ci), human reviews, paired version/baseline comparison, regression detection, improvement insights, and an optional consent-gated LLM-as-a-Judge (agy, claude, codex, gemini local CLIs or Ollama/OpenAI/Anthropic/Gemini APIs). See Skill Intelligence Docs.
  • MCP & Skill Auditing: Catalog local MCP server configurations and agent skills, including credential, package, integrity, and prompt injection findings.
  • Installed Plugin Store: Passive multi-agent plugin discovery (Antigravity, Claude Code, Gemini CLI, Cursor), bundle capability inspection (Skills, Rules, MCP, Hooks), static audit for dangerous hooks, and interactive App-Store dashboard.
  • Policy & Incident Response: Evaluate activity against security policies, track incidents, inspect agent processes, and use validated terminate/kill/pause/resume controls.
  • Scoped vs Global Metrics: Toggle between single-session deep dive KPIs and global system rollups with the "Reset to All Sessions" control.
  • Client-Side Hash Routing: Deep-link support (#/sessions/:id/:subtab, #/calls, #/memory, #/skills/:tab, #/approvals, #/audit, #/plugins) that survives page reloads on static file servers.
  • Theme Support: Seamless Dark Mode and Light Mode with system preference detection and localStorage persistence.
  • Pause-on-Blur: Automatically suspends polling when the browser tab is hidden to conserve CPU and battery.

Install

Requires Go 1.22 or newer.

git clone <your-repo-url> chakshu
cd chakshu
go build -o chakshu ./cmd/chakshu

Usage

1. Start the Background Watcher Daemon

./chakshu daemon

Scans agent transcripts continuously (polling once a second), records new tool calls, and remembers byte offsets transactionally so restarts pick up where they left off.

To stop the daemon cleanly from any terminal:

./chakshu stop

To clear recorded calls and reset file offsets:

./chakshu reset --yes

2. Inspect & Query Activity (CLI)

# Formatted tool calls with status, duration, unwrapped cmd & short session ID
./chakshu logs 20

# Live follow mode (streams events in real time, like tail -f)
./chakshu logs -f
./chakshu tail --session #ab12cd34

# Filter logs by status, agent, or short session ID
./chakshu logs --status fail
./chakshu logs --agent codex
./chakshu logs --session #ab12cd34
./chakshu logs --full                     # disable payload terminal truncation

# Full-text search across tool calls, commands, inputs, and outputs (FTS5)
./chakshu search "npm test" --agent claude-code

# Grouped counts
./chakshu count                           # total calls grouped by tool (default)
./chakshu count --by session              # calls per session
./chakshu count --by agent                # calls per agent
./chakshu count --by kind                 # tools vs skills

3. Observability Analytics & Security Audit

# Session and agent performance overview (latency, failure rate, active time, tokens)
./chakshu stats
./chakshu stats --session #ab12cd34

# Agent Memory Observability: analyze context window saturation, bloat hotspots & memory bank tax
./chakshu memory
./chakshu memory --session #ab12cd34

# Decision & Constraint Ledger: list, pin, verify, or dismiss extracted decisions
./chakshu decisions
./chakshu decisions --type constraint --pin <memory-id>

# Run local stdio MCP memory server for Claude Code, Cursor, Codex & Gemini
./chakshu mcp-memory

# Headless Skill Evaluation CI Gate
./chakshu eval --ci --min-score 70

# Pre-execution file snapshots & rollback
./chakshu rollback --list
./chakshu rollback <call-id>

# Human Approval & Intervention Tracking: inspect permission requests, human decisions & risk levels
./chakshu approvals
./chakshu approvals --session #ab12cd34 --risk HIGH

# Security audit: inspect commands for destructive ops, .env/key leaks, reverse shells
./chakshu audit
./chakshu audit --level high

# Passive MCP Security: audit MCP manifests, unpinned packages & exposed credentials
./chakshu audit-mcp

# Skills Supply-Chain: verify SKILL.md SHA-256 hashes & prompt-injection directives
./chakshu audit-skills

# Installed Plugin Store: catalog installed agent plugins and bundle capabilities
./chakshu plugins

# Audit Plugins: verify plugin hooks, credentials, and cryptographic integrity
./chakshu audit-plugins

# List tracked incidents and discover running agent processes
./chakshu incidents
./chakshu ps

# Emergency process controls (PID must validate as an agent)
./chakshu kill <pid> [terminate|kill|pause|resume]

4. Historical Ingestion & Export

# Backfill and import past session files or folders directly
./chakshu import ~/.codex/sessions/
./chakshu import /path/to/transcript.jsonl --agent codex

# Export telemetry to structured JSON or CSV
./chakshu export --format json > telemetry.json
./chakshu export --format csv > telemetry.csv

5. Web Dashboard (UI)

Chakshu includes an embedded single-binary web dashboard served locally:

# Launch local web dashboard (http://127.0.0.1:8080)
./chakshu ui
./chakshu ui --port 9090

Developing the Next.js Frontend (web/):

cd web
npm install
npm run dev        # hot-reloading dev server on http://localhost:3000
npm run build      # compiles static export to web/out and copies to internal/ui/dist

Supported Agents

Agent Source Read Capabilities Status
Codex ~/.codex/sessions/**/rollout-*.jsonl Tool calls, skill reads, user prompts, agent chat Implemented
Claude Code ~/.claude/projects/*/*.jsonl Assistant tool blocks, token usage (input_tokens, output_tokens), chat turns Implemented
Gemini CLI / Antigravity ~/.gemini/antigravity-cli/brain/**/*.jsonl Planner tool calls, step outputs, turn token attribution Implemented
Cursor IDE ~/.cursor/{projects,chats,sessions}/**/*.jsonl Agent/composer tool calls, subagent transcripts, token usage Implemented

Project Layout

cmd/chakshu/          CLI entry point & eval CI gate (main.go, eval_ci.go)
internal/
  ├── adapter/        per-agent transcript parsers (Codex, Claude Code, Gemini CLI, Cursor)
  ├── approval/       passive approval extraction, correlation engine, risk classification & analytics
  ├── audit/          security and safety risk detection and SHA-256 event chaining
  ├── evaluation/     skill intelligence, benchmarks, deterministic rules, scoring, comparisons & judge
  ├── incident/       incident lifecycle, agent process discovery, and kill switch
  ├── mcp/            local MCP configuration discovery, SHA-256 pinning, and auditing
  ├── mcpserver/      stdio JSON-RPC 2.0 MCP memory server (chakshu mcp-memory)
  ├── memory/         3-tier memory engine, context analytics, decision ledger & conflict reconciliation
  ├── plugin/         installed agent plugin discovery and supply-chain auditing
  ├── policy/         security policy schema and runtime evaluation engine
  ├── skill/          local agent skill catalog and security auditing
  ├── snapshot/       content-addressed pre-execution file snapshots and rollback
  ├── event/          ToolCall, SecurityEvent, and ApprovalEvent record definitions
  ├── exporter/       structured JSON and CSV export logic
  ├── formatter/      unwrapping, home-collapsing, short IDs, aligned column formatter
  ├── importer/       retroactive log ingestion engine
  ├── pidfile/        pid file lifecycle and single-instance locks
  ├── stats/          telemetry metrics, reliability scoring, latency analytics, and cost calculations
  ├── store/          SQLite persistence (FTS5, real token columns, snapshots, decisions, offset checkpointing)
  ├── ui/             embedded dashboard HTTP server and REST API
  └── watcher/        incremental transcript tailing & runaway-loop/token-burn guardrails
web/                  Next.js + TypeScript + Tailwind web dashboard
  ├── app/            pages, layout, and global CSS design system (dark/light themes)
  ├── components/     Header, MetricsBar, SessionList, SessionDetail, TraceList, CallsTable, GlobalMemoryView, MemoryDetailView, ApprovalsAnalyticsView, SessionApprovalsView, AuditView, PluginStoreView, GlobalSearchModal, CallModal, skills/
  └── lib/            API client, TypeScript types, formatters, and client hash router

Roadmap

  • Unwrapped command extraction & quote normalization
  • Collision-resolving UUIDv7 short session IDs (#ab12cd34)
  • Home directory path collapsing (~)
  • Terminal-width responsive formatting & NO_COLOR support
  • Real-time event streaming (chakshu logs -f / chakshu tail)
  • Security & safety audit engine (chakshu audit)
  • Telemetry analytics & failure metrics (chakshu stats)
  • Retroactive log importer (chakshu import)
  • JSON and CSV export (chakshu export)
  • Gemini CLI / Antigravity transcript adapter
  • Token consumption tracking & blended cost estimations
  • Auto-generated session titles from user prompts
  • Active session detection with 5-minute calibration
  • Next.js + React web dashboard with embedded static distribution (chakshu ui)
  • Client-side hash routing (#/sessions/:id/:subtab, #/calls, #/memory, #/skills/:tab, #/approvals, #/audit, #/plugins) & deep link sharing
  • Scoped vs Global KPI metrics switcher
  • Per-call model tracking & session-level model-wise telemetry analysis
  • Dark and Light theme toggle
  • Installed Plugin Store & Supply-Chain Discovery Catalog
  • Pre-execution file snapshots (chakshu snapshot-hook) & rollback (chakshu rollback)
  • Cursor IDE transcript adapter (internal/adapter/cursor.go)
  • Cross-agent FTS5 full-text search (chakshu search, Cmd+K modal)
  • Decision & Constraint Ledger (chakshu decisions) and local MCP memory server (chakshu mcp-memory)
  • Skill Intelligence, Benchmarking & Headless CI Gate (chakshu eval --ci)

See ROADMAP.md for upcoming milestones (Aider/Windsurf/Copilot adapters, active interception, and sandboxing).


Documentation & Community


License

MIT License. See LICENSE for details.

Reviews (0)

No results found