You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A terminal UI and macOS menu bar app for monitoring all running [Claude Code](https://claude.ai/code) instances on your machine — inspired by [lazygit](https://github.com/jesseduffield/lazygit), [lazyworktree](https://github.com/chmouel/lazyworktree) and [pixel-agents](https://github.com/pablodelucca/pixel-agents).
7
+
A terminal UI, macOS menu bar app, and HTTP API for monitoring all running [Claude Code](https://claude.ai/code) instances on your machine — inspired by [lazygit](https://github.com/jesseduffield/lazygit), [lazyworktree](https://github.com/chmouel/lazyworktree) and [pixel-agents](https://github.com/pablodelucca/pixel-agents).
8
8
9
9
### Terminal UI
10
10

@@ -42,19 +42,19 @@ It also surfaces:
42
42
| Last 20 tools used | JSONL |
43
43
| Last activity timestamp | JSONL |
44
44
45
-
## Two interfaces, one binary
45
+
## Three interfaces, one binary
46
46
47
-
lazyagent ships as a single binary with two interfaces:
47
+
lazyagent ships as a single binary with three interfaces:
48
48
49
-
|| TUI | macOS Menu Bar |
50
-
|---|---|---|
51
-
| Interface | Terminal (bubbletea) | Native menu bar panel (Wails v3 + Svelte 5) |
Both share `internal/core/` — session discovery, file watcher, activity state machine, cost estimation, and config. You can run both simultaneously with `lazyagent --tui --tray`.
57
+
All three share `internal/core/` — session discovery, file watcher, activity state machine, cost estimation, and config. You can combine them freely: `lazyagent --tui --tray --api`.
58
58
59
59
## Install
60
60
@@ -92,11 +92,14 @@ On first launch, macOS may block the binary. Go to **System Settings → Privacy
92
92
## Usage
93
93
94
94
```
95
-
lazyagent Launch the terminal UI
96
-
lazyagent --tui Launch the terminal UI (explicit)
97
-
lazyagent --tray Launch as macOS menu bar app (detaches automatically)
98
-
lazyagent --tui --tray Launch both TUI and tray app
99
-
lazyagent --help Show help
95
+
lazyagent Launch the terminal UI (default)
96
+
lazyagent --api Start the HTTP API (http://127.0.0.1:7421)
97
+
lazyagent --api --host :8080 Start the HTTP API on a custom address
98
+
lazyagent --tui --api Launch TUI + API server
99
+
lazyagent --tray Launch as macOS menu bar app (detaches)
100
+
lazyagent --tray --api Launch tray + API server (foreground)
101
+
lazyagent --tui --tray --api Launch everything
102
+
lazyagent --help Show help
100
103
```
101
104
102
105
### TUI
@@ -141,6 +144,31 @@ The tray process detaches automatically — your terminal returns immediately. T
141
144
-**Refresh Now** — force reload all sessions
142
145
-**Quit** — exit the app
143
146
147
+
### HTTP API
148
+
149
+
```
150
+
lazyagent --api
151
+
```
152
+
153
+
Starts a read-only HTTP API server on `http://127.0.0.1:7421` (default port, with automatic fallback if busy).
154
+
155
+
| Endpoint | Description |
156
+
|----------|-------------|
157
+
|`GET /api`| Interactive playground (open in browser) |
158
+
|`GET /api/sessions`| List visible sessions (`?search=`, `?filter=`) |
lazyagent exposes an HTTP API for monitoring Claude Code sessions. The API is read-only and designed for building external clients (mobile apps, dashboards, integrations).
4
+
5
+
## Starting the API server
6
+
7
+
```bash
8
+
# Default: http://127.0.0.1:7421
9
+
lazyagent --api
10
+
11
+
# Custom address
12
+
lazyagent --api --host :8080
13
+
lazyagent --api --host 0.0.0.0:7421
14
+
15
+
# Combined with TUI or tray
16
+
lazyagent --tui --api
17
+
lazyagent --tray --api
18
+
lazyagent --tui --tray --api
19
+
```
20
+
21
+
The default port is **7421**. If it's busy, the server tries up to 10 sequential ports (7421–7431) and binds to the first available one. The actual address is printed to stderr on startup.
22
+
23
+
When `--host` is specified, it binds to that exact address with no fallback.
24
+
25
+
## Interactive playground
26
+
27
+
Open **http://127.0.0.1:7421/api** in a browser to access the interactive API playground. It lets you test all endpoints and connect to the SSE stream with a single click.
28
+
29
+
## Endpoints
30
+
31
+
### GET /api/sessions
32
+
33
+
List all visible sessions within the configured time window.
{"role": "user", "text": "Add the API endpoint", "timestamp": "2026-03-08T15:28:00Z"},
101
+
{"role": "assistant", "text": "I'll create the endpoint...", "timestamp": "2026-03-08T15:28:05Z"}
102
+
]
103
+
}
104
+
```
105
+
106
+
**Response:**`404 Not Found` if session doesn't exist.
107
+
108
+
---
109
+
110
+
### GET /api/stats
111
+
112
+
Summary statistics.
113
+
114
+
**Response:**`200 OK`
115
+
116
+
```json
117
+
{
118
+
"total_sessions": 5,
119
+
"active_sessions": 2,
120
+
"window_minutes": 30
121
+
}
122
+
```
123
+
124
+
---
125
+
126
+
### GET /api/config
127
+
128
+
Current lazyagent configuration.
129
+
130
+
**Response:**`200 OK`
131
+
132
+
```json
133
+
{
134
+
"window_minutes": 30,
135
+
"default_filter": "",
136
+
"editor": "",
137
+
"launch_at_login": false,
138
+
"notifications": false,
139
+
"notify_after_sec": 30
140
+
}
141
+
```
142
+
143
+
---
144
+
145
+
### GET /api/events
146
+
147
+
**Server-Sent Events (SSE)** stream for real-time updates. The server pushes an `update` event whenever session data changes (file watcher triggers, activity state changes, or periodic reload).
148
+
149
+
An initial snapshot is sent immediately upon connection.
0 commit comments