Skip to content
UjiinEatingTangerinesPublic

About

๐Ÿฑ NyanBar (Claude Code) โ€” macOS menu bar app for monitoring Claude Code sessions with cat loaf icon, rainbow notifications, and session dashboard

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฑ NyanBar (Claude Code)

A macOS menu bar app that watches your Claude Code sessions โ€” with a tail-wagging cat loaf and rainbow notifications.

npm GitHub stars macOS Swift License: MIT

npm install -g nyanbar && nyanbar install

โญ If NyanBar helps you, please give it a star on GitHub! It motivates further development and helps other Claude Code users discover the project.


Why NyanBar?

When you work with Claude Code, you often run multiple sessions at once. Switching to each terminal just to check whether a task is done is tedious.

NyanBar puts a cat loaf in your menu bar that watches every Claude Code session in real time. When work finishes, a rainbow flashes across the screen so you know instantly โ€” and one click jumps you to the right terminal.


Features

๐Ÿž Menu Bar Cat Loaf โ€” a bread-shaped cat that wags its tail to show what's happening

State Cat Menu Bar Text
Idle Gentle tail sway + occasional yawn ๐Ÿž Baking bread.. (30 random meme messages)
Working Active S-shaped tail wag Project name
Pending Pulse blink ๐Ÿ™‹ Waiting for input
Completed ๐ŸŒˆ Rainbow cat + sound done!
Sleep ๐Ÿ’ค Slowly breathing cat ๐Ÿ’ค zzZ...

๐Ÿ“‹ Session Dashboard โ€” click the cat to see every session at a glance

  • Working / Waiting for Input groups, card-based UI
  • Project name, path, elapsed time, terminal app, last message
  • Click a card to jump to that terminal

๐ŸŒˆ Rainbow Notification โ€” never miss a completed task

  • A flowing rainbow gradient bar at the top of the screen
  • Mirrored across every connected display
  • Stays until you acknowledge it (one click on the icon dismisses)
  • Only fires for tasks longer than 10 seconds (short replies are ignored)

๐Ÿ“œ History โ€” see completed, idle, and crashed sessions

  • History tab for past sessions
  • Auto-deleted after 24 hours (filesystem scan ensures cleanup)
  • "Clear All" button for manual cleanup

โš™๏ธ Settings

  • ๐ŸŒ Language: Korean / Japanese / English (live switch)
  • ๐ŸŒ“ Appearance: System / Light / Dark
  • ๐ŸŽจ Cat Color: 12-color palette + reset (auto-switches eye color for contrast)
  • ๐Ÿ”Š Completion Sound: on/off
  • ๐ŸŒ™ Sleep Mode: pause every notification
  • ๐Ÿ’ฌ Custom Spinner Text: add your own messages (toggle + delete)
  • โค๏ธ Health Check Interval: 10s / 20s / 30s / 5m / 30m / 1h
  • ๐Ÿ”„ Update Check: query npm for latest version + one-click update

Installation

npm (recommended)

npm install -g nyanbar
nyanbar install

npx (no install)

npx nyanbar install

Git Clone

git clone https://github.com/UjiinEatingTangerines/nyanbar.git
cd nyanbar
node bin/nyanbar.js install

Requirements: macOS 14.0+, Node.js 18+, Claude Code CLI, Xcode Command Line Tools (xcode-select --install)

What nyanbar install does

  1. Builds the app with Swift (swift build -c release)
  2. Creates a code-signed bundle at ~/Applications/ClaudeMenuBar.app
  3. Copies the hook script to ~/.claude/scripts/hooks/
  4. Registers 6 hooks in ~/.claude/settings.json (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, Stop, SessionEnd)
  5. Installs a LaunchAgent (auto-start on login)
  6. Launches the app

Commands

nyanbar install     # Build, install, register hooks, enable auto-start
nyanbar uninstall   # Remove everything
nyanbar start       # Start the app
nyanbar stop        # Stop the app
nyanbar status      # Check installation status

Usage

  1. The cat loaf appears in your menu bar
  2. Start any Claude Code session โ€” NyanBar detects it automatically
  3. Click the cat โ†’ opens the dashboard (Sessions / History / Settings tabs)
  4. Click a session card โ†’ jumps to that terminal
  5. Task completed โ†’ rainbow + sound โ†’ click the cat to acknowledge

Spinner Messages (30 each in 3 languages)

