[FEATURE] Edit tool diff view should show the enclosing class declaration and function signature

Resolved 💬 1 comment Opened May 2, 2026 by AlphaCactus Closed Jun 1, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When the Edit tool displays a diff, it shows the file path and the changed lines but no context information about where in the file the change is. For object-oriented codebases, this means the diff gives no indication of which class or method is being changed, you lose extends, implements, parameter types, and return types that are essential for understanding the impact of a change.

Without this, a reviewer seeing the diff has no idea whether cancel belongs to a base class, what interfaces the class satisfies, or what the full method signature looks like. They have to open the file separately to get that context.

Proposed Solution

Show the enclosing class declaration line and function/method signature line above the diff, similar to how PhpStorm pins them to the top of the viewport when you scroll past them.

Alternative Solutions

Workaround: Instruct Claude to output the class/function context as text before each Edit call, but this appears visually separated from the diff in the tool, up several lines which is easy to miss.

Priority

Low - Nice to have

Feature Category

CLI commands and flags

Use Case Example

Example of what it would look like:

src/models/Order.php
  class Order extends BaseModel implements Auditable
  public function cancel(string $reason): bool

  - if ($this->status === 'pending') {
  + if (in_array($this->status, ['pending', 'processing'])) {

Additional Context

<img width="887" height="347" alt="Image" src="https://github.com/user-attachments/assets/b0ed2d5b-c777-49be-b99b-23bfc3616efc" />

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