MoonshotAI / MoonshotAI/kimi-cli
[Bug] UserPromptSubmit hook event sends empty prompt field
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 11.4k
- Forks
- 1.3k
- Avg merge
- 9h 47m
- Merged PRs (30d)
- 2
Description
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.tomlwith[[hooks]]array syntax
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the UserPromptSubmit hook dispatch and the code that constructs the stdin JSON payload; the issue does not name source files. Reproduce with the ~/.kimi/config.toml hook and capture script, then verify that the submitted text appears in the prompt field.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100