trw_before_edit_hint
Provides codebase intelligence before editing a file, returning risk context and prior learnings to inform safe edits.
Instructions
Return cold-start codebase intelligence for file_path.
Use when an agent is about to edit a file and needs sidecar-backed risk context plus relevant prior learnings before reading broadly.
Sources:
trw-distill sidecar (tier-gated; requires team/pro/enterprise)
existing learnings via trw_recall (always)
Returns BeforeEditHintResult.model_dump() enriched by client tier.
NEVER raises — failure paths populate distill_status +
distill_action so the operator gets an actionable next step.
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>"
},
"name": "trw_before_edit_hint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cache_dir | No | ||
| file_path | Yes | ||
| repo_root | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||