Skip to content
Projects

About

Local-first AI agent observability, security audit, and HITL approval dashboard for Claude Code, Codex, Cursor, and Gemini │ CLI. Single Go binary with embedded web UI, MCP & skill supply-chain auditing, memory telemetry, and skill benchmarking.

Developer Tools

How these counts are measured

Measured star growth

in 24h
Collecting history
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Chakshu Logo

Chakshu (चक्षु)

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

CI License: MIT Go Version

Chakshu is a local-first, single-binary observability and security monitoring platform for AI coding agents (Codex, Claude Code, Gemini CLI / Antigravity, Cursor IDE). It passively watches what your AI agents actually do—every tool call, skill invocation, shell command, token/cost breakdown, network connection, memory footprint, and security risk—without sitting in the middle as a proxy.

Zero config per agent. Zero CGO. 100% local SQLite (~/.chakshu/chakshu.db).


Quick Start

git clone https://github.com/qdevmahesh/chakshu.git
cd chakshu
go build -o chakshu ./cmd/chakshu

# Start transcript watchers, network monitoring, and the web dashboard in one command
./chakshu start

Open http://127.0.0.1:7777 in your browser. Press Ctrl+C or run ./chakshu stop from another terminal to stop cleanly.


Why Chakshu?

Autonomous coding agents execute dozens of tool calls and shell commands on your machine. Afterwards, it's hard to answer basic questions:

  • What did the agent just execute, and what output did it produce?
  • Did it touch sensitive files (.env, SSH keys), run destructive commands (rm -rf, git reset --hard), or leak credentials?
  • How many tokens and dollars did each model consume?
  • Is an agent stuck in a retry loop, burning context, or spiking outbound network traffic?
  • When did it ask for human approval, and what happened next?

Chakshu records, correlates, and audits all of this in one local place.


Design Principles

  • Not a proxy. Chakshu never intercepts or proxies agent traffic—it only reads transcripts and OS process/socket state locally.
  • Agent-agnostic, zero config. Lightweight adapters auto-discover logs for Codex, Claude Code, Gemini CLI / Antigravity, and Cursor IDE.
  • Privacy-first & local only. Everything is stored in ~/.chakshu/chakshu.db; nothing leaves your machine.
  • Single-binary simplicity. Pure Go backend (zero CGO via modernc.org/sqlite) with the Next.js web UI embedded directly inside the binary.

Features

Observability & Telemetry

  • Session Cockpit: Chronological session timeline, auto-generated prompt titles, active in-flight indicators, session reliability scores (0–100 clean | moderate | fragile), parallel batch grouping, and duration tracking.
  • Execution Trace & FTS5 Search: Step-by-step accordion with unwrapped commands, exit codes, duration badges, and instant full-text search via chakshu search or Cmd+K / Ctrl+K.
  • Model-Wise Token & Cost Intelligence: Parses exact input_tokens and output_tokens from API logs with per-model call share, latency, and estimated API cost.
  • Agent-Only Network Attribution: Passive inspection of AI agent and child/MCP process connections, endpoint provider classification, and upload-spike detection (chakshu network).

Security, Guardrails & Approvals

  • Safety & Security Audit: Real-time detection of destructive commands, credential leaks, remote script execution (curl | bash), path traversal, policy violations, and SHA-256 hash-chained security_events.
  • Runaway Loop & Token Burn Guardrails: Sliding-window retry-loop and token-spike detector with live UI alert banners and CLI logs -f / tail warnings.
  • Human Approval & Intervention Tracking: Passive correlation of permission requests, risk classification, human decision latency, and post-decision outcomes (Approval Tracking Docs).
  • Pre-Execution Snapshots & Rollback: Content-addressed pre-edit backups (chakshu snapshot-hook), CLI chakshu rollback, and one-click UI file restoration.
  • Supply-Chain Auditing: Audits local MCP manifests (audit-mcp), skill packages & prompt-injection vectors (audit-skills), and installed multi-agent plugins (plugins, audit-plugins).
  • Process Discovery & Kill Switch: Inspect running agent processes (chakshu ps) and safely intervene (chakshu kill <pid> [terminate|kill|pause|resume]).

