Documentation

Everything you need to install, configure, and use lazyagent to monitor your Claude Code sessions.

How it works

lazyagent watches Claude Code's JSONL transcript files in ~/.claude/projects/*/ to determine what each session is doing. No modifications to Claude Code are needed — it's purely observational.

Activity states

From the JSONL stream, lazyagent detects activity states with color-coded labels:

idle Session file exists but no recent activity
waiting Claude responded, waiting for input
thinking Claude is generating a response
compacting Context compaction in progress
reading Reading files
writing Writing files
running Executing commands
searching Searching codebase
browsing Web browsing
spawning Spawning subagents

Session info

For each session, lazyagent surfaces:

InfoSource
Working directoryJSONL
Git branchJSONL
Claude versionJSONL
Model usedJSONL
Is git worktreegit rev-parse
Main repo path (if worktree)git worktree
Message count (user/assistant)JSONL
Token usage & estimated costJSONL
Activity sparkline (last N minutes)JSONL
Last file writtenJSONL
Recent conversation (last 5 messages)JSONL
Last 20 tools usedJSONL
Last activity timestampJSONL
Custom session name~/.config/lazyagent/session-names.json

Three interfaces, one binary

lazyagent ships as a single binary with three interfaces that all share the same core engine:

TUImacOS Menu BarHTTP API
InterfaceTerminal (bubbletea)Native panel (Wails v3 + Svelte 5)REST + SSE
Launchlazyagentlazyagent --traylazyagent --api
Dock iconN/AHidden (accessory)N/A
SparklineUnicode brailleSVG area chartJSON data
ThemeTerminal colorsCatppuccin MochaN/A

You can combine them freely:

lazyagent --tui --tray --api

Install

Homebrew (TUI)

brew tap illegalstudio/tap
brew install lazyagent

Go (TUI only)

go install github.com/nahime0/lazyagent@latest

Build from source

git clone https://github.com/nahime0/lazyagent
cd lazyagent

# TUI only (no Wails/Node.js needed)
make tui

# Full build with menu bar app (requires Node.js)
make install   # npm install (first time only)
make build

macOS note

On first launch, macOS may block the binary. Go to System Settings → Privacy & Security, scroll down and click Allow Anyway, then run it again.

Usage

lazyagent                        # Terminal UI (default)
lazyagent --api                  # HTTP API on 127.0.0.1:7421
lazyagent --api --host :8080     # API on custom address
lazyagent --tui --api            # TUI + API server
lazyagent --tray                 # macOS menu bar app (detaches)
lazyagent --tray --api           # Tray + API (foreground)
lazyagent --tui --tray --api     # Everything
lazyagent --help                 # Show help

Terminal UI

The default interface. Full-featured TUI built with bubbletea and lipgloss.

lazyagent terminal UI

Keybindings

KeyAction
/ kMove up / scroll up
/ jMove down / scroll down
tabSwitch focus between panels
+ / -Adjust time window (±10 minutes)
fCycle activity filter
/Search sessions by project path
oOpen session CWD in editor
rRename session (empty resets)
q / ctrl+cQuit

macOS Menu Bar

lazyagent --tray

The tray process detaches automatically — your terminal returns immediately. The app lives in your menu bar with no Dock icon. Click the tray icon to toggle the panel.

lazyagent macOS menu bar app

Keybindings

KeyAction
/ kMove up
/ jMove down
+ / -Adjust time window
fCycle activity filter
/Search sessions
rRename session
escClose detail / dismiss search

Right-click menu

  • Show Panel — open the session panel
  • Refresh Now — force reload all sessions
  • Quit — exit the app

HTTP API

lazyagent --api

Starts a read-only HTTP API server on http://127.0.0.1:7421 (default port, with automatic fallback to 7422–7431 if busy).

lazyagent API playground
EndpointDescription
GET /apiInteractive playground (open in browser)
GET /api/sessionsList visible sessions (?search=, ?filter=)
GET /api/sessions/{id}Full session detail
PUT /api/sessions/{id}/nameRename session ({"name": "..."}, empty resets)
DELETE /api/sessions/{id}/nameRemove custom name
GET /api/statsSummary stats (total, active, window)
GET /api/configCurrent configuration
GET /api/eventsSSE stream for real-time updates

