← Posts

hooktop: experimenting with local Claude Code observability

A terminal view of what Claude Code runs underneath. Tool calls, subagents, CPU, RAM and costs, all on your own machine.

hooktop's knight, the follower mascot

Where hooktop comes from

For almost a year I’ve let coding agents write my code, like many developers. Codex and Gemini exist, but I ended up in the Claude Code zone.

Claude Code’s interface keeps improving, and it documents its plans well when asked. What I missed was a screen like Temporal’s workflow history, showing what my agents run underneath: each tool call, how long it took, roughly what it cost, and how the calls relate.

I also wanted to play with ratatui again. My last try, todx, was a to-do app the world didn’t need, but I loved the library. hooktop pairs it with axum and borrows ideas from Logfire and Temporal. Building it with Claude Code also made me think about safety.

What hooktop shows

The timeline: a session’s history with CPU and RAM charts and costs

Press o to switch to the Graph tab, a graph of tasks and subtasks, or to Statistics, for the slowest tool calls and the biggest RAM eaters.

The graph view: Watcher’s tasks and the followers it sent out

Statistics: tool mix, cost by model, longest prompts and RAM eaters

How it works

Claude Code’s HTTP hooks post every event to a small Rust server, on 127.0.0.1:4317 by default. It stores events in SQLite, reads token counts from Claude Code’s transcripts, and streams updates over a WebSocket to the terminal UI.

Thinking about safety

A local server is still a server. hooktop listens only on your machine, needs a secret token (hooktop token rotate replaces it), and refuses requests from web pages. It saves your prompts and Claude’s replies from the hooks in a local SQLite file. From transcripts, it reads token counts only, never the text. Nothing leaves your computer.

Try it

brew install nazliander/tap/hooktop
hooktop hooks install
hooktop

The code is on GitHub.

Closing thoughts

hooktop is an experiment. It doesn’t make agents more reliable; it only shows what they do. It stays Claude Code only unless Codex changes my mind, and with my background in statistics, better stats come next.

Knight by Nazli Ander, from hooktop, licensed under CC BY 4.0.