๐Ÿž ๋นต ๊ตฝ๋Š” ์ค‘.. ยท ๐Ÿพ ๊พน๊พน์ด ํ•˜๋Š” ์ค‘.. ยท ๐Ÿ˜ด ๊ณจ๊ณจ๊ณจ.. ยท ๐Ÿ˜พ ์•ผ์˜น ์•ˆ ํ• ๊ฑฐ๋‹ค๋ƒฅ ยท ๐Ÿƒ 3์ดˆํ›„ ๋ฏธ์นœ๋“ฏ์ด ๋œ€ ยท ๐Ÿ˜ธ ์ง‘์‚ฌ ๊ต์œก 95% ยท ...

๐Ÿž ้ฃŸใƒ‘ใƒณ็„ผใไธญ.. ยท ๐Ÿพ ใตใฟใตใฟไธญ.. ยท ๐Ÿ˜ด ใ‚ดใƒญใ‚ดใƒญ.. ยท ๐Ÿ˜พ ใซใ‚ƒใƒผใ—ใชใ„ใ‚‚ใ‚“ ยท ๐Ÿƒ 3็ง’ๅพŒใซๅ…จๅŠ›็–พ่ตฐ ยท ๐Ÿ˜ธ ไธ‹ๅƒ•ใฎๆ•™่‚ฒ 95% ยท ...

๐Ÿž Baking bread.. ยท ๐Ÿพ Making biscuits.. ยท ๐Ÿ˜ด Purring away.. ยท ๐Ÿ˜พ Not meowing today ยท ๐Ÿƒ Zoomies in 3..2.. ยท ๐Ÿ˜ธ Hooman training 95% ยท ...


Smart Detection

Situation How it's detected Result
Task longer than 10s completes Stop hook + duration check + 10s time-based fallback โœ… Rainbow + sound
Short reply / error Stop hook + duration < 10s idle (no rainbow)
AskUserQuestion Stop hook + tool name check pending (๐Ÿ™‹ waiting for input)
Question pattern Message pattern match pending
Permission prompt 30s stale-working detection pending
Idle reminder after Stop Notification only flips working/pending โ†’ pending (never overrides completed/idle) no phantom pending
Real-time tool tracking Hook tool-use debounce reduced to 500ms + UserPromptSubmit hook fires on new user message dashboard reflects live tool/turn within ~0.5s
Faster session discovery Process scan runs every 2nd health check (was every 5th) hookless sessions appear in seconds
Animation overhead NSImage frame cache (NSBitmapImageRep) + skip identical button updates ~80% fewer image allocations per second
Long-running tool heartbeat PostToolUse hook refreshes lastUpdatedAt every tool completion no false stale-working during long Bash/Edit chains
Countdown tick waste Countdown timer pauses while popover is closed saves 86,400 ticks/day of SwiftUI re-evaluation
Background timer wakes Timer.tolerance on non-critical timers (poll 2s / refresh 5s / health 10%) macOS coalesces wakes โ†’ better battery life
Long tool execution Stale-working threshold raised from 30s โ†’ 180s (Notification/Stop still detect real pending instantly) 2-3 minute Bash/test runs stay "working", no false pending flicker
Session reload I/O File read + JSON decode + sort moved off the main thread popover stays responsive even with many session files
Redundant icon updates iconManager.update(state:) short-circuits when the effective state is unchanged no animation-timer thrash on busy $sessions publishes
File event latency DispatchSource debounce tightened 300ms โ†’ 100ms (hook layer already debounces at 500ms) UI reacts within ~100ms of the first file event
Tool-in-flight detection toolStartedAt field set by PreToolUse and cleared by PostToolUse/Stop; Swift gives in-flight tools up to 1 hour before staleness check a 10-minute pytest run stays "working" instead of flickering to "pending" at 180s
PostToolUse reliability Removed debounce from tool-end; always clears toolStartedAt. Recovers status from pending โ†’ working if an over-eager stale sweep misfired guarantees tool-end signal is honored exactly once per tool completion
PreToolUse reliability Removed debounce from tool-use too โ€” Swift's 100ms DispatchSource debounce already caps reload rate, so hook-side debounce was only risking a dropped toolStartedAt when a slow tool followed a fast one fastโ†’slow tool sequences keep their stale-working grace
Timestamp-refresh tick waste Timestamp refresh timer now starts only when the popover first opens and pauses on close (same pattern as the countdown tick) ~2,880 no-op SwiftUI re-evaluations per day saved when the popover stays closed
Process exited PID health check dead
cmux tab closed PID health check (process exits when tab closes) dead
Session without hook Process scan (ps) auto-discovered + tracked
MacBook woken from sleep Sleep/Wake notifications + phantom popover reset + full timer restart + button re-validation auto-recovered
UI freeze prevention Background health check + adaptive FPS (idle 3fps, working 5fps) CPU ~4%, no main-thread blocking
Rapid file changes DispatchSource events with 0.1s debounce no reload storms
Resource efficiency Single-pass health-check I/O + 20fps rainbow reduced CPU & memory

