Unix Socket API¶
The daemon exposes a Unix socket API at /tmp/agentwatch.sock for local queries.
Connection¶
Commands¶
Legacy Commands¶
| Command | Arguments | Description |
|---|---|---|
status |
- | Get all sessions with full state |
session |
Get specific session state | |
sessions |
- | List session IDs |
REST-Style Commands¶
| Command | Description |
|---|---|
GET /sessions |
List all sessions with full state |
GET /sessions/<id> |
Get specific session state |
GET /sessions/<id>/parse ?verbose=true |
Get parsed session output |
GET /sessions/<id>/capture |
Get raw terminal content |
GET /health |
Health check |
Response Format¶
All responses are JSON with the following structure:
Or on error:
Examples¶
Get All Sessions¶
$ echo "status" | nc -U /tmp/agentwatch.sock
{
"success": true,
"data": {
"sessions": {
"$0": {
"session": { "name": "coding-0", "id": "$0" },
"current": { "program": "Claude Code", "state": "Working" },
...
}
},
"session_count": 1
}
}