To expose on the network (e.g. for a mobile app):

lazyagent --api --host 0.0.0.0:7421

Editor support

Pressing o (TUI) or the Open button (menu bar) opens the selected session's working directory in your editor.

ConfigurationBehavior
Both $VISUAL and $EDITOR setPicker popup (TUI only)
Only $VISUAL setOpens as GUI editor
Only $EDITOR setOpens as TUI editor (suspends TUI)
Neither setShows a hint to configure
# Add to ~/.zshrc or ~/.bashrc
export VISUAL="code"   # GUI editor (VS Code, Cursor, Zed, ...)
export EDITOR="nvim"   # TUI editor (vim, nvim, nano, ...)

Configuration

lazyagent reads ~/.config/lazyagent/config.json, created automatically with defaults on first run:

{
  "windowMinutes": 30,
  "defaultFilter": "",
  "editor": "",
  "launchAtLogin": false,
  "notifications": false,
  "notifyAfterSec": 30
}
FieldDefaultDescription
windowMinutes30Time window for session visibility (minutes)
defaultFilter""Default activity filter (empty = show all)
editor""Override for $VISUAL/$EDITOR
launchAtLoginfalseAuto-start the menu bar app at login
notificationsfalsemacOS notifications when a session needs input
notifyAfterSec30Seconds before triggering a "waiting" notification

Architecture

lazyagent/
├── main.go                     # Entry point: --tui / --tray / --api
├── internal/
│   ├── core/                   # Shared: watcher, activity, session, config
│   ├── claude/                 # JSONL parsing, types, session discovery
│   ├── api/                    # HTTP API server (REST + SSE)
│   ├── ui/                     # TUI rendering (bubbletea + lipgloss)
│   ├── tray/                   # macOS menu bar (Wails v3, build-tagged)
│   └── assets/                 # Embedded frontend dist (go:embed)
├── frontend/                   # Svelte 5 + Tailwind 4 (menu bar UI)
│   ├── src/
│   │   ├── App.svelte
│   │   ├── lib/                # SessionList, SessionDetail, Sparkline
│   │   └── bindings/           # Auto-generated Wails TS bindings
│   └── app.css                 # Tailwind 4 @theme (Catppuccin Mocha)
├── docs/
│   └── API.md                  # Full HTTP API reference
└── Makefile

Development

# Install frontend deps (first time)
make install

# Full build (TUI + tray)
make build

# Build TUI only (no Wails/Node.js needed)
make tui

# Quick dev cycle (rebuild + run tray)
make dev

# Clean all artifacts
make clean

Requirements

  • Go 1.25+
  • Node.js 18+ (for frontend build)
  • macOS (for the menu bar app — TUI works on any platform)

Roadmap

v0.1 — Core TUI

  • Discover all Claude Code sessions from ~/.claude/projects/
  • Parse JSONL to determine session status
  • Detect worktrees
  • Show tool history
  • FSEvents-based file watcher with debouncing
  • Fallback 30s polling

v0.2 — Richer session info

  • Conversation preview (last 5 messages)
  • Last file written with age
  • Filter by activity type
  • Search by project path
  • Time window control
  • Color-coded activity states
  • Memory-efficient single-pass JSONL parsing
  • Activity sparkline graph
  • Token usage and cost estimation
  • Animated braille spinner
  • Open CWD in editor (o key)
  • Rename sessions (r key)
  • Display file diff for last written file

v0.3 — macOS menu bar app

  • Core library extraction
  • Shared config system
  • Wails v3 + Svelte 5 + Tailwind 4 frontend
  • System tray with attached panel
  • Real-time session updates
  • SVG sparkline, activity badges
  • Keyboard shortcuts
  • Open in editor
  • Dynamic tray icon (active count)
  • macOS notifications
  • Launch at Login
  • Code signing & notarization
  • DMG distribution
  • Homebrew cask

v0.4 — HTTP API

  • REST API server
  • Session list, detail, stats, config endpoints
  • Server-Sent Events (SSE)
  • Interactive API playground
  • Default port with fallback (7421–7431)
  • Custom bind address
  • Combinable with TUI and tray
  • Session rename endpoints

Future ideas

  • Outbound webhooks on status changes
  • Multi-machine support
  • TUI actions: kill session, attach terminal
  • Session history browser