Overview
Use this integration when you want Kiro to check native write operations against the decisions your team has recorded in Mneme. The hook covers write, fs_write, fsWrite, and fs_append calls made by Kiro's v3 engine, before the proposed change reaches disk.
What this does not cover: This integration currently covers Kiro's native v3 write tools only. It does not yet capture the starting state of a session or audit changes after it ends. It also cannot inspect writes performed through shell redirection or scripts, because those writes are not exposed as native Kiro tool calls.
How the check works
When Kiro starts a native file write, it sends the tool name and proposed content to the hook. Mneme compares the change being introduced with the architectural decisions recorded for the project. It does not judge unrelated, pre-existing content in the file.
That keeps the feedback specific. In strict mode, Mneme stops a conflicting write and explains why. In warn mode, it lets the write continue while leaving a warning in the agent's context. Use strict mode for decisions that must hold; use warn mode when introducing governance gradually.
For implementation details and the source code, see Mneme on GitHub.
When to use it
Use this integration when Kiro is making changes in a repository with decisions you want to preserve, such as approved frameworks, dependency rules, or architectural boundaries. It is a guardrail for Kiro's native write tools, not a general monitor for every way a file can change.
Installation
Install Mneme, then run the provided Kiro installer from the Mneme repository to add the pre-execution hook to your project:
pip install mneme-hq
python scripts/install_kiro.py [PROJECT_DIR]
Hook Configuration
To configure the hook manually, add this definition to your Kiro hooks configuration:
{
"version": "v1",
"hooks": [
{
"name": "mneme-governance-gate",
"trigger": "PreToolUse",
"matcher": "^(fs_write|fsWrite|write|fs_append)$",
"enabled": true,
"action": {
"type": "command",
"command": "mneme-kiro-hook"
},
"timeout": 30
}
]
}
Behavior & Exit Codes
Mneme reports the result through an exit code:
- Strict mode (exit 2): Writes the reason to stderr and blocks the change.
- Warn mode (exit 0): Writes a warning to stdout and allows the change.
- Operational failure (exit 0): Shows a notice and allows the change when Mneme cannot read the decision corpus.
Known Limitations
- CLI v2: Kiro v2 ignores blocking exit codes, so strict enforcement is not available.
- MCP tools: Mneme does not yet map Kiro's
@server/toolnames. - IDE 1.x: We have not validated IDE-initiated writes, so this page makes no support claim.