Repository navigation
Description
Existing issues
- I searched open issues and this is not already reported.
Related, but none of them covers this case:
- Make AI-DLC v2 a first-class, one-click experience in KiroCrew — builders shouldn't have to drop to a terminal #5462 is the AI-DLC request (parked). Its root cause was reported against the kiro-cli backend.
- feat(hooks): tell a claude or codex session its agent hooks do not run #19165 found that kiro-cli runs spec hooks over ACP. It added a "hooks do not run" notice for claude and codex only.
- Exercise the ACP hooks wire shapes against a live KAS agent once #13223 is the deferred KAS hooks wire work.
- Support project-level .kiro/hooks/*.kiro.hook (event-triggered hooks) in KiroCrew #1487 asks for project hook files in the legacy
.kiro.hookschema.
This report is about the KAS backend and the v3 JSON hook files that KAS itself reads.
KiroCrew version
0.11.0
Release channel
Not sure
How is it installed?
Desktop app
Platform
Not platform-specific
What happened
On the KAS backend, hooks from standalone hook files do not run in a dashboard session. This applies to the project's <project>/.kiro/hooks/*.json and to the user's ~/.kiro/hooks/*.json. The sessions I tested showed no notice in the chat. Crew's turn loop does not fire them either, because it fires only the agent spec's hooks field (ACP_BACKENDS_CREW_FIRES_SPEC_HOOKS). So these files run nowhere.
Opening the same project in a terminal with kiro-cli chat --agent-engine v3 runs them: all five probe triggers, the AI-DLC hooks and the user-level hooks. That terminal session uses the same kiro-cli 2.37.0 (KAS 0.66.70) and the same files.
Expected: a dashboard KAS session runs the same hooks that the same agent runs under kiro-cli chat --agent-engine v3. Failing that, the session should say that they will not run.
Impact: AWS AI-DLC v2 (tested with 2.11.2) ships its five hooks as standalone .kiro/hooks/aidlc-*.json files. As #5462 describes, its human-approval gates depend on the UserPromptSubmit hook aidlc-record-human-turn. In the dashboard KAS sessions I tested, that hook did not run, so those gates cannot see that the person replied. This is the #5462 symptom, now on KAS. I did not run a full gated workflow end to end. If KAS becomes the default backend, any AI-DLC user of the dashboard would be affected.
Evidence. Counts are ContextualHookInvoked records in each session's ~/.kiro/sessions/<hash>/<sess>/messages.jsonl. All five sessions record agentMode: "aidlc" and reference the same project (in B0 and B2 only through rootPaths; see the table):
| Session | Opened by | _meta.kiro.customAgents |
workspacePaths |
Hooks run |
|---|---|---|---|---|
| A | terminal kiro-cli chat (v3 session store, kiro-cli 2.36.0; terminal inferred from the absence of Crew-injected context) |
— | project | 17 |
| C | terminal kiro-cli chat --agent-engine v3 (2.37.0) |
— | project | 12 |
| B | dashboard, KAS (2.37.0) | 1 entry (aidlc) |
project | 0 |
| B2 | dashboard, KAS, new chat (2.37.0) | 1 entry | ~/.kiro/crew/workspace |
0 |
| B0 | dashboard, KAS (started around the 2.36.0 → 2.37.0 auto-update) | 1 entry | ~/.kiro/crew/workspace |
0 |
- C's 12 hooks are 4 project probe hooks, 4 AI-DLC hooks and 4 from a user-level
~/.kiro/hooks/*.json. In B, B2 and B0 the user-level file ran 0 times too, so this is not only about project files. - C shows that the same engine (kiro-cli 2.37.0 / KAS 0.66.70) runs these files when it is started from the terminal. What differs is the dashboard ACP path, not the engine version.
- In B, both the KAS process's cwd and the session's
workspacePathsare the project, and it still ran 0 hooks. - The workspace is trusted:
~/.kiro/workspace-roots/<hash>/permissions.yamlhasworkspaceTrusted: true. - The difference I can see in
session.jsonis that every dashboard session (B, B2, B0) carries the agent in_meta.kiro.customAgentsand has nomodeId,executionTargetorsettings. Both terminal sessions (A, C) carrymodeId: "aidlc",executionTargetand asettingsblock, and nocustomAgents. I cannot tell from outside whethercustomAgentsis the cause or just one symptom of "the client is Crew".
What the 0.11.0 source says:
acp/types.py(KAS_CLIENT_CAPABILITIES):hooksstays undeclared because "Kiro Crew's own turn loop already fires every hook event this surface can serve for a KAS session". In practice that covers spechooksonly.agent_sdk/backends_routing.py(ACP_BACKENDS_CREW_FIRES_SPEC_HOOKS): "KAS takes its agent over the wire and thecustomAgentsschema has no slot for them".acp/kas_agents.pylists"hooks"inUNSUPPORTED_SPEC_KEYS.- Exercise the ACP hooks wire shapes against a live KAS agent once #13223 says announcing
hookswould make KAS "stop loading the user's own.kiro/hooks/*.json". That reads as if KAS loads them while the capability is unannounced, but in acustomAgentssession it runs none of them.
Steps to reproduce
Environment: KiroCrew 0.11.0 desktop app, macOS 26.7.2, kiro-cli 2.37.0 (KAS 0.66.70). The project's .kiro/settings/cli.json sets "chat.agentEngine": "v3". Note that plain kiro-cli chat on 2.37.0 starts the v2 engine. There it could not find the project agent and also ran 0 hooks, so the --agent-engine v3 flag in step 4 matters.
Starting state: a trusted project (workspaceTrusted: true) with a Markdown agent in .kiro/agents/*.md that has no hooks field. Mine is .kiro/agents/aidlc-aidlc.md with frontmatter name: aidlc.
-
Add
.kiro/hooks/zz-probe.jsonto that project. This is a simplified version of the probe I used; mine also logged$PWDand capped stdin at 600 bytes:{ "version": "v1", "hooks": [ { "name": "probe-prompt", "trigger": "UserPromptSubmit", "action": { "type": "command", "command": "/bin/sh -c 'echo \"$(date +%T) UserPromptSubmit parent=$(ps -o comm= -p $PPID)\" >> /tmp/probe.log; cat >> /tmp/probe.log; echo >> /tmp/probe.log'" }, "timeout": 10 } ] }Optionally, add the same entry for
SessionStart,PreToolUse,PostToolUseandStop. Run the command once by hand to confirm it can write, then empty/tmp/probe.logbefore each session below. -
Select the KAS backend: Settings → Agent Harness → Kiro Agent (
agent.acp_backend: kas). Open a new chat on that project with that agent and ask it to rundate. I did not test a built-in agent. -
/tmp/probe.loggets no lines. -
Empty
/tmp/probe.log. In a terminal, runcd <project> && kiro-cli chat --agent-engine v3, check that the status line shows the agentaidlc, and ask it to rundate. -
/tmp/probe.lognow has an entry for each trigger you added. Asking fordatecovers all five, because the turn includes a tool call and ends with Stop. Each entry showsparent=…/kiro-cli/node, so KAS ran it. Each stdin carriessession_id,hook_event_nameandcwd, pluspromptortool_name/tool_input.
Observed in both dashboard KAS sessions I measured on 2.37.0. In B, an existing chat, I waited for the hook file to be picked up and then made several tool calls, a prompt and a turn end. B2 was a new chat that ran date once.
Relevant log output
Searching the gateway log for "hook" finds no line about these sessions or these files. The relevant difference between a dashboard session (B) and a terminal session (C) in session.json → _meta.kiro:
B (dashboard KAS): { "customAgents": [ { "id": "aidlc", "description": "...", "prompt": "...", "tools": ["read","write","shell","invoke_sub_agent","orchestrate_subagent"] } ] }
C (terminal v3): { "modeId": "aidlc", "executionTarget": { "kind": "local" }, "settings": { ... } }
Anything else
Possible approaches. Either of the first two would make the hooks run. The third only makes the gap visible until then.
- Have Crew's turn loop also fire standalone hook files for KAS sessions: the session project's
.kiro/hooks/*.jsonand~/.kiro/hooks/*.json, with the trigger, stdin and exit-code handling Crew already applies to spec hooks. Project files should only run in a trusted workspace. Tying them to KAS's workspace-trust decision may address the trust concern raised on Support project-level .kiro/hooks/*.kiro.hook (event-triggered hooks) in KiroCrew #1487. - Complete the deferred wire path from Exercise the ACP hooks wire shapes against a live KAS agent once #13223: announce
hooksand answer_kiro/hooks/list,_kiro/hooks/sessionStartand_kiro/hooks/executeHook(already inacp/kas_wire.py) from those files. - Meanwhile, extend the feat(hooks): tell a claude or codex session its agent hooks do not run #19165 notice to KAS, so a new session says when standalone hook files exist that this backend will not run.
Separately: a new dashboard KAS chat records workspacePaths: ["~/.kiro/crew/workspace"] and lists the project only in rootPaths (B0, B2). If project hook discovery uses workspacePaths, project hooks could stay blocked even after fix 1 or 2. I have not verified this.
Workaround today: run AI-DLC from a terminal with kiro-cli chat --agent-engine v3.
Also observed (happy to file separately):
- On
agent.acp_backend: kiro, a project-local Markdown agent (.kiro/agents/*.md) is not among the advertised modes; the list holds only user-level agents. The session is refused withAgent mode 'aidlc' is not available on this session. The failed runtime was already gone when I looked. Its sibling runtimes run askiro-cli acp --agent <view>with no--agent-engineflag and cwd~/.kiro/crew/workspace. - The gateway logs
Skipping oversized confined skill file: <project>/.kiro/skills/aidlc/SKILL.mdfor a 63,612-byte project skill, so the skill body is dropped. I found no trace of this outside that log line, and I could not find the size cap.
Activity
KiroCrewCaptain commentedon Oct 31, 2026
Thanks for the report. This issue has been triaged by Crew Captain and will be assigned to a maintainer, who will follow up here.
chenmingwei23 commentedon Oct 31, 2026
A draft PR for part of this is up: #26873.
It makes the user's own standalone
~/.kiro/hooks/*.jsonfiles run in a dashboard Kiro Agent (KAS) session, through the same hook path (and the same gates) the backend already uses, so they behave the waykiro-cli chat --agent-engine v3runs them. Onlycommandactions on the known triggers run; anything else is skipped.The project half —
<project>/.kiro/hooks/*.json— still does not run, and the PR does not change that. A project hook is a command from a checkout, and running it needs a workspace-trust decision that is a maintainer call rather than something this change should make on its own. For now a session with such project files shows a short notice saying they are withheld.bolichen97 commentedon Nov 5, 2026
[operator: bolichen97] Picking this up since it has been quiet for a while; @chenmingwei23 shout here if you are still on it.
bolichen97 commentedon Nov 5, 2026
[operator: bolichen97] #26873 makes your own
~/.kiro/hooks/*.jsonfiles run in a dashboard KAS session. The project half,<project>/.kiro/hooks/*.json, still does not run: running a command from a checkout needs a design sign-off from a maintainer, so this issue stays open for it.We keep this request open so that others can find it. It is not on the current plan. If you need it too, add a thumbs-up reaction to this issue; we look at the most requested items first.
CaiYirun commentedon Nov 7, 2026
+1 on the project half. Adding a concrete case where this is a blocker, not a nice-to-have.
Impact. Our team commits
.kiro/hooks/*.jsonto the repo as a mandatory part of the development process: a PreToolUse guard that blocks hand-editing generated files and risky commands such asoxlint --fix, and a Stop hook that lints and format-checks the files changed in each turn. In a Crew session (0.12.0, KAS backend) none of the project hooks run, so for anyone working through Crew the team's guardrails are silently absent. kiro-cli and the IDE run the same files after a workspace-trust prompt, so behaviour differs by tool.Cause.
acp/session_mcp.py::_project_mcp_trusted()always returnsFalse, and its docstring says that stays so until a consent exists. Nothing in settings or the dashboard changes the answer.Workaround we use. Copy the hooks into
~/.kiro/hooks/(which #26873 makes run) and call the repo scripts with a relative path guarded byif [ -f ./scripts/... ]. Two gotchas worth documenting:^(execute_bash|fs_write)$is silently dropped (log:matcher contains disallowed characters or is too long, skipping). Only[A-Za-z0-9_.*-]is accepted, so each tool needs its own entry.What would unblock us. A per-project consent in the dashboard (like the project-skills consent), or a config list such as
agent.trusted_project_dirs, so a user can explicitly allow.kiro/hooksfor a checkout they trust. Happy to test a build..kiro/hooks/*.jsonto run in dashboard sessions via a per-project trust consent #34395 as a duplicate of this issuewowzoo commentedon Nov 11, 2026
Re-measured on 0.12.1 (backend BUILD 20261026), macOS 26.7.3 arm64, kiro-cli 3.2.0, with AI-DLC's
kiro-idehooks (2.11.3 and a 2.11.4 preview):aidlc doctorsays "AIDLC hooks have not run in this project yet", and with AI-DLC's hook debug on, no hook record is written. This holds onagent.acp_backend: kasand onkiro. With a kiro-cli that offers v3, thekiropick runs on KAS anyway (KIRO_SELECTION_BACKEND,docs/coming-from-kiro-cli.md), so there is no backend to fall back to.~/.kiro/hooksmade Crew fire AgentSpawn, UserPromptSubmit and Stop. That is still not a workaround for AI-DLC, for two reasons:^(?!(?:read|…)$)), and gateway.log sayskiro_hooks[0]: matcher contains disallowed characters or is too long, skipping(the filter Config hook matchers drop the @server and @server/tool forms when the kiro-cli agent spec is written #29841 describes)./bin/sh: aidlc: command not found, because hook commands get the gateway's bare PATH (Hooks fired by Crew run with the gateway's bare PATH, so commands in ~/.local/bin or Homebrew are "not found" on the desktop app #35290).User-level files also fire in every other dashboard chat, Bots included, so I removed them again.
/aidlcrequest (it keeps the request and asks to continue underkiro-cli --v3).wowzoo commentedon Nov 23, 2026
Rechecked on 2026-11-22 with Kiro Crew 0.13.1 (desktop, macOS), KAS, kiro-cli 3.5.0 and AI-DLC 2.11.4. In a fresh project the selected folder agent declares no inline
hooks; its five v1 hook files are under.kiro/hooks/. The chat showed the standalone hook-files notice, offered no Turn on, and ran zero project hooks, so AI-DLC kept the first/aidlcrequest for a restart before the workflow began. Could the folder consent and command preview added in 0.13 also cover standalone<project>/.kiro/hooks/*.jsonfiles? (Putting the same hooks in the agent file is not an option for us: Kiro IDE ignores an agent that declareshooks.) This run stopped before any hook command ran, so it did not retest #35290.wowzoo commentedon Nov 27, 2026
@bolichen97 Here is a concrete design that extends 0.13's folder consent, using the fingerprint and checked scan now on
main, so it can be judged before anyone writes code. Line numbers are atmain74aab4b.Where it stands. Crew lists a checkout's standalone
.kiro/hooks/*.jsonfiles for the session notice (project_hook_file_names,agent_sdk/spec_hooks.py:801) but never loads them;user_hook_files(:886) reads only the user hooks directory. Since #33578, Crew does read a per-folder decision for commands from a checkout,project_hooks_consent.hooks_enabled(project_hooks_consent.py:257): the owner's Turn on / Turn off, else kiro-cli's saved workspace trust, else off. #40099 binds a Crewonto a fingerprint of the hooks it approved, andconsented_project_hooks(:269) returns the hooks from the same scan it checked, which its caller fires.Proposal. Let that same decision cover a folder's standalone hook files too, and keep every check those hooks already meet.
hooksarray to the scan behind the fingerprint (_scan,:128), and fire the files from the hooksconsented_project_hooksreturns for that checked scan. A folder without standalone files then keeps itson, and one with them asks again. A grant that still has no fingerprint should not adopt files it never covered; today a first read adopts the current scan (:206-213).user_hook_filesuses (command actions on the five triggers, the_MAX_SPEC_HOOKScap, the per-digest cache), confined to the checkout. Fire them with the standalone-file payload that~/.kiro/hooksfiles get, under a governance name of their own, so a checkout file cannot match a rule written for a personal hook. Unlike that loader, which skips a file it cannot parse, a consented file that cannot be read or parsed should block tool calls, as unreadable agent spec hooks do today (dashboard/chat_turn/turn_spec_hooks.py:1011). On channel turns they should behave like a folder agent's own hooks, not like~/.kiro/hooksfiles, which a turn without the Hooks page's hooks leaves out of its observer events (messaging/tool_hooks.py:86).ProjectHooksNotice) for a folder with standalone files even when the selected agent declares nohooks; today that row needs a folder agent with non-emptyhooks(agent_sdk/kas_project_hooks.py:87). The preview should list the commands from both sources, and when kiro-cli's trust starts them, the once-per-folder notice with Turn off should say so.pre_tool_hook_matchers(acp/kas_agents.py:1367) takes no checkout today, so a session in another folder must not inherit them. The same holds for sub-agent, channel and task-runner turns.Out of scope: hook PATH (#35290, #41132), hashing the scripts a hook runs, and Windows paths (#27853). The matcher grammar stays a separate point, as you said in #34395, but it is the next thing AI-DLC's own files would hit: its guard and sub-agent matchers are regular expressions (one is 203 characters), and the converter accepts only names and globs up to 200 characters (
agent_materialization/kiro_hooks.py:49), so those two hooks would be dropped even with consent. I measured that drop on 0.13.1 when I copied the same hooks into a folder agent.What I measured meanwhile. With a lab AI-DLC harness that uses only what 0.13.1 offers today (a folder agent with
hooks, Turn on, sub-agents throughinvoke_sub_agent), an express and a feature workflow each ran once to the build-and-test gate in a KAS dashboard chat. So the hook path works; this proposal is about letting the shipped Kiro distribution use it without a KiroCrew-only layout.One question. A Crew
onis bound to the hook definitions, but kiro-cli's trust is saved per path, so under kiro-cli's trust alone an edited file would run without a new click. #33578 accepted that for the selected agent's own hooks. Should kiro-cli's saved trust also start standalone hook files, including when the selected agent declares nohooks, or should these files need an explicit Turn on in Crew?sssjjf commentedon Nov 27, 2026
In the latest version(0.13.1) of Kirovcrew, this issue still exists. When I set a project level hook, in the Kirocrew dashboard session, this hook will never run and display information “This project has hook files in .kiro/hooks that do not run in this session: Crew cannot read this backend's workspace-trust decision, so it does not run commands from a project checkout. Your own ~/.kiro/hooks files still run.“
I think it is very necessary to trust project level hooks and unify the behavior of kiro cli, kiro ide, and kirocrew
buluoray commentedon Dec 4, 2026
Draft fix for the project half: #46918. A folder's own
.kiro/hooks/*.jsonfiles run on KAS after Turn on for that folder in Crew; kiro-cli's trust alone does not start them. With AI-DLC's five Kiro hook files, SessionStart, UserPromptSubmit and Stop run after Turn on. Its PreToolUse guard and sub-agent log hook use regex matchers, which are still dropped: tracked in #46900.buluoray commentedon Dec 4, 2026
Decision on the KAS project hook files notice (#26568, #46918). This supersedes in part the 2026-11-22 ruling on #37944 (#37944 (comment)).
.kiro/hooks/*.jsonfiles run under the same trust as a project agent file's hooks (feat(kas): run a folder agent's own hooks when the folder is turned on or trusted in kiro-cli #33578, decision C): the owner's Turn on in Kiro Crew, bound to a fingerprint of the hooks, or kiro-cli's trust of the folder. This matches kiro-cli, which runs them in a trusted folder.agent filedropped and the verb agreeing with the subject (givesfor one source,givefor two). Rows already in a chat's history keep their Dismiss link.the project's .kiro/hooks files could not be read, and the row readsKiro Crew can't read {path}, so tool calls here are blocked. Turn off to unblock. kiro-cli is not affected.It offers only Turn off.mcp.protect_kiro_permission_ruleskeeps the agent's file-edit tools from writing that record.Rows before and after: https://github.com/user-attachments/assets/48ef1292-a4ff-4457-b70c-06f535379005, https://github.com/user-attachments/assets/889e2901-2409-487e-b5fc-582a3ba908cd. Blocked row: https://github.com/user-attachments/assets/5c68d0b9-4594-45b6-91c2-e39b4114d0c3, https://github.com/user-attachments/assets/ee282591-3fbe-48a8-b30c-fd996cf47a85.
buluoray commentedon Dec 4, 2026
Follow-up to #26568 (comment): the blocked row's wording in #46918 changed after that review.
Kiro Crew can't read {path}: {reason}. Tool calls here are blocked until it can. kiro-cli is not affected.{path}is the first file that did not read, relative to the folder;{reason}is the operating system's short reason (for examplePermission denied), and the: {reason}part is left out when there is none.the project's {path} could not be read: {reason}.docs: record that a folder's .kiro/hooks files run on kas after turn …