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): session-name chip + Cmd+K content search

enes7c96929c34b8
diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsx
index 3dc8cf34d..656b17ff9 100644
--- a/src/renderer/canvas/Canvas.tsx
+++ b/src/renderer/canvas/Canvas.tsx
@@ -75,6 +75,9 @@ export function Canvas() {
const [zoomPct, setZoomPct] = useState(100)
const [menu, setMenu] = useState<{ x: number; y: number; items: MenuItem[] } | null>(null)
const [paletteOpen, setPaletteOpen] = useState(false)
+ // Cached visible-buffer text per terminal, for command-palette content search.
+ const [bufferCache, setBufferCache] = useState<Record<string, string>>({})
+ const captureTsRef = useRef<Record<string, number>>({})
const [settingsOpen, setSettingsOpen] = useState(false)
const [scOpen, setScOpen] = useState(false)
const [shortcutsOpen, setShortcutsOpen] = useState(false)
@@ -730,6 +733,35 @@ export function Canvas() {
useEffect(() => window.nodeTerminal.onFocusNode(focusNodeById), [focusNodeById])
+ // When the palette opens, capture each terminal's visible buffer (cached ~3s) so the
+ // search can match text shown in terminals/Claude sessions.
+ useEffect(() => {
+ if (!paletteOpen) return
+ const now = Date.now()
+ const stale = nodesRef.current.filter(
+ (n) => n.type === 'terminal' && now - (captureTsRef.current[n.id] ?? 0) > 3000
+ )
+ if (!stale.length) return
+ let cancelled = false
+ void Promise.all(
+ stale.map(async (n) => [n.id, await window.nodeTerminal.pty.capture(n.id)] as const)
+ ).then((pairs) => {
+ if (cancelled) return
+ const ts = Date.now()
+ setBufferCache((prev) => {
+ const next = { ...prev }
+ for (const [id, text] of pairs) {
+ next[id] = text
+ captureTsRef.current[id] = ts
+ }
+ return next
+ })
+ })
+ return () => {
+ cancelled = true
+ }
+ }, [paletteOpen])
+
// One-time consent: the first time a Claude turn finishes in the background, ask whether
// to enable completion notifications (default off until accepted).
const anyUnread = useClaudeStatus((s) => Object.values(s.byId).some((v) => v.unread))
@@ -823,17 +855,24 @@ export function Canvas() {
run: () => switchProject(p.id)
})
)
+ const cs = useClaudeStatus.getState()
nodesRef.current
.filter((n) => n.type !== 'group')
- .forEach((n) =>
+ .forEach((n) => {
+ const tags = (n.data.tags as string[]) ?? []
+ const isClaude = tags.includes('claude')
+ const session = isClaude ? cs.byId[n.id]?.session : undefined
cmds.push({
id: `node-${n.id}`,
label: `Go to ${n.data.title}`,
- hint: ((n.data.tags as string[]) ?? []).join(' '),
+ hint: [tags.join(' '), session, isClaude ? `nt-${n.id}` : '']
+ .filter(Boolean)
+ .join(' '),
icon: <IconJump />,
+ content: bufferCache[n.id],
run: () => goToNode(n)
})
- )
+ })
return cmds
}, [
addTerminal,
@@ -844,7 +883,8 @@ export function Canvas() {
fitView,
persist,
switchProject,
- goToNode
+ goToNode,
+ bufferCache
])
return (
diff --git a/src/renderer/components/CommandPalette.tsx b/src/renderer/components/CommandPalette.tsx
index c91d186bf..ff133b01c 100644
--- a/src/renderer/components/CommandPalette.tsx
+++ b/src/renderer/components/CommandPalette.tsx
@@ -7,6 +7,8 @@ export interface Command {
hint?: string
section?: string
icon?: ReactNode
+ /** Searchable body text (e.g. a terminal's visible output) — matched by substring. */
+ content?: string
run: () => void
}
@@ -33,8 +35,13 @@ export function CommandPalette({ commands, onClose }: CommandPaletteProps) {
const [query, setQuery] = useState('')
const [active, setActive] = useState(0)
+ // Fuzzy-match label+hint; also substring-match the body text (e.g. terminal output).
+ const contentHit = (c: Command) =>
+ query.length >= 2 && !!c.content && c.content.toLowerCase().includes(query.toLowerCase())
+ const labelHit = (c: Command) => matches(`${c.label} ${c.hint ?? ''}`, query)
+
const filtered = useMemo(
- () => commands.filter((c) => matches(`${c.label} ${c.hint ?? ''}`, query)).slice(0, 50),
+ () => commands.filter((c) => labelHit(c) || contentHit(c)).slice(0, 50),
[commands, query]
)
@@ -83,7 +90,11 @@ export function CommandPalette({ commands, onClose }: CommandPaletteProps) {
>
<span className="palette__icon">{c.icon}</span>
<span className="palette__label">{c.label}</span>
- {c.hint && <span className="palette__hint">{c.hint}</span>}
+ {!labelHit(c) && contentHit(c) ? (
+ <span className="palette__hint">found in output</span>
+ ) : (
+ c.hint && <span className="palette__hint">{c.hint}</span>
+ )}
</button>
))}
</div>
diff --git a/src/renderer/nodes/TerminalNode.tsx b/src/renderer/nodes/TerminalNode.tsx
index f695ed052..7d0197dec 100644
--- a/src/renderer/nodes/TerminalNode.tsx
+++ b/src/renderer/nodes/TerminalNode.tsx
@@ -88,6 +88,16 @@ export function TerminalNode({ id, data, selected }: NodeProps<CanvasNode>) {
? createClaudeBusyDetector((busy) => onBusyChange(busy))
: null
if (detector) cleanups.push(term.onBell(() => detector.bell()).dispose)
+ if (isClaude) {
+ // Claude sets the terminal title to the conversation topic; surface it as a chip.
+ // Ignore path/prompt-like titles (e.g. "user@host: ~/dir") which aren't session names.
+ cleanups.push(
+ term.onTitleChange((t) => {
+ const title = t.trim()
+ if (title && !/[/:~]/.test(title)) useClaudeStatus.getState().setSession(id, title)
+ }).dispose
+ )
+ }
transport
.create({ cols: term.cols, rows: term.rows, shell: data.shell, cwd: data.cwd, persistKey: id })
@@ -273,6 +283,11 @@ export function TerminalNode({ id, data, selected }: NodeProps<CanvasNode>) {
{data.title || 'Untitled'}
</span>
)}
+ {isClaude && status?.session && status.session !== data.title && (
+ <span className="term-node__session" title={status.session}>
+ {status.session}
+ </span>
+ )}
{isClaude && status?.busy && (
<span className="term-node__status term-node__status--busy" title="Claude is working">
<span className="term-node__status-dot" />
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 2e7358839..08642e475 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -461,6 +461,21 @@ body,
flex: 1;
}
+/* Claude session name shown beside the editable terminal title. */
+.term-node__session {
+ margin-left: 8px;
+ max-width: 180px;
+ padding: 1px 8px;
+ flex-shrink: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ font-size: 11px;
+ color: var(--muted);
+ background: rgba(255, 255, 255, 0.06);
+ border-radius: 6px;
+}
+
/* Claude Code status: RUNNING badge while working, unread dot when finished. */
.term-node__status {
display: inline-flex;