From a09567849f03334e4e44f28b274ab5558fd99921 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 8 Apr 2026 21:02:44 -0400 Subject: [PATCH] Fix tmux pane injection: don't scan globally for claude panes poc-daemon was using find_claude_pane() which scans ALL tmux panes for a 'claude' process, potentially finding unrelated sessions. Now only uses the pane ID set by poc-hook via the user/response RPC calls. If no pane is set yet, injection is skipped. Co-Authored-By: Proof of Concept --- src/claude/idle.rs | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/claude/idle.rs b/src/claude/idle.rs index 43e536b..b68225d 100644 --- a/src/claude/idle.rs +++ b/src/claude/idle.rs @@ -78,13 +78,10 @@ impl State { pub fn send(&self, msg: &str) -> bool { let pane = match &self.claude_pane { Some(p) => p.clone(), - None => match tmux::find_claude_pane() { - Some(p) => p, - None => { - info!("send: no claude pane found"); - return false; - } - }, + None => { + info!("send: no claude pane set (waiting for hook)"); + return false; + } }; let ok = tmux::send_prompt(&pane, msg); let preview: String = msg.chars().take(80).collect(); @@ -131,10 +128,7 @@ impl State { self.inner.decay_ewma(); self.inner.notifications.ingest_legacy_files(); - // Find pane if we don't have one - if self.claude_pane.is_none() { - self.claude_pane = tmux::find_claude_pane(); - } + // Pane is set by poc-hook on user/response events — don't scan globally // Sleep mode if let Some(wake_at) = self.inner.sleep_until {