Skip to content

Repository files navigation

Needle — Claude Code session monitor in the tray, with color-coded status legend: running, waiting, attention/error, idle, obsolete

When multiple Claude Code sessions run in parallel, the annoying question is always the same: which one is waiting for my reply right now? Needle lives in the Windows tray and answers that at a glance — no terminal switching.

Mockup of Needle's tray panel showing five sessions in different states: running, waiting for input, needs attention, idle, and obsolete

What it shows

  • All active sessions, grouped by project.
  • The state of each session, always one of these seven: running · waiting for input · needs attention · idle · error · obsolete · ended.
  • Elapsed time since the last event, updating live — no need to reopen the panel to see it tick.
  • The Claude model used and the estimated cost (USD) of each session.
  • Native Windows notification as soon as a session starts needing you — if you turn native notifications off in Settings, Needle switches to a small in-app toast near the tray instead, it never goes fully silent.
  • Tray icon reflecting the worst state among all open sessions — if the icon turns red, you already know something is pending.

Usage & cost

A banner at the top of the panel shows your account-level Claude usage, refreshed every minute:

  • 5-hour and weekly usage, as a percentage, with the time each window resets.
  • Total cost (USD), summed across every session Needle is tracking.

Per-session cost and model come from parsing Claude Code's own local transcripts (~/.claude/projects/**/*.jsonl) — no extra logging or telemetry beyond what Claude Code already writes to disk. The 5-hour/weekly figures come straight from Anthropic's account usage endpoint, authenticated with the same OAuth credentials Claude Code itself stores locally (~/.claude/.credentials.json); nothing is sent anywhere beyond that one request to api.anthropic.com.

Obsolete sessions

A session with no new event for a while is marked obsolete. Hover over one in the panel to reveal a delete button and remove it right away. Untouched, it's purged automatically after 24 hours with no activity — it won't sit there forever.

Ended sessions

A session that finishes normally is marked ended, and — unlike obsolete sessions — it stays in the panel indefinitely; it's never auto-purged. Its cost keeps counting toward the total shown in the usage banner, so you still have a full record of what you spent. Hover over it to reveal the same delete button and remove it manually whenever you're done with it.

Installation

No prerequisites. No Node, Rust, or any runtime to install first.

  1. Download the latest installer (needle_x64-setup.exe) from the Releases page.
  2. Run the installer — installs only for your user, without admin permission.
  3. Open Needle once. It self-configures automatically: registers Claude Code hooks in ~/.claude/settings.json, without touching hooks from other tools already there (and creates a backup before any write).
  4. Done. Use Claude Code normally — the tray icon now reflects your sessions' states.

Click the tray icon to open the panel. The tray menu includes shortcuts for Settings, Reconfigure hooks, and Exit.

How it works

Flow: Claude Code triggers hook, needle hook sends local HTTP, server writes to SQLite, tray and panel update

Claude Code triggers native hooks for each session event. The Needle executable itself handles these hooks — when called as needle.exe hook, it reads stdin payload and forwards it over local HTTP to the running app. No Node, no external script, no dependency beyond what was installed.

The app writes everything to local SQLite, recalculates session state, and updates tray + panel in real time.

Settings

From the panel's "Settings" tab (or from the tray menu):

Option What it does
"Needs attention" threshold seconds waiting for input before status escalates
"Obsolete" threshold minutes without any event before the session is marked obsolete
Start with system starts Needle with Windows
Windows notifications switches alerts between native OS notifications and an in-app toast near the tray
Hook status shows whether hooks are registered, with buttons to reconfigure or remove

Development

Prerequisites: Rust (MSVC toolchain), Visual Studio Build Tools (C++ workload), Node.js 20+.

npm install
npm run tauri dev     # development mode
npm run tauri build   # generates NSIS installer at src-tauri/target/release/bundle/nsis

License

MIT

About

Needle is a lightweight system tray application that keeps track of Claude Code sessions, showing their current status and notifying you when an agent needs attention or user input.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages