Skip to content

Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.

feat(claude): detect /schedule like /loop (Schedule node)

enes6f1a8a2fc631
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index 063ca32b5..0c1512cfe 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -156,7 +156,8 @@ export function Canvas() {
group: null,
loopCount: st.loop.count,
loopItems: st.loop.items,
- loopActive: st.state === 'working'
+ loopActive: st.state === 'working',
+ loopKind: st.loop.kind
}
} as CanvasNode)
eEdges.push({
@@ -949,7 +950,10 @@ export function Canvas() {
case 'UserPromptSubmit':
cs.setState(e.nodeId, 'working')
an.clearForParent(e.nodeId) // new turn → drop the previous fan-out
- if (/^\s*\/loop\b/.test(e.prompt ?? '')) cs.setLoop(e.nodeId, true, e.prompt)
+ {
+ const m = (e.prompt ?? '').match(/^\s*\/(loop|schedule)\b/)
+ if (m) cs.setLoop(e.nodeId, true, m[1] as 'loop' | 'schedule', e.prompt)
+ }
break
case 'Stop':
cs.setState(e.nodeId, 'done')
diff --git a/src/renderer/nodes/LoopNode.tsx b/src/renderer/nodes/LoopNode.tsx
index 183ff8194..a7c965ad7 100644
--- a/src/renderer/nodes/LoopNode.tsx
+++ b/src/renderer/nodes/LoopNode.tsx
@@ -10,6 +10,7 @@ export function LoopNode({ data }: NodeProps<CanvasNode>) {
const count = (data.loopCount as number) ?? 0
const items = (data.loopItems as string[]) ?? []
const active = !!data.loopActive
+ const label = data.loopKind === 'schedule' ? 'Schedule' : 'Loop'
const [expanded, setExpanded] = useState(false)
const bodyRef = useRef<HTMLDivElement>(null)
@@ -27,7 +28,7 @@ export function LoopNode({ data }: NodeProps<CanvasNode>) {
style={{ cursor: 'pointer' }}
>
<span className="loop-node__dot" />
- <span className="loop-node__type">Loop</span>
+ <span className="loop-node__type">{label}</span>
<span className="loop-node__count">×{count}</span>
</div>
{data.title && !expanded && <div className="loop-node__task">{data.title as string}</div>}
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index a26739fc4..169c892c8 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -288,9 +288,12 @@ export function TerminalNode({ id, data, selected }: NodeProps<CanvasNode>) {
</span>
)}
{status?.loop && (
- <span className="term-node__status term-node__status--loop" title="Running /loop">
+ <span
+ className="term-node__status term-node__status--loop"
+ title={`Running /${status.loop.kind}`}
+ >
<span className="term-node__status-dot" />
- LOOP ×{status.loop.count}
+ {status.loop.kind === 'schedule' ? 'SCHEDULE' : 'LOOP'} ×{status.loop.count}
</span>
)}
{(status?.state === 'waiting' || status?.state === 'blocked') && (
diff --git a/src/renderer/state/claudeStatus.ts b/src/renderer/state/claudeStatus.ts
index e03e5f6de..cc977a715 100644
--- a/src/renderer/state/claudeStatus.ts
+++ b/src/renderer/state/claudeStatus.ts
@@ -16,8 +16,8 @@ export interface ClaudeNodeStatus {
session?: string
/** Claude session id (from hooks) — used to resume/branch the conversation. */
sessionId?: string
- /** Set when the node is running a /loop (heuristic); shown as a connected loop node. */
- loop?: { count: number; prompt?: string; items: string[] }
+ /** Set when the node is running /loop or /schedule (heuristic); shown as a connected node. */
+ loop?: { count: number; prompt?: string; items: string[]; kind: 'loop' | 'schedule' }
}
interface ClaudeStatusState {
@@ -30,8 +30,8 @@ interface ClaudeStatusState {
setSessionId(id: string, sessionId: string): void
markUnread(id: string): void
clearUnread(id: string): void
- /** Start (active=true, resets) or stop a /loop indicator. */
- setLoop(id: string, active: boolean, prompt?: string): void
+ /** Start (active=true, resets) or stop a /loop or /schedule indicator. */
+ setLoop(id: string, active: boolean, kind?: 'loop' | 'schedule', prompt?: string): void
/** Record a /loop iteration (count++ and append its summary). No-op if not looping. */
bumpLoop(id: string, message?: string): void
remove(id: string): void
@@ -123,10 +123,11 @@ export const useClaudeStatus = create<ClaudeStatusState>((set) => ({
return { byId }
}),
- setLoop: (id, active, prompt) =>
+ setLoop: (id, active, kind = 'loop', prompt) =>
set((s) => {
const prev = s.byId[id] ?? EMPTY
- if (active) return { byId: { ...s.byId, [id]: { ...prev, loop: { count: 0, prompt, items: [] } } } }
+ if (active)
+ return { byId: { ...s.byId, [id]: { ...prev, loop: { count: 0, prompt, items: [], kind } } } }
if (!prev.loop) return s
const { loop: _drop, ...rest } = prev
return { byId: { ...s.byId, [id]: rest } }