memory_pre_edit
Run a guardrail check on a file and code snippet before writing. Get a STOP or PROCEED decision on NEVER-guardrail violations and FAILED_APPROACH warnings to avoid protected area errors.
Instructions
Pre-edit guardrail check for a specific file and code snippet. Given a file path and the code you're about to write, check whether it violates any NEVER guardrails or triggers FAILED_APPROACH warnings. Returns a clear STOP/PROCEED decision. Call this before writing to files in protected areas.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"code": "<code>"
},
"name": "memory_pre_edit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The code snippet you're about to write (added lines only) | |
| agent_id | No | Your agent identifier, e.g. 'claude-code' | |
| file_path | Yes | Repo-relative file path being edited |