list_affected
Reports which stored memories a git diff puts at risk by touching their anchored code files; use it before or after code changes to find memories needing review.
Instructions
Report which stored memories a git diff puts at risk because it touches a code file they are anchored to -- the proactive half of invalidation. Returns {"data": [{"id", "statement", "reason"}], "matched": N}; each reason names the offending path and diff source, e.g. path_changed:src/scanner.py@working_tree. Terminal-status memories (superseded/invalidated/abandoned/archived) are excluded -- already history. Use it when you are about to change, or have just changed, code and want to know which memories that change endangers: it is diff-driven, mapping a code delta to the memories that depend on it -- unlike retrieve_context (natural-language task -> context pack) and search_memory (keyword query). Runs the staleness refresh first, so drift already committed is flagged before the diff-scoped report.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list_affected"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| staged | No | Inspect only staged changes (`git diff --cached`). Ignored if `diff_range` is set. | |
| working | No | Inspect only unstaged working-tree changes (`git diff`). Ignored if `diff_range` is set. When `diff_range`, `staged`, and `working` are all omitted, staged and unstaged changes are inspected together (`git diff HEAD`). | |
| diff_range | No | Optional committed range in git syntax, e.g. 'HEAD~3..HEAD'. Memories are compared against the range's end content. Takes precedence over `staged`/`working` if more than one is given. |