Skip to main content
Glama

pre_edit_decision_check

Check a code range for prior decisions and constraints before editing, surfacing intents and file-level rules that may affect your change.

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

TableJSON Schema
NameRequiredDescriptionDefault
endLineYesEnd line of the touched range (1-based, inclusive)
filePathYesPath to the file being edited (relative to repoPath)
intentIdNoActive intent ID for supersedes scoping. Auto-detected by Muninn when omitted.
repoPathYesLocal path to the repository root (also used to read the file for AST symbol detection)
startLineYesStart line of the touched range (1-based, inclusive)
forkAuthorNoFork attribution; usually resolved by Muninn automatically — pass only for override / testing.
repoOriginNoGit remote origin URL. Auto-detected from repoPath via git if not provided.
workspaceIdNoWorkspace identifier; usually resolved by Muninn automatically — pass only for override / testing.
sessionTokenNoSession 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.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, description fully discloses behavior: surfaces Tier 1a and 1b, filters overridden decisions, returns recommendation, and provides enclosing function symbol (with language limitations). All key traits are transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with main purpose, uses bullet points for clarity. Slightly verbose but every sentence adds value. Could be tightened slightly without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given complexity (9 params, nested objects, no output schema), description adequately covers return behavior and recommendations. Missing structured output schema is partially mitigated by textual description. Good overall completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds value by noting auto-detection for intentId, repoOrigin, forkAuthor, workspaceId, and sessionToken defaults. This context aids correct usage beyond schema definitions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb ('Check whether... has prior recorded reasoning attached') and specific resource ('line range about to be edited'). Differentiates from siblings by specifying it's a pre-edit semantic decision check, not a generic intent query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Call this BEFORE editing code' and mentions what is no longer covered (live-collaborator collisions). Provides recommendation mapping for actions. However, does not explicitly contrast with alternatives like get_intents_for_lines or when to skip this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/CodeAwareness/kawa.mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server