anthropics / anthropics/claude-code-action

Feature: Add ability to reply to existing inline comment threads

Open
#731 4 comments 9 reactions 0 assignees View on GitHub
enhancement mcp p3
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Summary

Currently, Claude can only reply within an existing inline comment thread if it was directly triggered by a `pull_request_review_comment` event. There's no way for Claude to reply to existing inline threads when triggered by other events (e.g., issue comment, PR comment, workflow_dispatch).

## Current Behavior

In `src/github/operations/comments/create-initial.ts`, the action uses `createReplyForReviewComment` only when the event is `pull_request_review_comment`:

```typescript
} else if (isPullRequestReviewCommentEvent(context)) {
response = await octokit.rest.pulls.createReplyForReviewComment({
owner,
repo,
pull_number: context.entityNumber,
comment_id: context.payload.comment.id, // replies to triggering comment
body: initialBody,
});
}
```

The `github-inline-comment-server.ts` provides `create_inline_comment` which can create **new** inline threads via `createReviewComment`, but it doesn't expose the `in_reply_to` parameter that would allow replying to existing threads.

## Proposed Solution

Add an optional `in_reply_to` parameter to the `create_inline_comment` tool in `src/mcp/github-inline-comment-server.ts`:

```typescript
in_reply_to: z
.number()
.optional()
.describe("Comment ID to reply to (creates a reply in an existing thread instead of a new thread)")
```

GitHub's `createReviewComment` API supports this parameter: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request

This would allow Claude to:
1. Read existing inline comment threads on a PR
2. Reply to specific threads with follow-up responses
3. Consolidate feedback in existing threads rather than creating duplicates

## Use Case

When the review action is triggered multiple times on the same PR (e.g., after each push), Claude currently creates separate inline comment threads for the same issues each time. This results in N duplicate threads for the same problem, each requiring separate resolution.

With this feature, Claude could instead reply to the existing thread with a message like "This issue from the previous review still hasn't been addressed" - keeping all feedback about a specific line consolidated in one thread.

## Related Issues

- #60 - Inline comments for reviews (general inline comment support)
- #711 - Action doesn't create inline comments on specific lines (duplicate of #60)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.