Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Windows: keep the last edit on the ticker after Claude Code finishes (#840)

afpruivo6f42cbc3c87b
diff --git a/windows/src/island/hooks.ts b/windows/src/island/hooks.ts
index b39ecc21..ebeefb38 100644
--- a/windows/src/island/hooks.ts
+++ b/windows/src/island/hooks.ts
@@ -69,6 +69,8 @@ interface HookPayload {
term_editor?: string;
/** StatusLine (the plan usage relay): Claude Code's 5-hour and weekly limits. */
rate_limits?: unknown;
+ /** SubagentStart / SubagentStop: "Explore", "general-purpose"…; "" for Claude Code's own helpers. */
+ agent_type?: string;
}
const PROJECT_ALIASES: Record<string, string> = {
@@ -471,6 +473,10 @@ function handleHook(island: Island, payload: HookPayload) {
break;
case "SubagentStop":
+ // Claude Code's own helpers (the prompt suggestion after each turn) end
+ // with a SubagentStop of empty agent_type and never start one. Shown, it
+ // pushed the turn's last edit off the ticker a few seconds after Stop.
+ if (payload.agent_type === "") break;
State.appendStep(agentId, t("• subagent done"));
break;
diff --git a/windows/tests/livediff.test.mjs b/windows/tests/livediff.test.mjs
index 4c330cef..5ff7e4a6 100644
--- a/windows/tests/livediff.test.mjs
+++ b/windows/tests/livediff.test.mjs
@@ -161,3 +161,24 @@ for (const [what, event] of [
assert.equal(task().finalLine, null);
});
}
+
+// ── Subagents ─────────────────────────────────────────────────────────────────
+
+test("the SubagentStop Claude Code sends after Stop leaves the last edit on the ticker (#840)", () => {
+ edit();
+ hook({ hook_event_name: "Stop", last_assistant_message: "Done." });
+ const steps = [...task().steps];
+ // Captured from Claude Code: no SubagentStart, empty agent_type, a few seconds after Stop.
+ hook({ hook_event_name: "SubagentStop", agent_id: "a6f6d8a2ad8a9ef2b", agent_type: "" });
+ assert.deepEqual(task().steps, steps);
+ assert.ok(parseDiffStep(task().steps.at(-2)));
+});
+
+test("a real subagent still shows its start and end, and an agent without agent_type too", () => {
+ hook({ hook_event_name: "SubagentStart", agent_id: "abb32627dee1d8ff6", agent_type: "Explore" });
+ hook({ hook_event_name: "SubagentStop", agent_id: "abb32627dee1d8ff6", agent_type: "Explore" });
+ assert.deepEqual(task().steps.slice(-2), ["+ subagent", "• subagent done"]);
+ hook({ hook_event_name: "SubagentStop" });
+ assert.equal(task().steps.at(-1), "• subagent done");
+ assert.equal(task().steps.length, 3);
+});