anthropics / anthropics/claude-code-action
Tag mode filters custom Bash tools from claude_args - intentional?
- Dominant language
- TypeScript
- Stars
- 8.9k
- Forks
- 2.1k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 10
Description
## Summary
When using `tag` mode (auto-detected for `pull_request` events), custom Bash tools specified in `claude_args` are silently filtered out. Only MCP tools prefixed with `mcp__github_` are merged with the default tool set.
## Expected Behavior
Custom tools specified via `claude_args: --allowedTools "Bash(npx markdownlint:*)"` should be available to Claude during PR reviews.
## Actual Behavior
The tools are parsed but filtered out in tag mode:
```javascript
// From src/modes/tag/index.ts
userAllowedMCPTools = parseAllowedTools(userClaudeArgs)
.filter((tool) => tool.startsWith("mcp__github_"))
```
This means `Bash(npx markdownlint:*)`, `Bash(gh pr:*)`, etc. are ignored.
## Reproduction
```yaml
# .github/workflows/claude-pr-review.yml
on:
pull_request:
types: [opened, synchronize, ready_for_review]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Run `npx markdownlint *.md` to check markdown files.
claude_args: |
--allowedTools "Bash(npx markdownlint:*),Read,Glob"
```
**Result**: Claude reports it cannot run markdownlint due to missing permissions.
**Workaround**: Use `mode: agent` which accepts all user-provided tools.
## Questions
1. **Is this filtering intentional?** If so, what's the security/design rationale?
2. **Should tag mode support custom Bash tools?** The use case of running linters during PR review seems common.
3. **Can documentation be updated?** Either to explain the limitation or to show the `mode: agent` workaround.
## Environment
- claude-code-action version: v1.0.22
- Trigger: `pull_request` (auto-detects to `tag` mode)
## Relevant Logs
```
Auto-detected mode: tag for event: pull_request
ALLOWED_TOOLS: Edit,MultiEdit,Glob,Grep,LS,Read,Write,mcp__github_comment__update_claude_comment,Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git rm:*)
```
Note: `Bash(npx markdownlint:*)` from `claude_args` is not present in `ALLOWED_TOOLS`.
Contributor guide
Assessment
This issue has not been assessed yet.