Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Invoke Claude Code CLI directly for issue triage
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rahul Tarak committed
Apr 13, 2026 at 17:39 UTC
6744e9993b1ef99c857950bd48a5a99b6cd4e95d
1 file changed
+70
-43
.github/workflows/issue-triage.yml
+70
-43
@@ -81,54 +81,81 @@ jobs:
81
}
82
EOF
83
84
+ - name: Install Claude Code CLI
85
+ run: npm install -g @anthropic-ai/claude-code
86
+
87
- name: Classify issue with Claude Sonnet
88
id: classify
86
- uses: anthropics/claude-code-action@v1
89
env:
90
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
91
ISSUE_TITLE: ${{ github.event_name == 'workflow_dispatch' && steps.issue-context.outputs.issue_title || github.event.issue.title }}
92
ISSUE_BODY: ${{ github.event_name == 'workflow_dispatch' && steps.issue-context.outputs.issue_body || github.event.issue.body }}
90
- with:
91
- anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
92
- show_full_output: true
93
- prompt: |
94
- Read the issue title and body from the ISSUE_TITLE and ISSUE_BODY environment variables.
95
-
96
- Classify the issue for routing and determine whether it is a bug report.
97
-
98
- Allowed categories:
99
- - docs
100
- - py
101
- - ts
102
- - cli
103
- - tool-request
104
- - feature-request
105
- - other
106
-
107
- Use semantic meaning, not only keywords.
108
- Choose tool-request when the issue is primarily asking for a new integration, toolkit, app, or tool.
109
- Choose feature-request when the issue is asking for a product, SDK, docs, or CLI improvement that is not a tool request.
110
- Choose cli only when the issue is specifically about the CLI experience or ts/packages/cli.
111
- Choose py only when the issue is primarily about the Python SDK.
112
- Choose ts only when the issue is primarily about the TypeScript SDK or TS packages other than the CLI.
113
- Choose docs only when the issue is primarily about documentation.
114
- Set is_bug to true when the issue is primarily reporting broken behavior, a defect, an error, a regression, or unexpected behavior.
115
- Set is_bug to false for feature requests, questions, maintenance, cleanup, and tool requests.
116
- Set should_comment to true only when the issue appears incorrect, non-actionable, or missing the information needed to reproduce or investigate.
117
- Set should_comment to false otherwise.
118
-
119
- If should_comment is true, provide comment_body as a short issue comment addressed to the reporter.
120
- The comment must:
121
- - clearly say it is an automated Claude triage note
122
- - clearly say Claude cannot reply back in a conversation
123
- - ask for the specific missing details needed to investigate, especially repro steps, expected behavior, actual behavior, environment, logs, or screenshots when relevant
124
- - stay concise and professional
125
-
126
- If should_comment is false, set comment_body to an empty string.
127
- claude_args: |
128
- --model claude-sonnet-4-6
129
- --json-schema /tmp/issue-triage-schema.json
130
- --max-turns 10
131
- --verbose
93
+ run: |
94
+ set -euo pipefail
95
+
96
+ PROMPT=$(cat <<'EOF'
97
+ Read the issue title and body from the ISSUE_TITLE and ISSUE_BODY environment variables.
98
+
99
+ Classify the issue for routing and determine whether it is a bug report.
100
+
101
+ Allowed categories:
102
+ - docs
103
+ - py
104
+ - ts
105
+ - cli
106
+ - tool-request
107
+ - feature-request
108
+ - other
109
+
110
+ Use semantic meaning, not only keywords.
111
+ Choose tool-request when the issue is primarily asking for a new integration, toolkit, app, or tool.
112
+ Choose feature-request when the issue is asking for a product, SDK, docs, or CLI improvement that is not a tool request.
113
+ Choose cli only when the issue is specifically about the CLI experience or ts/packages/cli.
114
+ Choose py only when the issue is primarily about the Python SDK.
115
+ Choose ts only when the issue is primarily about the TypeScript SDK or TS packages other than the CLI.
116
+ Choose docs only when the issue is primarily about documentation.
117
+ Set is_bug to true when the issue is primarily reporting broken behavior, a defect, an error, a regression, or unexpected behavior.
118
+ Set is_bug to false for feature requests, questions, maintenance, cleanup, and tool requests.
119
+ Set should_comment to true only when the issue appears incorrect, non-actionable, or missing the information needed to reproduce or investigate.
120
+ Set should_comment to false otherwise.
121
+
122
+ If should_comment is true, provide comment_body as a short issue comment addressed to the reporter.
123
+ The comment must:
124
+ - clearly say it is an automated Claude triage note
125
+ - clearly say Claude cannot reply back in a conversation
126
+ - ask for the specific missing details needed to investigate, especially repro steps, expected behavior, actual behavior, environment, logs, or screenshots when relevant
127
+ - stay concise and professional
128
+
129
+ If should_comment is false, set comment_body to an empty string.
130
+ EOF
131
+ )
132
+
133
+ claude -p "$PROMPT" \
134
+ --model claude-sonnet-4-6 \
135
+ --max-turns 10 \
136
+ --output-format json \
137
+ --append-system-prompt "Respond with ONLY a raw JSON object (no markdown fences, no prose) that matches the schema in /tmp/issue-triage-schema.json." \
138
+ > /tmp/claude-response.json
139
+
140
+ echo "--- raw claude response ---"
141
+ cat /tmp/claude-response.json
142
+ echo
143
+ echo "--- end raw ---"
144
+
145
+ STRUCTURED=$(jq -r '.result' /tmp/claude-response.json)
146
+
147
+ # Strip optional ```json fences just in case
148
+ STRUCTURED=$(echo "$STRUCTURED" | sed -E 's/^```(json)?//; s/```$//' | jq -c .)
149
+
150
+ echo "--- parsed structured output ---"
151
+ echo "$STRUCTURED"
152
+ echo "--- end parsed ---"
153
+
154
+ {
155
+ echo "structured_output<<CLAUDE_EOF"
156
+ echo "$STRUCTURED"
157
+ echo "CLAUDE_EOF"
158
+ } >> "$GITHUB_OUTPUT"
159
160
- name: Apply labels, assignees, and tool-request handling
161
uses: actions/github-script@v8