feat: add inline comment tool to allowed tools for code-review plugin

When the code-review@claude-code-plugins plugin is specified in agent mode
for PRs, automatically add mcp__github_inline_comment__create_inline_comment
to the allowed tools list. This ensures Claude can use the inline comment
tool once the MCP server is enabled.

Changes:
- Check for code-review plugin in agent mode prepare
- Add inline comment tool to allowed tools for PR contexts
- Tool is only added when both plugin is present and context is a PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ashwin Bhat
2025-10-25 22:07:02 -07:00
parent 3ffb87fe89
commit 5d4c86b8ff

View File

@@ -114,6 +114,14 @@ export const agentMode: Mode = {
const userClaudeArgs = process.env.CLAUDE_ARGS || "";
const allowedTools = parseAllowedTools(userClaudeArgs);
// Add inline comment tool if code-review plugin is present
const hasCodeReviewPlugin = context.inputs.plugins.includes(
"code-review@claude-code-plugins",
);
if (hasCodeReviewPlugin && isEntityContext(context) && context.isPR) {
allowedTools.push("mcp__github_inline_comment__create_inline_comment");
}
// Check for branch info from environment variables (useful for auto-fix workflows)
const claudeBranch = process.env.CLAUDE_BRANCH || undefined;
const baseBranch =