Skip to content

[Bug] UserPromptSubmit hook event sends empty prompt field #1779

@Sibuxiangx

Description

@Sibuxiangx

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

  1. Configure a hook in ~/.kimi/config.toml:
[[hooks]]
event = "UserPromptSubmit"
command = "/path/to/capture-script.sh"
timeout = 10
  1. Create a capture script that logs stdin:
#!/bin/bash
INPUT=$(cat)
echo "$INPUT" >> /tmp/kimi-hook-debug.log
  1. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions