Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

IDE: setting to hide or collapse hook execution messages in chat

Open apackeer opened this issue 4 months ago • 9 comments

Kiro Product

IDE

Feature Description

When agent hooks are registered, every hook fire renders a "Run Command Hook" line in the chat panel. There is currently no way to reduce or suppress these lines: the Agent Hooks panel only offers a full enable/disable per hook (eye icon / "Hook Enabled" switch), and the Agent: Notifications settings only cover Action Required / Success / Failure toasts, not per-hook chat lines.

For setups that use lifecycle hooks heavily (UserPromptSubmit, PreToolUse, PostToolUse, Stop), a single prompt can produce several hook lines, and a multi-tool agent turn can produce dozens. The chat becomes dominated by hook noise, and the actual conversation is hard to follow.

Suggested feature: a setting (global and/or per hook) to control hook execution visibility in chat, for example:

  • hooks.showExecutionMessages: always | failuresOnly | never, or
  • a per-hook "quiet": true field in the hook JSON, or
  • collapsing consecutive hook lines into a single expandable "N hooks ran" row.

Failures (non-zero exit) should arguably stay visible regardless, so failuresOnly feels like the right default for a quiet mode.

Use Case

I use hooks heavily in my workflow to control the agent: context injection on prompt submit, PreToolUse guards, PostToolUse audit logging and follow-up steps, subagent tracking, and a Stop hook. Hooks like these are infrastructure: they should run silently on success. With the current behavior, every prompt and every tool call adds hook lines to the chat, which overwhelms the conversation view. Disabling the hooks is not an option because they enforce guarantees the workflow depends on.

This applies to any hook-heavy setup (linting on save, audit trails, context injection, guardrails), not just mine: the more useful the hooks, the noisier the chat.

Additional Context

Prior art: comparable agent tools all keep successful hook executions out of the conversation by default, surfacing only failures.

  • Claude Code: successful hooks are silent; stdout goes to the debug log (only UserPromptSubmit/SessionStart stdout is injected as context, still without an execution line). Failures show a "<hook> hook error" line in the transcript. (code.claude.com/docs/en/hooks, "Hook output")
  • Cursor: hook executions produce no chat lines; hook activity is inspected through the Hooks tab under Customize and a dedicated Hooks output channel. (cursor.com/docs/agent/hooks)
  • OpenAI Codex CLI: exit 0 with no output continues silently; a hook can opt in to a visible line via its statusMessage field; failures are reported with a pointer to /hooks. (learn.chatgpt.com/docs/hooks)
  • opencode: plugin event handlers (tool.execute.before/after etc.) run silently unless the plugin explicitly raises a toast.

Kiro is the outlier in rendering a line per hook execution in the conversation itself. The failuresOnly behavior suggested above would match what these tools already do.

Other notes:

  • Related but distinct: #4558 covers the CLI's equivalent noise ("N of N hooks finished" status lines) corrupting terminal output. This request is about the IDE chat UI, and is a feature request (visibility control) rather than a rendering bug.
  • Hooks that exit 0 already keep their stdout private per the lifecycle hook docs; this request is only about the "Run Command Hook" execution line itself.
  • Observed on Kiro IDE 1.0.116 on macOS.

apackeer avatar Jul 30 '26 02:07 apackeer

Thanks for opening this issue and for the detailed write-up! The idea of being able to control or collapse hook execution messages in chat — especially for hook-heavy workflows where the noise can overwhelm the actual conversation — makes a lot of sense. A maintainer will review this shortly. We appreciate you taking the time to outline the use case and suggested approaches so clearly! 🙌

github-actions[bot] avatar Jul 30 '26 02:07 github-actions[bot]

  • On the long AI DLCv2 runs the chat window gets temporary overloaded with hook messages from subagents, which are getting to the main chat log instead of agent's expander. After the subagent stops working, all the hook messages disappear from the main chat log.

migh000 avatar Jul 30 '26 08:07 migh000

Amongst the suggestions for building this feature offered in the issue description, I'd vote for "a per-hook "quiet": true field in the hook JSON"

raj-jain-dev avatar Aug 02 '26 05:08 raj-jain-dev

+1, and a vote for @raj-jain-aws's per-hook "quiet": true field over a global setting. Having the flag live in the hook JSON means whoever installs a hook can mark it quiet at install time, while hand-written hooks stay visible and loud by default — which is the right split when a chat mixes both.

We run lifecycle hooks we don't control the visibility of, and the cards genuinely disturb the conversation: a single turn can bury the actual response. There's no client-side workaround today.

One technical note that may be useful: the Approve / Cancel controls and the "Command output" disclosure are rendered inside the same .kiro-hook-card element as the success line, so this can't be solved at the styling layer, the visible/hidden decision has to happen where the card is built.

And a semantics request: please keep failures and blocked outcomes visible regardless of the flag. A PreToolUse hook that blocks an action still needs to be explainable. quiet should mean "don't announce successful runs," not "never show me this hook."

Is there any update on this request status?

ortal-pa avatar Aug 23 '26 13:08 ortal-pa

+1, with moderate hook use the chat session becomes unusable without having the ability to suppress output related to hook execution. Please give us options in some form.

bhops avatar Aug 28 '26 13:08 bhops

Thanks for raising this. The ability to hide or suppress hook execution cards in the chat panel is a real quality-of-life gap for setups with many active hooks. We're tracking this as a feature request.

AnilMaktala avatar Sep 18 '26 14:09 AnilMaktala

hey @AnilMaktala how is this feature request progressing? this would be really helpful for not cluttering the chats

sagi1003 avatar Nov 16 '26 09:11 sagi1003

@AnilMaktala I'm following this thread for few months now - is there any update on this request status? For an environment with a lot of hooks it makes the chat not usable. Please give us an update

itayov avatar Nov 16 '26 09:11 itayov

+1 from Kiro IDE 1.4.236 on Windows. One more data point, and a vote on the design.

I use several guard hooks on PreToolUse (checks that run before a tool call and only matter when they block or ask for confirmation). In a single agent turn the chat shows one separate "Run Command Hook" card for each of them, so four cards in a row, each with the same label and only the hook's description telling them apart. When all checks pass, the cards say nothing the user can act on, and they push the actual work out of view.

What would work for this case:

  • Failures, blocks and confirmation prompts stay visible. Successful runs are hidden or folded. This matches the failuresOnly option suggested in the description above.
  • A per-hook "quiet": true in the hook JSON, as suggested by others here, so hooks installed from elsewhere can be quiet while hand-written ones stay visible.
  • Failing both, collapse consecutive hook cards of one tool call into one expandable row ("4 hooks ran").

Other agent tools have the same complaint, for example a request to hide or collapse successful hook lines in Claude Code (anthropics/claude-code#101644). Also related: #11196, which asks for the same on the audit-hook side.

kkkemit avatar Nov 20 '26 15:11 kkkemit