Supported Terminals

Terminal Session Detection Click to Focus
cmux โœ… โœ… (per panel)
Ghostty โœ… โœ…
iTerm2 โœ… โœ…
Terminal.app โœ… โœ…
VS Code โœ… โœ…
Warp โœ… โœ…
IntelliJ โœ… โœ…

Architecture

Claude Code Hooks โ”€โ”€writeโ”€โ”€โ†’ ~/.claude/menubar-sessions/*.json
                                        โ”‚
                               DispatchSource (file watch)
                                        โ”‚
                              NyanBar (SwiftUI + AppKit)
                                        โ”‚
                     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ”‚                  โ”‚                  โ”‚
               Menu Bar Icon     Session Dashboard    Rainbow Overlay
               (cat loaf ๐Ÿž)    (NSPopover)          (all screens ๐ŸŒˆ)
Project Structure
nyanbar/
โ”œโ”€โ”€ package.json              # npm package
โ”œโ”€โ”€ bin/nyanbar.js            # CLI (install/uninstall/start/stop/status)
โ”œโ”€โ”€ Package.swift             # Swift Package Manager
โ”œโ”€โ”€ Sources/ClaudeMenuBar/
โ”‚   โ”œโ”€โ”€ ClaudeMenuBarApp.swift
โ”‚   โ”œโ”€โ”€ AppDelegate.swift     # NSStatusItem + NSPopover
โ”‚   โ”œโ”€โ”€ Core/
โ”‚   โ”‚   โ”œโ”€โ”€ SessionState.swift
โ”‚   โ”‚   โ”œโ”€โ”€ SessionDirectoryWatcher.swift
โ”‚   โ”‚   โ”œโ”€โ”€ RelativeTimeFormatter.swift
โ”‚   โ”‚   โ”œโ”€โ”€ AppLanguage.swift       # i18n (ko/ja/en)
โ”‚   โ”‚   โ””โ”€โ”€ ColorUtils.swift        # NSColor โ†” hex
โ”‚   โ”œโ”€โ”€ Services/
โ”‚   โ”‚   โ”œโ”€โ”€ MenuBarIconManager.swift  # Cat icon + animations
โ”‚   โ”‚   โ”œโ”€โ”€ HealthCheckService.swift  # PID + surface check
โ”‚   โ”‚   โ”œโ”€โ”€ SettingsStore.swift       # UserDefaults
โ”‚   โ”‚   โ”œโ”€โ”€ TerminalController.swift  # cmux/terminal focus
โ”‚   โ”‚   โ”œโ”€โ”€ UpdateChecker.swift       # npm version check
โ”‚   โ”‚   โ””โ”€โ”€ SoundPlayer.swift         # Completion sound
โ”‚   โ”œโ”€โ”€ Modules/
โ”‚   โ”‚   โ”œโ”€โ”€ SessionDashboard/
โ”‚   โ”‚   โ””โ”€โ”€ RainbowAnimation/
โ”‚   โ””โ”€โ”€ Views/
โ”‚       โ”œโ”€โ”€ PopoverContentView.swift
โ”‚       โ”œโ”€โ”€ HistoryView.swift
โ”‚       โ””โ”€โ”€ SettingsView.swift
โ”œโ”€โ”€ Hooks/
โ”‚   โ””โ”€โ”€ menubar-session-update.js
โ””โ”€โ”€ scripts/
    โ”œโ”€โ”€ build.sh
    โ”œโ”€โ”€ install.sh
    โ””โ”€โ”€ uninstall.sh

Uninstall

nyanbar uninstall

Removes the app, hook script, LaunchAgent, session data, and the hook entries in settings.json โ€” clean and complete.


Support the Project

If NyanBar makes your Claude Code workflow a little nicer:

Every star tells me people care about the project โ€” thank you! ๋ƒฅ~


License

MIT โ€” Made with ๐Ÿพ in Korea.

About

๐Ÿฑ NyanBar (Claude Code) โ€” macOS menu bar app for monitoring Claude Code sessions with cat loaf icon, rainbow notifications, and session dashboard

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages