Skip to content

PostToolUse Hook -- allow rewriting tool_response #4635

@CamdenClark

Description

@CamdenClark

I'd really like to be able to run the PostToolUse hook

  "session_id": "abc123",
  "transcript_path": "/Users/.../.claude/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
  "cwd": "/Users/...",
  "hook_event_name": "PostToolUse",
  "tool_name": "Write",
  "tool_input": {
    "file_path": "/path/to/file.txt",
    "content": "file content"
  },
  "tool_response": {
    "filePath": "/path/to/file.txt",
    "success": true
  }
}```

Like so, and be able to rewrite the `tool_response` inside the PostToolUse hook.


```{
  "decision": "block" | undefined,
  "tool_response": { "filePath": "/path/to/file.txt", "success": false },
  "reason": "Explanation for decision"
}```

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions