session-events
Session Events
One daemon per Claude Code session, started by the session as a background task, polls a system for the targets that session watches, delivers each poll's alerts as one message, and logs every event as a line any agent can read. What it polls is a source: a script of a few lines that says what a target is, how it is read, and what its events say.
Three sources ship in this catalog: the /watch-github skill polls GitHub for PRs and branch tips, the /orchestrator-mode skill's fleet-events polls a fleet's agent transcripts and worktrees, and scripts/examples/log-source.mts watches a file's size. A session writes its own source for anything else that must be polled.
Operating envelope: one Claude Code session, one user, the daemon started once by that session, the polled system reachable.
The Specimen
An agent is waiting on a build that writes /var/log/build.log. It starts the daemon on the file source, once per session, as a background task, and one line subscribes the file:
bun "<skill-dir>/scripts/examples/log-source.mts" daemon --interval 5 # once per session, as a BACKGROUND task
bun "<skill-dir>/scripts/examples/log-source.mts" watch /var/log/build.log
The session goes back to work. The build appends a line, and the next poll delivers this frame to the session's inbox, which renders it as a message from log-events: