pre_edit_decision_check
Check the line range for prior recorded decisions before editing code. Surfaced intents and constraints determine if you can proceed, need to review, or must investigate upstream.
Instructions
Check whether the line range about to be edited has prior recorded reasoning attached.
Call this BEFORE editing code in a kawa-indexed repo. Surfaces:
Tier 1a — overlapping intents whose blocks cover these lines (line-precise team coordination + intent-scoped decisions)
Tier 1b — repo decisions whose relatedFiles include this file (file-coarse, catches infer_history-extracted constraints)
(Live-collaborator code-collision awareness is no longer reported here — it now arrives once per turn at the Stop hook. This tool is purely the semantic, decision-based check.)
Decisions already overridden via record_decision(supersedes=...) are filtered out automatically.
Recommendation maps to action:
"proceed" — nothing relevant; safe to edit
"review" — surfaced context worth inspecting before editing
"investigate-upstream" — prior constraint or abandoned approach matches; don't proceed without reading the rationale and either revising the change or recording a new fork decision that supersedes the old one
Also returns the smallest enclosing function/method symbol via tree-sitter (Rust/TS/JS/Python only; null for other languages) for warning readability.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endLine | Yes | End line of the touched range (1-based, inclusive) | |
| filePath | Yes | Path to the file being edited (relative to repoPath) | |
| intentId | No | Active intent ID for supersedes scoping. Auto-detected by Muninn when omitted. | |
| repoPath | Yes | Local path to the repository root (also used to read the file for AST symbol detection) | |
| startLine | Yes | Start line of the touched range (1-based, inclusive) | |
| forkAuthor | No | Fork attribution; usually resolved by Muninn automatically — pass only for override / testing. | |
| repoOrigin | No | Git remote origin URL. Auto-detected from repoPath via git if not provided. | |
| workspaceId | No | Workspace identifier; usually resolved by Muninn automatically — pass only for override / testing. | |
| sessionToken | No | Session scope for the force-override cache. Defaults to the MCP server's SESSION_ID; PreToolUse hook callers should pass Claude Code's session_id so writes from one process are visible to the other. |