Bug Description
The UserPromptSubmit hook event passes an empty string for the prompt field in the stdin JSON payload, regardless of what the user actually typed.
Steps to Reproduce
- Configure a hook in
~/.kimi/config.toml:
[[hooks]]
event = "UserPromptSubmit"
command = "/path/to/capture-script.sh"
timeout = 10
- Create a capture script that logs stdin:
#!/bin/bash
INPUT=$(cat)
echo "$INPUT" >> /tmp/kimi-hook-debug.log
- Open Kimi CLI, type any message (e.g., "hello world"), and submit.
Expected Behavior
The hook should receive the user's actual prompt text:
{"hook_event_name": "UserPromptSubmit", "session_id": "...", "cwd": "/Users/...", "prompt": "hello world"}
Actual Behavior
The prompt field is always an empty string:
{"hook_event_name": "UserPromptSubmit", "session_id": "a072f750-4106-4abc-86cd-1728396cd387", "cwd": "/Users/linnian", "prompt": ""}
Impact
Third-party integrations that rely on hook events to track user prompts (e.g., Vibe Island) cannot read the prompt content, making prompt-related features non-functional.
Environment
- Kimi CLI version: latest (kimi-for-coding powered by kimi-k2.5)
- OS: macOS (Darwin arm64)
- Config format:
~/.kimi/config.toml with [[hooks]] array syntax
Bug Description
The
UserPromptSubmithook event passes an empty string for thepromptfield in the stdin JSON payload, regardless of what the user actually typed.Steps to Reproduce
~/.kimi/config.toml:Expected Behavior
The hook should receive the user's actual prompt text:
{"hook_event_name": "UserPromptSubmit", "session_id": "...", "cwd": "/Users/...", "prompt": "hello world"}Actual Behavior
The
promptfield is always an empty string:{"hook_event_name": "UserPromptSubmit", "session_id": "a072f750-4106-4abc-86cd-1728396cd387", "cwd": "/Users/linnian", "prompt": ""}Impact
Third-party integrations that rely on hook events to track user prompts (e.g., Vibe Island) cannot read the prompt content, making prompt-related features non-functional.
Environment
~/.kimi/config.tomlwith[[hooks]]array syntax