From 4f753b9fae890fdac220c1a9f261bf554060955a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 8 Mar 2026 02:34:03 +0100 Subject: [PATCH] claude-code: add PostToolUse hook for session rename suggestion Co-Authored-By: Claude Opus 4.6 --- home/programs/claude-code/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/home/programs/claude-code/default.nix b/home/programs/claude-code/default.nix index 14c4876..ece14df 100644 --- a/home/programs/claude-code/default.nix +++ b/home/programs/claude-code/default.nix @@ -46,6 +46,19 @@ "Read(~/.ssh/*)" ]; }; + hooks = { + PostToolUse = [ + { + matcher = "EnterPlanMode"; + hooks = [ + { + type = "command"; + command = "echo 'A plan is being created. If this session has not been renamed yet, suggest a concise, descriptive session name based on the conversation so far and ask the user to run /rename .'"; + } + ]; + } + ]; + }; statusLine = { type = "command"; command = ''input=$(cat); echo "$(basename "$(echo "$input" | jq -r '.workspace.current_dir')") | $(echo "$input" | jq -r '.model.display_name')"'';