You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suggestion: option to hide UserPromptSubmit hook output from TUI #897
When using the UserPromptSubmit hook to inject context into the LLM (e.g., memory recall, tool discovery), the hook's stdout output is always displayed in the TUI wrapped in <hook_result hook_event="UserPromptSubmit">. This adds visual noise for the user, since this context is meant for the AI, not for the human reading the terminal.
In contrast, Claude Code handles this better: hook output via additionalContext is injected as <system-reminder> blocks that are visible to the AI but hidden from the TUI display, keeping the terminal clean.
Suggestion
Add a config option (either in config.toml under [[hooks]] or as a global TUI setting) to suppress the display of UserPromptSubmit hook stdout in the TUI, while still injecting it into the LLM context.
Something like:
[[hooks]]
event = "UserPromptSubmit"command = "./my-hook.sh"suppress_tui_display = true# <-- new option: inject into context but hide from TUI
Or alternatively, a global TUI setting:
[tui]
show_hook_output = false
This would allow users to use hooks for context injection without cluttering the terminal with <hook_result> blocks on every turn.
Additional information
I checked the existing issues and didn't find a similar request. The hooks feature is still in Beta, so adding this toggle early would make it easier for users to adopt hooks for context injection without sacrificing TUI cleanliness.
Hi, I have a follow-up question regarding the current UserPromptSubmit hook behavior.
Currently, the hook's stdout is not only displayed in the TUI but also appended to the conversation history as a user message. This means every turn adds another hook_result block to the context, causing the injected content (current time, cwd, tool suggestions, memories, etc.) to accumulate over time.
Is this accumulation in the conversation history the intended behavior?
For comparison, Claude Code handles similar injections via system-reminder blocks that are replaced each turn rather than appended, so the model always sees the latest context without historical copies piling up.
It would be great if Kimi Code could support a similar silent/replace injection mode for hooks, where the output is visible to the model but not accumulated in history. Thanks!
I can take a narrow version of this: add a per-hook suppress_tui_display option for UserPromptSubmit allow-output. The hook output will still be injected into context, but it won't emit a visible hook result / replay entry. Blocking hook results should still stay visible.
Context accumulation across turns — From the PR description, it looks like the suppressed output is still kept in the model context and appended turn after turn, rather than being replaced each turn. Is that the intended design?
If (2) is intentional, I’m happy to open a separate issue to discuss it. The use case is that UserPromptSubmit hooks often inject the same kinds of context (cwd, tool lists, memory snippets) on every turn, and over a long session the duplicated blocks can push useful conversation history out of the context window. Claude Code handles this by replacing the injected blocks each turn (via system-reminder-style context), so only the latest snapshot is present.
Thanks again for the quick turnaround on the display side!
Activity
xiepengqi commentedon Jun 19, 2026
Hi, I have a follow-up question regarding the current UserPromptSubmit hook behavior.
Currently, the hook's stdout is not only displayed in the TUI but also appended to the conversation history as a user message. This means every turn adds another hook_result block to the context, causing the injected content (current time, cwd, tool suggestions, memories, etc.) to accumulate over time.
Is this accumulation in the conversation history the intended behavior?
For comparison, Claude Code handles similar injections via system-reminder blocks that are replaced each turn rather than appended, so the model always sees the latest context without historical copies piling up.
It would be great if Kimi Code could support a similar silent/replace injection mode for hooks, where the output is visible to the model but not accumulated in history. Thanks!
tt-a1i commentedon Jun 20, 2026
I can take a narrow version of this: add a per-hook
suppress_tui_displayoption forUserPromptSubmitallow-output. The hook output will still be injected into context, but it won't emit a visible hook result / replay entry. Blocking hook results should still stay visible.xiepengqi commentedon Jun 22, 2026
@TT-ali Thanks for picking this up so quickly — the
suppress_tui_displayoption in #929 looks like exactly what we need for the TUI noise problem.I reviewed the PR description and want to separate two concerns:
If (2) is intentional, I’m happy to open a separate issue to discuss it. The use case is that
UserPromptSubmithooks often inject the same kinds of context (cwd, tool lists, memory snippets) on every turn, and over a long session the duplicated blocks can push useful conversation history out of the context window. Claude Code handles this by replacing the injected blocks each turn (via system-reminder-style context), so only the latest snapshot is present.Thanks again for the quick turnaround on the display side!