Activity detection
Kangentic monitors each agent’s activity in real-time, so you always know what your agents are doing without opening their terminals. All fifteen supported agents (Claude Code, Codex CLI, Gemini CLI, Cursor CLI, GitHub Copilot CLI, Grok Build, Antigravity CLI, Goose CLI, OpenCode, Aider, Qwen Code, Kimi Code, Factory Droid, Warp/Oz CLI, and Ollama) feed into a single activity state machine that drives the card indicators, but each uses a different underlying strategy because each CLI exposes activity differently.
Agent states
Section titled “Agent states”Each card shows its agent’s current state, and the state updates as events arrive. The full set of things a card can show is on Card indicators; the two states below are the ones activity detection drives.
| State | Description |
|---|---|
| Thinking (pulsing animation) | Agent is processing, running tools, or generating a response |
| Idle (amber mark) | Agent has stopped, hit a permission prompt, or is asking a question. Since v0.52.0 the mark says which, on cards, the Workflows views, and the Agent Monitor, and toasts and notifications use the same words |
| Queued (label) | Waiting for a concurrent session slot to open. A session status rather than an activity state. The card shows it before there is an agent to detect |
Event types
Section titled “Event types”Kangentic tracks these events from each agent session. They feed into both the card indicators and the Activity tab in the bottom panel.
User-facing events
Section titled “User-facing events”| Event | Key | Effect on Indicator | Description |
|---|---|---|---|
| Tool start | tool_start |
Thinking | Agent began using a tool (Read, Edit, Bash, etc.) |
| Tool end | tool_end |
(no change) | Tool execution completed |
| Prompt | prompt |
Thinking | User submitted a message or the agent resumed after approval |
| Idle | idle |
Idle | Agent stopped, hit a permission wall, or asked a question |
| Interrupted | interrupted |
Idle | User interrupted the agent (Escape or interrupt signal) |
Internal events
Section titled “Internal events”These events are logged but don’t directly change the card indicator - they support subagent tracking, context management, and system-level operations. Not every agent emits every event (see per-agent strategies below).
| Event | Key | Effect on Indicator | Emitted by | Description |
|---|---|---|---|---|
| Session start | session_start |
(no change) | Claude, Codex, Gemini, Cursor, Copilot, Grok, Antigravity, Goose, OpenCode, Qwen, Droid | Session was created or resumed, reported by the agents whose hooks carry a session-start event |
| Session end | session_end |
(no change) | All | Session exited |
| Notification | notification |
(no change) | Claude, Gemini, Grok, Qwen, Kimi | Informational message from the agent (e.g., “context getting full”). Grok also reports a denied tool call here |
| Turn failed | turn_failed |
Idle | Claude, Cursor, Grok, Qwen, Kimi | The turn ended on a service or API error (rate limit, overload, server error) instead of a normal stop, sourced from the CLI’s StopFailure hook, Cursor’s stop hook status, or Kimi’s wire log. Treated like an interrupt: resets in-flight counters and commits idle immediately, with the error type carried in the event detail so the log reads “service error” |
| Turn retrying | turn_retrying |
Thinking (conditional) | Claude, Grok, Kimi | A transient, auto-retried API error (overloaded, server error, rate limit) that the CLI is retrying rather than a final abort. Unlike turn_failed, it keeps a genuinely live turn in the thinking state through the retry backoff instead of showing a false idle, deferring the idle decision to the watchdog timers. If the turn had already wound down or ended, it is treated exactly like turn_failed |
| Idle hint | idle_hint |
Idle (conditional) | Claude, Grok | Agent signaled out-of-band that it is waiting for input (a Claude “waiting for your input” notice, or a Grok idle_prompt notification). Settles the session to idle only when nothing else is keeping it thinking (no pending tools, subagents, background shells, or permission prompt); otherwise log-only. |
| Compact | compact |
Thinking | Claude, Codex, Gemini, Cursor, Copilot, Grok, OpenCode, Qwen, Kimi, Droid | Context compaction occurred |
| Subagent start | subagent_start |
Thinking | Claude, Codex, Cursor, Copilot, Grok, OpenCode, Qwen, Kimi | A subagent was spawned (increases depth counter). Codex since v0.63.0, on a build that confirms the extended hook set |
| Subagent stop | subagent_stop |
(no change) | Claude, Codex, Cursor, Copilot, Grok, OpenCode, Qwen, Kimi | A subagent finished (decreases depth counter) |
| Teammate idle | teammate_idle |
(no change) | Claude | Another agent in the same project went idle |
| Task completed | task_completed |
(no change) | Claude | A task was marked complete |
| Config change | config_change |
(no change) | Claude, Antigravity | A configuration setting was modified. Antigravity’s status line raises it when plan mode changes |
| Worktree create | worktree_create |
Thinking | Claude | A git worktree was created |
| Worktree remove | worktree_remove |
(no change) | Claude | A git worktree was removed |
| Background shell start | background_shell_start |
Thinking | Claude, Codex, Copilot, Gemini, Grok, Qwen | Agent launched a background command (Claude’s backgrounded Bash or PowerShell, and each other agent’s own equivalent). Kangentic tracks the detached child so the session isn’t falsely flagged idle while it’s still running. |
| Background shell end | background_shell_end |
(no change) | Claude, Codex, Copilot, Gemini, Grok, Qwen | A tracked background shell exited. Releases a deferred idle when the last background child finishes. |
| Model start | model_start |
(no change) | Gemini | Fired before each LLM API call within an agent turn - per-call visibility in the Activity tab. |
| Model end | model_end |
(no change) | Gemini | Fired after each LLM API call returns. Log-only counterpart to model start. |
| Tool selection start | tool_selection_start |
(no change) | Gemini | Fired when the agent is choosing which tool to invoke next. |
| Plan approval sent | plan_approval_sent |
(no change) | Claude | Kangentic’s plan approval hook answered the plan prompt for a column or workflow task set to Automatic. It proves only that the answer was sent, and lets the permission wait that the prompt raised drop without showing “needs you”. Not drawn in the Activity tab |
| Plan approved automatically | plan_auto_approved |
(no change) | Claude | The plan Kangentic approved was accepted. The Activity tab draws it as a Plan approved automatically badge with where the task went (“Moved to Executing”) |
Per-agent detection strategy
Section titled “Per-agent detection strategy”Kangentic uses a different detection strategy for each agent because each CLI exposes activity differently. All fifteen strategies feed into the same unified state machine, so card indicators behave identically regardless of which agent is running.
| Agent | Strategy |
|---|---|
| Claude Code | Hooks only |
| Codex CLI | Hooks primary (once Codex confirms their trust), PTY fallback |
| Gemini CLI | Hooks primary, PTY fallback |
| Cursor CLI | Hooks primary on a session screen, stream-JSON on a print run, PTY fallback |
| GitHub Copilot CLI | Hooks primary, PTY fallback |
| Grok Build | Hooks (Claude-compatible set) primary, PTY fallback |
| Antigravity CLI | Hooks primary, status line for approval waits, PTY fallback + idle-footer regex |
| Goose CLI | Hook plugin primary, PTY fallback |
| OpenCode | Plugin events primary (tool.execute.before/after, session.idle), PTY fallback |
| Aider | PTY prompt regex |
| Qwen Code | Hooks (Claude-named set) primary, PTY fallback |
| Kimi Code | Wire log primary, PTY fallback |
| Factory Droid | PTY silence timer for turn ends, hooks for tools and waits |
| Warp (Oz CLI) | PTY silence timer |
| Ollama | PTY silence timer (single-turn ollama run) |
Claude Code, hooks only
Section titled “Claude Code, hooks only”Claude Code’s native hooks system is the sole source of truth. Kangentic injects an event-bridge.js shim into the session that fires on Claude Code hook events and writes them to a structured log file that Kangentic watches incrementally.
| Claude Code hook | Effect |
|---|---|
| PreToolUse | The agent is about to use a tool. Sets thinking |
| PostToolUse | A tool finished. No state change |
| PostToolUseFailure | A tool call failed. No state change, since the agent may retry, unless the call failed because you interrupted it, which sets idle |
| UserPromptSubmit | You sent a message. Sets thinking |
| Stop | The agent stopped on its own. Sets idle |
| StopFailure | The turn ended on a service or API error. Sets idle, logged as turn_failed |
| PermissionRequest | The agent needs approval. Sets idle |
| SubagentStart / SubagentStop | Track subagent nesting depth |
| Notification / PreCompact | Logged as internal events. A notice that Claude is waiting for your input is an idle hint |
| SessionStart / SessionEnd | Logged as internal events |
| TeammateIdle / TaskCompleted | Logged as internal events |
| ConfigChange | Logged as an internal event |
| WorktreeCreate / WorktreeRemove | Worktree lifecycle; create counts as thinking |
Hook injection is automatic - no manual setup. All Kangentic artifacts stay in the .kangentic/ directory; nothing is written to your .claude/settings.local.json. Claude’s status line fills a status.json with the context window percentage, token counts, cost, and rate limits. Antigravity’s status line and OpenCode’s plugin write the same file.
Codex CLI, hooks primary with PTY fallback
Section titled “Codex CLI, hooks primary with PTY fallback”Since v0.48.0 Codex runs Kangentic’s hooks: SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PermissionRequest, Stop, and PreCompact. They reach Codex as -c hooks.* overrides on each launch, in Codex’s session-flags layer, so no hook is written to ~/.codex or the repository, and hooks you configured yourself load beside them. The Stop hook is what lets On agent turn end automations run for Codex.
Since v0.63.0 those seven are the base set, and an extended set adds SubagentStart, SubagentStop, and SessionEnd. The subagent pair keeps the card thinking while a Codex subagent runs, as Claude’s does. SessionEnd fires as Codex exits, so a Command Terminal ends within seconds instead of about a minute. A Codex older than the subagent hooks would not confirm them, so the trust check below asks for the extended set first and falls back to the base seven, and a session registers whichever set its Codex confirmed. The same release measured these on codex-cli 0.171.0, signed in.
Codex runs a hook only when its trust record holds the hash Codex computes for that hook, and an untrusted hook stops the TUI at a “Hooks need review” dialog before the session starts. So Kangentic never computes the hash itself. It asks the installed Codex (codex app-server, hooks/list) about the exact hooks it is about to pass, and marks them trusted for that process only when the answer lists every one with the same command and timeout. Your own trusted hooks stay trusted. The check runs once per Codex binary, and again after an in-place update.
When the check fails (a timeout, a Codex without the subcommand, a hook missing from the answer), the session runs without hooks, on the PTY strategy Codex used before v0.48.0: after each burst of terminal output, a 3-second silence timer marks the session idle, and content deduplication filters repeated TUI frames so resize redraws don’t look like activity. Codex’s › prompt stays visible even during tool execution, so a prompt regex can’t be used. Even with hooks, an Esc interrupt and a failed model request fire no Stop, so Kangentic reads those from the rollout file, along with the live model, effort, and token usage. Kangentic writes no .codex/hooks.json; on spawn it only strips Kangentic-owned entries an older install left there, preserving hooks you added yourself.
Gemini CLI, hooks primary with PTY fallback
Section titled “Gemini CLI, hooks primary with PTY fallback”Gemini supports hook injection via .gemini/settings.json (reference-counted so concurrent sessions don’t clobber each other). Hooks fire on BeforeAgent, AfterAgent, BeforeModel, AfterModel, BeforeToolSelection, BeforeTool, AfterTool, SessionStart, SessionEnd, Notification, and PreCompress events.
Gemini has no permission hook. It reports each tool confirmation dialog, the plan prompt included, as a Notification whose type is ToolPermission, and Kangentic turns that one into a permission wait, so the card shows the session needs you until the AfterTool that follows your answer. exit_plan_mode fires AfterTool for an approved plan and a rejected one alike, so Kangentic counts it as a plan exit only when the tool’s result starts with “Plan approved.”, and only then does a plan column’s task move to its After Plan Mode column.
If hooks don’t fire (e.g., early in startup or during a hang), a PTY-based fallback kicks in: Kangentic watches for Gemini’s closed-box TUI border (╰────╯) or the “I’m ready.” message to detect idle, backed by the same 3-second silence timer as Codex. Once hooks start firing, the PTY fallback defers to them.
Cursor CLI, hooks primary with PTY fallback
Section titled “Cursor CLI, hooks primary with PTY fallback”Kangentic merges activity hooks into the project’s .cursor/hooks.json, beside your own: sessionStart, sessionEnd, beforeSubmitPrompt, preToolUse, postToolUse, postToolUseFailure, subagentStart, subagentStop, preCompact, and stop. A session screen reports through them, and the stop hook is what lets On agent turn end automations run for Cursor. A print run (cursor-agent -p ... --output-format stream-json) reports on its stream instead, and the stream’s closing result event is its turn end. The first line of that stream is an init event containing the model and session ID, which lets ContextBar resolve the model pill immediately. An interactive session gets its model and context use from Cursor’s status bar (Composer 2.5 · 7.8%), seeded by agent about until that bar paints.
Cursor runs project hooks only in a trusted workspace, so a confirm-changes session reports nothing until you answer its workspace prompt, and the 3-second PTY silence timer carries activity until then. Its hooks report no wait on you, so a Cursor wait stays on the envelope. Before v0.54.0 Kangentic wired no hooks here, and a silence timer alone decided. The hooks are built from Cursor’s docs and have not run against a real Cursor.
GitHub Copilot CLI, hooks primary with PTY fallback
Section titled “GitHub Copilot CLI, hooks primary with PTY fallback”Kangentic gives each Copilot session its own config directory, copilot-config/ beside the Kangentic events file, and writes its hooks to hooks/kangentic.json there, a folder Copilot has read hooks from since 0.0.422. Kangentic wires preToolUse, postToolUse, postToolUseFailure, userPromptSubmitted, agentStop, subagentStart, subagentStop, sessionStart, sessionEnd, preCompact, and notification hooks; these are the primary activity signal. notification tells a question from an approval, so the card shows the right wait. postToolUse also reports an approved plan: Copilot’s exit_plan_mode result starts “Plan approved!” for an approved plan and “Plan not approved.” otherwise, so only an approved plan moves the card to its After Plan Mode column. A PTY silence timer backs them up because Copilot’s statusLine is best-effort (empirically it doesn’t always fire in ConPTY). Stream-output parsing picks up the model label either from the NDJSON stream when invoked with --output-format json or from the interactive TUI’s status bar.
Grok Build, hooks primary with PTY fallback
Section titled “Grok Build, hooks primary with PTY fallback”Grok Build deliberately clones Claude Code’s hook surface, so Kangentic gets the full Claude-compatible hook set - PreToolUse, PostToolUse, UserPromptSubmit, Stop, SubagentStart/SubagentStop, and friends - written to a Kangentic-owned .grok/hooks/kangentic.json in the working directory. Hooks are the primary signal, but grok gates project hooks on its own folder trust, so a PTY silence timer carries activity until trust lands. There is no idle prompt regex: grok’s ❯ prompt stays visible during active work, the same always-visible-prompt trap as Codex’s ›. Grok has no statusline either; context percentage, token counts, and cost come from tailing the session’s updates.jsonl log.
Since v0.54.0 Grok’s waits on you reach the card: a Notification whose type is permission_prompt is an approval wait, and the starts of ask_user_question and exit_plan_mode are a question wait and an approval wait. StopCancelled reports a turn that ended without completing, and an idle_prompt notification is an idle hint. These come from Grok’s docs and have not run against a current Grok.
Antigravity CLI, hooks primary with PTY fallback
Section titled “Antigravity CLI, hooks primary with PTY fallback”Antigravity (agy) has a lifecycle hook system; Kangentic writes one named hook into .agents/hooks.json in the working directory, wiring SessionStart, PreInvocation (prompt), PreToolUse and PostToolUse (tool start and end), and Stop (idle, with agy’s fullyIdle flag). PreToolUse answers allow for every tool, which leaves agy’s own dialogs in place, and its ask_question case raises a question wait. Hooks don’t fire in print mode, so a PTY fallback covers those spawns: the standard silence timer plus an idle regex on agy’s footer - ? for shortcuts shows at rest, while a running turn shows esc to cancel instead. Conversation IDs arrive in every hook payload, which is also how session capture works.
Since v0.54.0 a per-session status line reports the model, context, tokens, and cost, passed with --settings where agy --help lists that flag. The same line raises approval waits from its tool_confirmation_pending field, tracks plan mode, and turns agy’s quota buckets into the context bar’s rate-limit bars. An agy with no --settings has no telemetry channel, so its context bar shows Telemetry: TUI only rather than spinning forever. Its brain-directory transcript is still parsed for the Transcript tab.
Since v0.66.0 Kangentic reads agy --help from both of its output streams. agy 1.5.19 prints its help to stderr, so the check found no --settings, and every session on that version ran with no status line and showed no model, context, or cost on its card. agy also re-reads .agents/hooks.json on every event, so the hook entry now finds each session’s own events file through an environment variable rather than naming one session’s file, and two sessions in one folder keep their activity apart.
Goose CLI, hook plugin with PTY fallback
Section titled “Goose CLI, hook plugin with PTY fallback”Kangentic writes a hook plugin to .agents/plugins/kangentic-goose/ in the working directory at spawn and hides it from git through .git/info/exclude. Its SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, Stop, and SessionEnd hooks are the primary signal, a PTY silence timer is the fallback, and Stop is what lets On agent turn end automations run for Goose. From Goose 1.56 its own program status escape marks a question or an approval, so the card shows the right wait. Session IDs need no capture pathway at all, because Kangentic names the session itself and passes -n <id> at spawn.
Goose runs every hook with sh -c, so on Windows Kangentic appends Git for Windows’ bin folder to PATH when no sh is there. With no Git for Windows the hooks never fire, the silence timer carries activity, and that Goose’s turn-end automations never run. Before v0.54.0 Kangentic wired no hooks here, and a silence timer alone decided. All of this is built from Goose’s docs and source and has not run against a real Goose.
OpenCode, plugin events with PTY fallback
Section titled “OpenCode, plugin events with PTY fallback”Kangentic gives OpenCode an activity-stream plugin so its tool.execute.before, tool.execute.after, and event (for session.created / session.idle / session.error) callbacks fire and stream activity back to Kangentic. Since v0.63.0 OpenCode 1 gets it by name: the spawn lists the packaged plugin’s file URL in the inline config it already passes, and nothing is copied. Before, the plugin was copied into the project root’s .opencode/plugins/, but OpenCode 1 stops looking for .opencode at the top of the git checkout it runs in, which for a task is its worktree. So an OpenCode 1 task in a worktree never loaded the plugin and ran on the silence timer alone, with no tool activity, questions, or context usage. Each OpenCode 1 spawn now removes a copy an earlier build left in the project root, which would otherwise write every event twice. The plugin captures the native session ID (ses_<id>) from event.properties.info.id. A PTY silence timer covers the gap between plugin idle events. Since v0.54.0 the plugin also reports prompts and compactions, and it tells a subagent’s child session from the task’s own, so a subagent going idle no longer ends the task’s turn.
OpenCode 2 is supported since v0.53.0. Before that it could not start under Kangentic at all, because its TUI rejects the --agent and --model flags the launch passed. Kangentic reads the major from opencode --version and launches OpenCode 2 with --standalone, so the TUI runs a private server that carries Kangentic’s MCP entry and exits with it, and puts the agent and model in its config instead of on the command line. OpenCode 2 does not run OpenCode 1 plugins, so a second plugin goes into .opencode/plugins/kangentic-activity/, the folder layout OpenCode 2 discovers, and turns its execution, tool, approval, and question events into the same activity events. OpenCode 2 unloads a plugin whose file is deleted under a running session, and before v0.64.0 Kangentic deleted the project’s copy when another session there ended, so a session still running went silent from its next turn. The copy now stays until the project is deleted; only a copy on an SSH host is still removed with its session. The version is read once per CLI path, so after you upgrade OpenCode in place, restart Kangentic before the next spawn; until then it still launches OpenCode 1’s command.
Since v0.54.0 the plugin writes a status.json on either version, so the context bar shows the model, context, tokens, and cost. OpenCode 2’s events give no model name or context limit, so there the label is the model’s ID and the bar shows no percentage. A remote session runs no plugin and shows Telemetry: TUI only. Its conversation is still read from the server for the Transcript tab, but a handoff out of it carries no conversation.
Aider, prompt regex
Section titled “Aider, prompt regex”Aider doesn’t support hook injection, so detection is pure PTY. Kangentic strips ANSI escapes from the output stream and matches a prompt regex at the end of the buffer:
/(?:^|\n)\s*(?:architect|ask|help|context)?>\s*$/Any terminal output flips the session to thinking; a prompt match flips it back to idle. A confirm prompt cannot be told from a finished turn, so the card shows the envelope for both. There is no subagent tracking and no compaction event. Since v0.54.0 each session’s own chat history file feeds the context bar’s model, tokens, and cost.
Qwen Code, hooks primary with PTY fallback
Section titled “Qwen Code, hooks primary with PTY fallback”Qwen Code is a soft fork of Gemini CLI, but it replaced Gemini’s hook system with Claude Code’s event names, and Qwen skips any hook key it does not know. Kangentic registers PreToolUse, PostToolUse, PostToolUseFailure, UserPromptSubmit, Stop, StopFailure, PermissionRequest, SubagentStart/SubagentStop, Notification, PreCompact, SessionStart, and SessionEnd in .qwen/settings.json. Before v0.47.0 Kangentic wrote Gemini’s names there, so only the session and notification hooks ever fired. Hook files are reference-counted across concurrent sessions in the same project. The PTY fallback is the same closed-box-TUI border + 3-second silence timer as Gemini.
exit_plan_mode fires PostToolUse for a plan it did not act on too, so Kangentic counts it as a plan exit only when the result starts with “User approved”. A rejection in Qwen’s dialog never runs the tool. Kangentic cannot approve Qwen’s plans for you: Qwen ignores a hook’s answer to a prompt that needs the user.
Since v0.54.0 a /clear, a /branch, or an in-TUI /resume moves the session to the new conversation, through the SessionStart hook, so a pause and resume reopens the conversation on screen.
Kimi Code, wire-protocol JSONL with PTY fallback
Section titled “Kimi Code, wire-protocol JSONL with PTY fallback”Kimi Code 2.x writes a structured log, wire.jsonl, under ~/.kimi-code/sessions/ for every session, and Kangentic finds it through the CLI’s session_index.jsonl. The CLI takes no hooks per session, so Kangentic watches that file for prompts, tool calls, question and approval waits, subagents, compactions, and turn ends. The same log feeds the ContextBar’s context-window percentage and token counts; Kimi reports no cost or rate limits. The first wire read turns the PTY tracker off, and the wire’s turn.ended record is an idle event, so On agent turn end automations run for Kimi. The PTY silence timer carries activity only until the wire file first flows. A session has no ID or folder until its first message, so Kangentic types the first prompt and captures the ID after it lands. The adapter is built from the CLI’s docs and source, and no real Kimi session has run against it yet.
Factory Droid, PTY silence with hooks for tools and waits
Section titled “Factory Droid, PTY silence with hooks for tools and waits”Kangentic writes hooks to a per-session settings file and passes it with --settings, so your ~/.factory/settings.json is never touched. They report tool calls, questions and approvals, the session ID, and compactions. Turn ends stay with a 3-second silence timer. Kangentic leaves the Stop hook out on purpose, because any plain idle event ends the turn and runs On agent turn end automations, and Droid’s TUI has not been measured. It asks for a Factory sign-in even with your own model key, so no TUI hook has been captured, and until one is, those automations do not run for Droid. The hooks were measured in droid exec 0.218.0, where UserPromptSubmit did not fire. The \x1b[?25l cursor-hide marker still times the first usable output. Session UUIDs come from the SessionStart hook, with ~/.factory/sessions/<cwd-slug>/<id>.jsonl as the fallback. Before v0.54.0 Kangentic wired no hooks here. They are built from Factory’s docs and have not run against a signed-in TUI.
Droid does not stream live telemetry to Kangentic - /cost and /context are post-hoc TUI commands and the OTEL endpoint is out-of-band. The context bar shows a “Telemetry: TUI only” affordance instead of spinning forever; run those commands inside the Droid TUI to see model, token, and cost details.
Warp (Oz CLI), PTY silence timer
Section titled “Warp (Oz CLI), PTY silence timer”Warp’s oz CLI is the simplest adapter: no hooks, no status file, no structured event output, no trust mechanism, and no caller-specified session IDs. Activity detection is a PTY silence timer only, the same bare timer Codex falls back to: oz agent run prints no prompt to match, so there is no prompt regex and the silence timer is the sole idle signal. Its context bar shows Telemetry: none.
Ollama, PTY silence + REPL prompt
Section titled “Ollama, PTY silence + REPL prompt”Ollama has no hooks and no native session IDs, so detection is PTY-only. A one-shot ollama run streams its answer and exits, which means the silence timer normally carries the idle transition on its own. A prompt regex sits alongside it for the other case: spawning with no prompt drops you into Ollama’s interactive REPL, and matching its >>> prompt marks idle the moment the model stops rather than waiting the timer out. Its context bar shows Telemetry: none.
Thinking vs. idle indicators
Section titled “Thinking vs. idle indicators”The card indicators are designed to avoid false signals:
- Tool end doesn’t set idle. Between consecutive tool calls there’s a brief gap - showing idle here would cause the spinner to flicker. For agents that emit explicit events, only the agent’s own end of turn or a permission prompt sets idle.
- Tool failure doesn’t set idle. The agent continues processing after a failure and may retry.
- Notifications don’t change state. Informational notifications (like “context getting full”) fire unpredictably and shouldn’t flip the indicator. The exceptions are the notifications that report a wait on you: Gemini’s tool confirmation, and the question and approval types Copilot, Grok, and Factory Droid send.
- Frame redraws don’t wake a session. For PTY-based agents, content-deduplication filters resize redraws so they don’t look like real activity.
- Denying a permission prompt clears the card. Claude fires a hook when a tool succeeds and when auto-mode denies one, but typing “no” yourself fires nothing: the turn aborts rather than ending, so there is no event to listen for. Before v0.41.0 the card sat on “needs input” until somebody typed into that session again, which on a task you answered from your phone meant forever. Kangentic now reads the answer out of Claude’s own transcript, polled every two seconds and only while a session is waiting on a prompt, so the card clears within a couple of seconds of your denial. Since v0.56.0 any error result for the waiting call ends the wait, where the poll used to match only the wording of your own denial. Claude’s built-in safety check denies a call in its own words, and in one session that left a card on needs-you for nearly eight minutes with nothing waiting. There is deliberately no timeout: a prompt nobody has answered should stay pending, because timing it out would drop the card and silence the push notification that is the point of knowing.
Subagent awareness
Section titled “Subagent awareness”Claude Code’s Agent tool lets a main agent spawn subagents to delegate work. Kangentic tracks the subagent depth from Claude’s SubagentStart / SubagentStop hook events so the card indicator stays accurate during nested operations:
- While any subagent is still running, the card stays thinking, even after the main agent’s own turn has stopped: subagent depth counts as activity
- When all subagents finish and the main agent resumes, the card still shows thinking, now for the main agent’s own turn
- Main-agent
Stopis deferred until any running subagent finishes, so a pending user decision isn’t hidden - User prompts and interrupts always take effect immediately regardless of subagent state
Qwen Code fires the same SubagentStart / SubagentStop hooks and needs the same depth gating: a background subagent keeps working after the main agent’s Stop, so that Stop ends the turn only once the last subagent stops. Grok Build fires them too, with one simplification: grok’s Stop fires only for the main agent, so the depth gating above isn’t needed. Since v0.54.0 Cursor and GitHub Copilot report subagents through their own hooks, OpenCode’s plugin reports a child session as one, and Kimi Code reports them in its wire log. Since v0.63.0 Codex reports them through its extended hooks, on a build that confirms them. The other agents don’t expose subagents, or report none Kangentic can pair (Gemini, Antigravity, Goose, Aider, Droid, Warp, Ollama).
Background shell tracking
Section titled “Background shell tracking”When an agent starts a command in the background (a build, a test run, npm run dev), its main loop returns to idle while the child process keeps running. Without tracking, Kangentic would flag the session idle the moment the tool returned even though work is still happening. The background-shell watcher tracks each such child until it exits, holding the session thinking, and the column’s On agent turn end automations, until the last tracked child finishes. Two event types, background_shell_start and background_shell_end, record this in the Activity Log, and the card’s activity tooltip names the shells it is waiting on.
Until v0.48.0 only Claude Code was tracked. Now six agents report their background commands, each from its own signal:
| Agent | Where a start and an end come from |
|---|---|
| Claude Code | Its hooks on a Bash or PowerShell call with run_in_background, and on a Monitor watch; KillShell ends one, and since v0.56.0 so does a TaskStop that worked, including one a subagent makes. Before, a shell stopped that way stayed open, held the card thinking, and in one session held its move for 87 minutes. Since v0.53.0 a watch stops counting a minute past its own timeout, even with no end notice |
| Qwen Code | Its post-tool hook on a background run_shell_command; task_stop ends one |
| Gemini CLI | Its AfterTool hook on a background run_shell_command. There is no stop tool, so the end is the process exiting |
| GitHub Copilot CLI | Its post-tool hook on an async powershell or bash call; stop_powershell and stop_bash end one. A detach: true launch is left out, since the agent declared it independent |
| Grok Build | Its post-tool hook on a run_terminal_command that started a background task; kill_command_or_subagent ends one |
| Codex CLI | The rollout file: a command still running when Codex yields starts one, and a poll that finds it exited ends one |
The others report none. Antigravity’s hook carries no output to key a command on, Factory Droid starts a background command outside the agent’s process tree where its end cannot be seen, OpenCode’s shell tool cannot run a command in the background, and Goose, Aider, Warp, and Ollama have no background commands. Cursor’s hooks document no background field. Kimi Code’s log names background tasks, but every session in a folder shares its MCP URL, so a mark could land on the wrong session, and since v0.54.0 it reports none.
A command meant to keep running, such as a dev server or a watcher, would hold the task forever. The agent releases it with kangentic_mark_background_service, or keeps it out from the start with --kangentic-no-activity-hold in its command. Either way the process keeps running and Kangentic still watches it exit. Claude Code, Copilot, Gemini, and Qwen get a hint naming the tool beside each background launch; Codex and Grok have no hook that can add one there, so they learn it from the tool’s description.
Seeing why a card is thinking
Section titled “Seeing why a card is thinking”When a card’s state looks wrong, the Activity Engine Debugger shows what the engine is holding it on. Turn on Activity engine debug overlay on the Developer tab of Settings, or press Ctrl+Alt+Shift+D / Cmd+Option+Shift+D from anywhere (Ctrl+Shift+D / Cmd+Shift+D before v0.56.0). The panel floats over the board with one section per running session in the current project, and refreshes every two seconds.
Each section names the session’s state and, while it is thinking, what holds it there: the tool it is running, open subagents, live background shells, or a turn that has not ended. Below that are the counters the rules above describe (pending tools, subagents, background shells, whether a turn is active, whether a permission prompt is open), the last five transitions with the event or timer that caused each, and a timeline of the last two minutes. While the overlay is on, the engine also writes a snapshot of each session to .kangentic/debug/ on every state change.
Retiring an agent that exited under its shell
Section titled “Retiring an agent that exited under its shell”This is not an activity signal: it changes a session’s status, not its state (added in v0.36.0).
Kangentic spawns a shell and writes the agent CLI command into it, so the agent is a child of the terminal’s root process rather than the root itself. When the agent exits on its own - you type /exit, the CLI crashes, a launch fails - the shell survives, the terminal never reports an exit, and nothing marked the session finished. The record stayed Running indefinitely: the status bar counted a phantom agent, the card read active, and the bottom panel kept a tab whose agent was gone.
Kangentic now sweeps for that case and retires the session cleanly, exactly as an ordinary exit would. The sweep piggybacks on the watcher that already holds each session’s root process and takes one process snapshot per cycle, so it adds no new timer or polling loop, and it runs at most once a minute while a task agent is running.
Marking a live agent dead is far worse than the phantom, so the sweep only acts when the root process is alive, the process snapshot is healthy, the agent is missing on two consecutive checks, and the session is past a 30-second spawn grace. Command Terminal sessions are excluded outright: they are bare shells by design, and would otherwise be retired the moment you opened one. A session running under a WSL shell is skipped too, because a healthy WSL agent shows no Windows child processes and cannot be told from a phantom.
A task whose agent never started is the one case that does not end this way. Since v0.54.0 Kangentic pauses it instead, because an ended session offers no Resume and its terminal takes no keys, and since v0.55.0 it tries the launch once more on its own. See An agent that never started.
Native session history
Section titled “Native session history”For every agent except Warp and Ollama, Kangentic reads the agent’s own native session history (in addition to the hook/PTY activity stream) to produce higher-fidelity telemetry: tool call transcripts and, where the file carries them, token counts. Kangentic watches these files incrementally so the Activity tab and context bar stay in sync without polling the CLI.
A context percentage needs a second number the history file does not always carry: how large the model’s context window is. Kangentic never guesses it from the model name. Where the agent reports a window size (Claude in its status.json, Codex in its rollout file, Grok in its own ~/.grok/models_cache.json, Qwen on every assistant event, Antigravity on its status line, OpenCode 1 through its plugin, Goose in its session row, and Kimi Code in your config.toml), the context bar draws a progress bar and the model dropdown shows a context-size badge. Where it does not, the bar hides and the pill shows the token count alone. Gemini is the one agent that lost its bar in v0.41.0: its session JSON carries no window size and the CLI has no command that reports one, so the hardcoded lookup table that used to fill the gap was deleted rather than kept current by hand.
The same files are what handoff context points at when a task moves between agents: Kangentic hands the next agent the file’s path rather than a manufactured summary, and the agent reads it directly.
| Agent | Native history path |
|---|---|
| Claude Code | ~/.claude/projects/<sanitized-cwd>/<session-id>.jsonl |
| Codex CLI | ~/.codex/sessions/.../rollout-*.jsonl |
| Gemini CLI | ~/.gemini/tmp/<folder>/chats/session-*.jsonl, where <folder> is the working folder’s name in lowercase (current builds; .json on older ones, and both generations are matched) |
| Grok Build | ~/.grok/sessions/<encoded-cwd>/<session-id>/chat_history.jsonl, the transcript a handoff points at, with updates.jsonl beside it for usage |
| Antigravity CLI | ~/.gemini/antigravity-cli/brain/<conversation-id>/.system_generated/logs/transcript.jsonl (parsed for the Transcript tab and tool counts) |
| OpenCode | ~/.local/share/opencode/opencode.db (one SQLite database for every session rather than a file per session; the handoff points the next agent at the database path). OpenCode 2 migrates the same database in place and writes its sessions to new tables, which Kangentic also reads, so a session started on OpenCode 1 and continued on 2 reads from wherever its newest turn is. Parsed for the Transcript tab, usage, and tool counts |
| Aider | <cwd>/.aider.chat.history.<session-id>.md, one per session since v0.54.0. A Command Terminal has no session ID, so it uses Aider’s shared .aider.chat.history.md. Parsed for the transcript, model, tokens, and cost |
| Qwen Code | ~/.qwen/projects/<sanitized-cwd>/chats/<session-id>.jsonl, unless QWEN_RUNTIME_DIR or advanced.runtimeOutputDir moves the root (Qwen forked Gemini but moved chat persistence, so it does not use Gemini’s layout) |
| Kimi Code | ~/.kimi-code/sessions/<workspace>/<session-id>/agents/main/wire.jsonl, found through session_index.jsonl |
| Factory Droid | ~/.factory/sessions/<cwd-slug>/<session-id>.jsonl (parsed for the Transcript tab; no live telemetry) |
| Cursor CLI | ~/.cursor/projects/<cwd-slug>/agent-transcripts/<session-id>/<session-id>.jsonl (parsed for the session view and handoffs since v0.52.0; its records carry no timestamp, so the view shows no clock, and a delivery check cannot use it) |
| GitHub Copilot CLI | session-state/<session-id>/events.jsonl in the session’s own config folder (parsed for the transcript, tool counts, and usage since v0.54.0, and a handoff points the next agent at it) |
| Goose CLI | sessions.db, one SQLite database for every session: ~/.local/share/goose/sessions/sessions.db, or %APPDATA%\Block\goose\data\sessions\sessions.db on Windows (read for the transcript, usage, and live telemetry since v0.54.0) |
Warp and Ollama expose no file at all, so their context bars show Telemetry: none. A task moving out of one of them carries no handoff context, and neither does a task moving out of Goose, whose one database is no single session’s file. On an SSH host, Kangentic copies a Goose session out with Goose’s own export, and a handoff hands on that copy.
Authentication status
Section titled “Authentication status”For agents that ship their own OAuth/credential flow, Kangentic probes the auth state at detection time - a credentials directory, or a lightweight CLI probe - and surfaces a sign-in hint when a fresh spawn would die at the auth wall. This shows up next to the agent’s entry in the Welcome screen and in the column / settings agent picker. Since v0.60.0 the Welcome screen marks it in the attention color only when no other agent is ready. Beside a ready agent it is a plain Copy login link.
| Agent | Probe | Resolve by running |
|---|---|---|
| Grok Build | grok models (its output reports “not authenticated”) |
grok login |
| OpenCode | ~/.local/share/opencode/auth.json, and on OpenCode 2 the credentials it keeps in its database |
opencode auth login |
| Kimi Code | A credentials/*.json from /login, or a model configured in config.toml, under ~/.kimi-code |
kimi login |
Where the state shows up
Section titled “Where the state shows up”The board shows the state on each card, the Agent Monitor shows it for every project on the machine, and when an agent goes idle Notifications can raise a desktop alert, an idle badge, or a push to your phone.
See also
Section titled “See also”- Notifications - desktop alerts and idle badges driven by activity state
- Session persistence - how activity state survives restarts
- Settings - configure notification triggers
Kangentic is free and open source. A star helps other people find it.
Star on GitHub