Skip to content

AIchovy/vibe-observer

Repository files navigation

Vibe Observer

Vibe Observer

The local-first profiler for Claude Code. See where every token went, find the bottleneck, fix it.

License Platform Built with Tauri Rust

English · 中文


📸 At a glance

Dashboard — Cost Attribution

Dashboard. Subscription-aware framing with a 30-day cost trend; today / month / all-time at the top, attribution tabs below. The numbers are API-list-price equivalents, not what you actually paid.

Token detail

Token detail. 99.9 % cache hit rate. Daily stacked breakdown of input / output / cache_read / cache_write. Plus an explainer for why cache_write also costs money.

Behavior analysis

Behavior analysis. Tool-call heatmap by week × hour, top tools by call count, and a $/tool cost-efficiency ranking that surfaces the most context-heavy sessions.

Session detail with Gantt trace

Session detail · Gantt trace. The dark-red bars are top-decile-slow spans — six minutes of AskUserQuestion stand out at a glance. Click any bar to jump to that step in the conversation below.

Menu-bar popover

Menu-bar popover. Today / month / ROI · hook health · priciest sessions · loop-cluster warnings — all without leaving what you're doing.


Why Vibe Observer

Claude Code makes you fast — and it makes it very easy to spend without noticing. A single Opus-heavy session can burn through hundreds of dollars of API-equivalent value, and you usually don't find out until the bill arrives or the rate limit hits.

Existing tools stop at the surface: ccusage shows daily totals, claude-replay lets you scrub through a transcript, Mnemo adds a memory layer. None of them answer the question that actually matters:

Which session was expensive, why, and what should I change?

Vibe Observer is the missing layer. It captures every Claude Code hook event into a local SQLite, reconstructs the conversation, attributes cost across project / model / tool / session, surfaces loop and failure clusters, and gives you a Gantt-style trace so you can see exactly where the seconds (and the dollars) went.

Everything stays on your machine. No telemetry, no cloud, ever.

✨ Features

  • 🔒 Truly local — Pure SQLite on your disk. The Transparency panel lets you audit every action Observer has taken on your system.
  • Zero-config install — One click in the Welcome flow installs 15 Claude Code hook events into ~/.claude/settings.json, with a diff preview and automatic backup. Auto-reconciles on every upgrade and preserves any third-party hooks you already have, byte-for-byte.
  • 💰 Cost attribution — Today / month / all-time, split by project, model, session, and tool. Worktrees collapse under their parent project automatically (/my-project/.claude/worktrees/foo/my-project · foo).
  • 📊 Token detail — Input / output / cache_read / cache_write per model, cache hit rate, top-10 token-hungry sessions, daily stacked trend.
  • 🔍 Behavior analysis — Tool-call heatmap (week × hour), most-accessed files with per-session drill-down, repeat-read / failure-cluster warnings, cost-per-tool efficiency ranking.
  • 💬 Real conversation trace — Each session rendered as the actual chat: user prompts, assistant responses, tool_use blocks, tool_result outcomes. Plus a Gantt-style timeline that shows wall-clock duration per step with a "jump to next slow span" shortcut.
  • 🎯 Subscription-aware framing — Auto-detects API-key vs subscription users. Subscription users see "5.3× ROI vs your $200/mo" instead of a misleading "you spent $1000" — the dollar figures are API-list-price equivalents of the value extracted, not money owed.
  • 🐚 Menu-bar resident — macOS tray icon with click-to-reveal popover for at-a-glance stats. Close the main window and Observer keeps capturing in the background. Right-click the tray for Open / Quit.

🚀 Quick Start

Prerequisites

  • macOS 12 Monterey or later (Windows support planned)
  • Rust stable
  • Node.js 20+ and pnpm
  • Tauri CLI: cargo install tauri-cli --version "^2"

Run from source

git clone https://github.com/your-org/vibe-observer.git
cd vibe-observer
pnpm install
cargo tauri dev

On first launch, the Welcome page will preview the changes to ~/.claude/settings.json and let you accept with one click. Observer backs up your original file before writing.

Production build

cargo tauri build --no-bundle    # standalone binary, fastest
cargo tauri build                # full .app bundle (for distribution)

The bundled .app lives in target/release/bundle/macos/.

🏗 How it Works

┌──────────────────────────────────────────────────────────────┐
│ Claude Code (CLI · Desktop · IDE — all share ~/.claude/)     │
└────────────────────┬─────────────────────────────────────────┘
                     │ hook events (15 subscribed)
                     ▼
       ┌──────────────────────────────────┐
       │ observer-hook   ~1.5 MB Rust bin │  async writes for
       │ stdin → SQLite raw_events → exit │  high-frequency events
       └────────────────────┬─────────────┘  so Claude is never
                            ▼                blocked
       ┌────────────────────────────────────────┐
       │ ~/Library/Application Support/         │
       │ VibeObserver/observer.db (SQLite WAL)  │
       └────────────────────┬───────────────────┘
                            ▲      ▲
                            │      │ JSONL backfill
                            │      │ (~/.claude/projects/)
       ┌────────────────────┴──────┴────────────┐
       │ observer-app (Tauri 2 + React + Vite)  │
       │  Dashboard  ·  Session detail          │
       │  Trace      ·  Transparency · Popover  │
       └────────────────────────────────────────┘

Three Rust crates plus a frontend:

  • observer-core — SQLite schema, migrations, pricing tables.
  • observer-hook — Tiny binary spawned by Claude Code per event; reads JSON from stdin, writes one row, exits.
  • observer-ingest — JSONL parser + materialiser. Projects raw_events into typed tables (sessions, messages, tool_calls, compactions) idempotently.
  • observer-app — Tauri 2 application; React frontend in src/.

Cost is computed at the message level from Anthropic's published per-token rates so cross-session and cross-day aggregates always reconcile. Worktrees are normalised at query time via a single SQL expression so the data layer stays simple.

🤝 Contributing

Issues and PRs welcome. The architecture is documented in docs/superpowers/specs/; a written design exists for every major data path. Run tests with cargo test --workspace and the frontend with pnpm build.

📄 License

MIT © Vibe Observer contributors

⚠️ Disclaimer

Vibe Observer is an independent, third-party tool. It is not built by or affiliated with Anthropic. "Claude" and "Claude Code" are trademarks of Anthropic.

About

Claude Code Tracer & Observer

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages