claude-code: add PostToolUse hook for session rename suggestion
All checks were successful
Run nix flake check / flake-check (push) Successful in 1m57s
Periodic flake update / flake-update (push) Successful in 2m30s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 02:34:03 +01:00
parent 7e178bab15
commit 4f753b9fae

View File

@@ -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 <suggested-name>.'";
}
];
}
];
};
statusLine = {
type = "command";
command = ''input=$(cat); echo "$(basename "$(echo "$input" | jq -r '.workspace.current_dir')") | $(echo "$input" | jq -r '.model.display_name')"'';