Agent Memory & MCP

  • 3-Tier Memory Analytics: Context window saturation gauge, remaining turns forecast, turn-by-turn growth curve, bloat hotspots, persistent memory bank cataloging (AGENTS.md, CLAUDE.md, .cursorrules), prompt token tax, and OS process RSS RAM.
  • Decision & Constraint Ledger: Extracts decisions, constraints, workarounds, and dead ends (chakshu decisions, Pin/Verify/Dismiss).
  • Local MCP Memory Server: Zero-dependency stdio JSON-RPC 2.0 server (chakshu mcp-memory) exposing search_decisions, get_file_context, search_sessions, and record_constraint to Claude Code, Cursor, Codex, and Gemini.

Skill Intelligence & Benchmarks

  • Skill Revision & Evaluation: Content-addressed SKILL.md tracking, Benchmark Studio with YAML/JSON import/export, 1-click deterministic session scoring (chakshu-eval-v1.0), headless CI regression gate (chakshu eval --ci), paired comparisons, and optional consent-gated LLM-as-a-Judge (Skill Intelligence Docs).

Web Dashboard

  • Embedded Next.js UI: Client-side hash routing (#/sessions/:id/:subtab, #/calls, #/memory, #/skills/:tab, #/approvals, #/audit, #/plugins), Dark/Light themes, scoped vs. global KPI toggle, and pause-on-blur polling conservation.

Usage

1. Start & Lifecycle

# Recommended: start watchers, network monitor, and UI together (http://127.0.0.1:7777)
./chakshu start
./chakshu start --port 9090          # custom UI port
./chakshu start --no-network         # disable passive network polling

# Or run components individually
./chakshu daemon [--network]         # headless transcript watcher (1s poll)
./chakshu ui [--host 127.0.0.1] [--port 7777]

# Stop cleanly from any terminal
./chakshu stop

# Clear recorded calls and reset offsets (--from-now skips historical logs)
./chakshu reset --yes

2. Inspect & Query Activity (CLI)

./chakshu logs 20                              # recent 20 tool calls
./chakshu logs -f                              # live follow mode (like tail -f)
./chakshu logs --status fail --agent codex     # filter by status/agent
./chakshu logs --session #ab12cd34 --full      # full payload without truncation
./chakshu tail --session #ab12cd34             # tail a specific session

./chakshu search "npm test" --agent claude-code
./chakshu count --by session                   # group by tool|session|agent|kind

3. Analytics, Memory, Security & Controls

# Telemetry & Memory
./chakshu stats [--session #ab12cd34]
./chakshu memory [--session #ab12cd34]
./chakshu decisions [--type constraint --pin <memory-id>]
./chakshu mcp-memory                           # stdio MCP server for agents

# Skill Evaluation & Rollback
./chakshu eval --ci --min-score 70
./chakshu rollback --list
./chakshu rollback <call-id>

# Approvals, Security & Supply Chain
./chakshu approvals [--session #ab12cd34 --risk HIGH]
./chakshu audit [--level high]
./chakshu audit-mcp
./chakshu audit-skills
./chakshu plugins
./chakshu audit-plugins

# Incidents, Network & Processes
./chakshu incidents
./chakshu network --live --spikes
./chakshu ps
./chakshu kill <pid> [terminate|kill|pause|resume]

4. Historical Ingestion & Export

./chakshu import ~/.codex/sessions/
./chakshu import /path/to/transcript.jsonl --agent codex

./chakshu export --format json > telemetry.json
./chakshu export --format csv > telemetry.csv

5. 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
  ├── 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
  ├── 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
  ├── network/        agent-only OS socket attribution, provider classification & spike detection
  ├── pidfile/        pid file lifecycle and single-instance locks
  ├── 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
  ├── 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

Documentation & Community


Contributors

Contributions of all kinds—code, agent adapters, documentation, bug reports, and security audits—are welcome!


License

MIT License. See LICENSE for details.

Explore related projects

Loading…