npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-trace

v1.0.8

Published

Real-time TUI visualization of Claude Code tool execution — see every tool call, live.

Readme

claude-trace

See every tool call Claude Code makes — live, in your terminal.

Claude Code shows a spinner while it works. claude-trace splits your terminal and renders a real-time tree of every tool call, progress bar, token usage, and an animated pixel-art companion.

claude-trace demo


Features

  • Live tool tree — Every Read, Edit, Bash, and subagent call rendered as a tree in real time
  • Status icons success · running · failed · denied · pending · subagent
  • Progress bar — Completed tools out of total, updated as each tool finishes
  • Stats footer — Token level bar, session context window, weekly usage with reset timer, cost, and elapsed time
  • Pixel-art sprite — Animated character with 5 states and 4 emotions driven by live tool activity (notchi, MIT)
  • Auto-update — Checks npm for a newer version on startup; press y to update in place
  • Non-invasive — Uses Claude Code's official HTTP hook system; no source modification required
  • Auto-restore.claude/settings.json is restored to its original state on exit

Requirements


Installation

npm (recommended):

npm install -g claude-trace

From source:

git clone https://github.com/ydking0911/claude-trace.git
cd claude-trace
npm install && npm run build && npm link

Usage

Use claude-trace anywhere you would use claude:

claude-trace "read the codebase and fix the bug in auth.ts"
claude-trace --model claude-opus-4-6 "refactor the payment module"

When launched, tmux automatically splits your terminal:

  • Left (60%) — Claude Code running normally
  • Right (40%) — claude-trace TUI

Optional alias — use claude as usual with tracing always on:

echo "alias claude='claude-trace'" >> ~/.zshrc && source ~/.zshrc

How It Works

claude-trace "prompt"
      │
      ├─ Temporarily injects HTTP hooks into .claude/settings.json
      ├─ Creates a tmux session (60/40 split)
      │       ├─ Left pane:  claude <args>
      │       └─ Right pane: TUI server (localhost:7337)
      │
While Claude Code runs:
      ├─ UserPromptSubmit    → POST /event → creates TurnNode, reads transcript tokens
      ├─ PreToolUse          → POST /event → adds ToolNode (running)
      ├─ PostToolUse         → POST /event → marks ToolNode (success), reads transcript tokens
      ├─ PostToolUseFailure  → POST /event → marks ToolNode (failed)
      ├─ PermissionRequest   → POST /event → marks ToolNode (pending)
      ├─ PermissionDenied    → POST /event → marks ToolNode (denied)
      ├─ SubagentStart       → POST /event → creates AgentNode
      ├─ SubagentStop        → POST /event → marks AgentNode complete
      └─ SessionEnd          → POST /event → waits 5s, restores settings, exits

All hooks use async: true so the TUI server's response time never blocks Claude Code.


Keyboard Shortcuts

By default, focus stays on the left (Claude) pane. To use TUI controls, switch to the right pane first:

Ctrl+B → →   (tmux: move focus to right pane)
Ctrl+B → ←   (tmux: move focus back to left pane)

Once the right pane is focused:

| Key | Action | |-----|--------| | q / Ctrl+C | Exit TUI | | / / j / k | Scroll the tool tree | | y | Install available update (shown in header when a newer version is found) |

Mouse pane resize: Drag the pane divider to resize. Only works in terminals that support tmux mouse mode (e.g. iTerm2). Ghostty, Warp, and similar terminals may not support this.

Pane resize without mouse — works in all terminals:

  • tmux command: Ctrl+B then :resize-pane -R 10 (expand right pane) / -L 10 (shrink)
  • Fixed split: set CLAUDE_TRACE_SPLIT=50 (default: 40) before launching

Mouse scroll: Scroll wheel inside the tool tree works without switching pane focus.


Node Status Icons

◉  success  — green,  tool completed
⠸  running  — amber spinner, in progress
◎  pending  — gray,   awaiting permission
✗  failed   — red,    tool error
⊘  denied   — orange, permission denied
▣  agent    — blue,   subagent

Sprite States

The pixel-art companion in the top-right corner reflects the current activity:

| State | Trigger | |-------|---------| | working | One or more tools are currently running | | waiting | Claude is generating a response (between prompt and first tool call) | | compacting | A context compaction tool is running | | sleeping | No session, or 60+ seconds without any hook event | | idle | Session active, no tools running |

Emotion follows tool outcomes: happy after 5+ successful completions, sad on any failure, neutral otherwise. After all tools finish, the sprite briefly holds the outcome emotion before returning to idle.


Stats Footer

The footer displays five rows of live metrics:

| Row | Content | |-----|---------| | Session | Truncated session ID | | Token Lv. | Exponential level bar — Lv.1: 0–1K tokens, Lv.2: 1K–3K, doubles each level | | Cost / Elapsed / Tools | Estimated cost, session duration, total tool count | | ◆ Session | Context window usage (orange) — input + cache tokens vs. 200K limit | | ◆ Weekly | Weekly output token usage (green) vs. 10M limit, with reset countdown |

Token counts are read directly from Claude Code's own .jsonl transcript files in ~/.claude/projects/.


Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | CLAUDE_TRACE_PORT | 7337 | Event server port (auto-increments on conflict) | | CLAUDE_TRACE_PROJECT_DIR | cwd | Directory used to locate .claude/settings.json | | CLAUDE_TRACE_SPLIT | 40 | Right pane width as a percentage (e.g. 50 for an even split) |


Sprite Credits

The pixel-art character in the top-right corner is converted from notchi sprites (MIT License, by sk-ruban) into ANSI half-block characters via chafa.

To regenerate sprites after updating notchi:

brew install chafa imagemagick
bash scripts/generate-sprites.sh
npm run build

Contributing

See CONTRIBUTING.md.


License

MIT © ydking0911