diff --git a/src/lib/layout/LeafPane.tsx b/src/lib/layout/LeafPane.tsx index 7b7a764..2e0a3ce 100644 --- a/src/lib/layout/LeafPane.tsx +++ b/src/lib/layout/LeafPane.tsx @@ -22,6 +22,12 @@ import "./LeafPane.css"; const IDLE_THRESHOLD_MS = 5000; +/** Only show the context indicator when the matched claude session has been + * written recently — i.e. claude is actually live in (or just used in) this + * pane's directory. Without this, a plain bash pane sitting in a directory + * that once had a claude session lights up with that session's stale context. */ +const CONTEXT_ACTIVE_MS = 10 * 60 * 1000; + /** How far past a viewport edge the cursor must travel before a release is * treated as "drag pane out of window" instead of "drop on empty space * inside this window". Picked so an accidental release on the OS titlebar @@ -419,10 +425,16 @@ export default function LeafPane({ leaf }: { leaf: LeafNode }) { })(); const matchCwd = liveCwd ?? leaf.cwd; - const ctx = + const matchedCtx = leaf.shellKind === "wsl" && matchCwd ? orch.paneContext.get(matchCwd) : undefined; + // Suppress stale matches: only surface the bar while the session is actively + // being written (a live claude keeps its transcript fresh). + const ctx = + matchedCtx && Date.now() - matchedCtx.lastActiveMs < CONTEXT_ACTIVE_MS + ? matchedCtx + : undefined; return (