Skip to content

Commit ed37348

Browse files
L-jasmineclaude
andcommitted
Forward AI output from Stop hook to keyboard display
The Stop event now includes last_assistant_message from Claude's response, showing the AI's final output on the device instead of just a generic [stopped] message. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 3025b9e commit ed37348

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ async fn handle_hook() -> anyhow::Result<()> {
135135
let prompt = hook["prompt"].as_str().unwrap_or("");
136136
format!("[user] {}", truncate(prompt, 80))
137137
}
138-
"Stop" => "[stopped]".to_string(),
138+
"Stop" => {
139+
let msg = hook["last_assistant_message"].as_str().unwrap_or("");
140+
if msg.is_empty() {
141+
"[stopped]".to_string()
142+
} else {
143+
format!("[done]\n{}", truncate(msg, 150))
144+
}
145+
}
139146
"Notification" => {
140147
let msg = hook["message"].as_str().unwrap_or("");
141148
format!("[notify] {}", truncate(msg, 80))

0 commit comments

Comments
 (0)