$ cat blog/session-state

Detecting Session State Locally

Fresh transcript writes, completion markers, and conservative time windows turn local activity into a useful signal.

A coding agent can still be working, waiting for the next instruction, or stuck mid-turn. The hard part is not drawing those states. It is deciding which state is true without uploading a transcript or alarming on an old session.

Agent Island showing Claude Code and Codex working states in the top bar
Demonstration capture of both provider indicators in the working state.

The source stays local

Claude Code and Codex already write JSONL session records on the machine. Agent Island examines recent files under each provider's local session directory. It does not need a hosted state service to decide whether a session is moving.

The scanner uses file modification time, recent events, and whether the app observed that file producing output. Old files are ignored. This prevents a stale transcript from becoming a fresh alert after launch.

A deliberately small model

Each candidate session is classified as idle, working, your turn, or an attention state. Claude completion markers include assistant turns with a terminal stop reason. Codex uses its task completion event. A newer start event keeps the Codex session in the working state.

Multiple sessions can exist for either provider. Agent Island chooses the most urgent current state for each provider, then renders one Claude signal and one Codex signal in the top bar.

Stalled is not the same as quiet

A file that has not changed is not automatically stalled. The app first needs to have observed it working. Only then can an extended pause without a completion marker become an attention state. That extra history is what keeps ordinary idle sessions from turning red.

What this signal cannot prove

Transcript activity says whether a tool is moving. It does not say whether the generated code is correct, whether a tool call is valuable, or whether an old session was deleted. The status surface remains intentionally narrow: is the agent working, waiting for you, or asking for attention?

The public source contains the current scanner implementation and its state thresholds.

← All posts