claude-code-action
CLAUDE.md9.4k starsChanged 2 months agoMITView on GitHub
A GitHub Action that lets Claude respond to @claude mentions on issues/PRs (tag mode) or run tasks via prompt input (agent mode). Mode is auto-detected: if prompt is provided, it's agent mode; if triggered by a comment/issue event with @claude, it's tag mode. See src/modes/detector.ts. Single entrypoint: src/entrypoints/run.ts orchestrates everything — prepare (auth, permissions, trigger check, branch/comment creation), install Claude Code CLI, execute Claude via base-action/ functions (imported directly, not subprocess), then cleanup (update tracking comment, write step summary). SSH…
Trending
Quiet since September.about the whole repository
Who's talking about anthropics/claude-code-action
- anthropics/claude-code“Feature request: Connect Claude code to Claude projects ”GitHub · Jun 24, 2025 · 650 reactions
- grll/claude-code-action“Is this allowed by Anthropic?”GitHub · May 30, 2025 · 33 reactions
- unclecode/crawl4ai“Add Claude Code GitHub Workflow”GitHub · Oct 4, 2025 · 13 reactions
- anthropics/claude-code“[BUG] /install-github-app generates claude-code-review.yml using a terminal CLI plugin in CI, causing …”GitHub · Feb 17, 2026 · 8 reactions
- alchimie-di-circe/Inngest-RESEARCH---Next-15“Add Claude Code GitHub Workflow”GitHub · Jan 25, 2026 · 5 reactions
The biggest 5 of 36 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 36
Talked about on GitHub, Bluesky and Hacker News (36 times).
On GitHub · 26
- Jun 24, 2025Feature request: Connect Claude code to Claude projects — anthropics/claude-code650 reactions · 52 comments
- May 30, 2025Is this allowed by Anthropic? — grll/claude-code-action33 reactions · 4 comments
- Oct 4, 2025Add Claude Code GitHub Workflow — unclecode/crawl4ai13 reactions · 1 comment
- Feb 17, 2026[BUG] /install-github-app generates claude-code-review.yml using a terminal CLI plugin in CI, causing silent failures — anthropics/claude-code8 reactions · 10 comments
- Jan 25, 2026Add Claude Code GitHub Workflow — alchimie-di-circe/Inngest-RESEARCH---Next-155 reactions · 5 comments
21 more on GitHub
- Aug 12, 2026ci: add @claude workflow for issue and PR mentions — JMAN730/opendroid4 reactions · 12 comments
- May 5, 2026chore(deps): bump anthropics/claude-code-action from 1.0.111 to 1.0.112 in the github-actions-safe group — danielgonzagat/Kloel3 reactions · 9 comments
- Mar 6, 2026Add Claude Code GitHub Workflow — manaflow-ai/cmux3 reactions · 3 comments
- Nov 27, 2025Add Claude Code GitHub Workflow — cline/cline3 reactions · 3 comments
- Sep 28, 2026Bump anthropics/claude-code-action from 1.0.193 to 1.0.235 — jcarterwil/Sailing2 reactions · 3 comments
- Sep 26, 2026fix(ci): validate Claude reviews from successful final output — thomhurst/ModularPipelines2 reactions · 10 comments
- Sep 21, 2026Bump anthropics/claude-code-action from 1.0.193 to 1.0.230 — jcarterwil/Sailing2 reactions · 3 comments
- Sep 21, 2026chore(deps): bump anthropics/claude-code-action from 1.0.179 to 1.0.224 — latitude-dev/latitude-llm2 reactions · 1 comment
- Sep 18, 2026chore(deps): bump the github-actions group with 2 updates — ComposioHQ/composio2 reactions · 3 comments
- Sep 11, 2026docs: reference claude_args instead of removed allowed_tools — mangeshraut712/claude-code-action2 reactions · 4 comments
- Sep 7, 2026Bump anthropics/claude-code-action from 1.0.193 to 1.0.216 — jcarterwil/Sailing2 reactions · 3 comments
- Aug 31, 2026Bump anthropics/claude-code-action from 1.0.193 to 1.0.210 — jcarterwil/Sailing2 reactions · 3 comments
- Aug 24, 2026Bump anthropics/claude-code-action from 1.0.193 to 1.0.199 — jcarterwil/Sailing2 reactions · 3 comments
- Aug 24, 2026ci: bump anthropics/claude-code-action from 1.0.193 to 1.0.199 — rmems/spikenaut-telemetry-etl2 reactions · 4 comments
- Aug 17, 2026Bump anthropics/claude-code-action from 1.0.183 to 1.0.193 — jcarterwil/Sailing2 reactions · 2 comments
- Aug 16, 2026Add Claude Code GitHub Workflow — rmems/spikenaut-telemetry-etl2 reactions · 6 comments
- Aug 4, 2026deps(actions): bump anthropics/claude-code-action from 1 to 1.0.183 — SkyyRoseCo/DevSkyy2 reactions · 3 comments
- Jul 22, 2026ci: bump the actions group across 1 directory with 5 updates — dabiggestpoppa/fbo-content-engine2 reactions · 2 comments
- Jun 24, 2026ci: bump the actions group across 1 directory with 3 updates — dabiggestpoppa/fbo-content-engine2 reactions · 3 comments
- Jun 10, 2026ci: bump anthropics/claude-code-action from 1.0.140 to 1.0.150 in the actions group across 1 directory — dabiggestpoppa/fbo-content-engine2 reactions · 3 comments
- May 25, 2026chore(deps): bump anthropics/claude-code-action from 1.0.112 to 1.0.133 in the github-actions-safe group — danielgonzagat/Kloel2 reactions · 5 comments
On Bluesky · 9
- Sep 27, 2026📦 anthropics / claude-code-action ⭐ 9,087 (+31) 🗒 TypeScript — @github-trending-js.bsky.social2 likes and reposts
- Jun 3, 2025Write up issue, tag claude and ask it to give it a go. Theres a command in Claude code to help you set it up. Custom tools or things would… — @jeremymorrell.dev2 likes and reposts
- Sep 26, 2026📦 anthropics / claude-code-action ⭐ 8,971 (+15) 🗒 TypeScript — @github-trending.bsky.social1 likes and repost
- Jan 6, 2026📦 anthropics / claude-code-action ⭐ 4,643 (+32) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost
- Jan 6, 2026📦 anthropics / claude-code-action ⭐ 4,643 (+32) 🗒 TypeScript — @github-trending.bsky.social1 likes and repost
4 more on Bluesky
- Nov 23, 2025github.com/anthropics/... #github #ai #claudecode #automation — @pierrehenry.dev1 likes and repost
- Sep 16, 2025📦 anthropics / claude-code-action ⭐ 3,207 (+49) 🗒 TypeScript — @github-trending-js.bsky.social1 likes and repost
- May 26, 2025今日はこれを deepwiki で読んで参考にしていた。 github.com/anthropics/c... 重要なコードはここで github.com/anthropics/c... 発火イベントによってプロンプトを動的に生成しているということがわかった。 — @tomoyuki-mikami.bsky.social1 likes and repost · 1 reply
- Sep 29, 2026With more efficient Claude Opus 5.5, maybe Claude Code Github Actions are now viable github.com/anthropics/c... — @georgesl.bsky.social0 likes and reposts · 1 reply
On Hacker News · 1
- May 19, 2025claude-code-action: Claude Code GitHub Action1 point
In this repositoryOne other file it gives its agents.
- base-action/CLAUDE.mdCLAUDE.md
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 58
Keep each workflow's permissions: block minimal, and never print tokens or environment variables in workflow logs.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Commands
bun test # Run tests
bun run typecheck # TypeScript type checking
bun run format # Format with prettier
bun run format:check # Check formattingWhat This Is
A GitHub Action that lets Claude respond to @claude mentions on issues/PRs (tag mode) or run tasks via prompt input (agent mode). Mode is auto-detected: if prompt is provided, it's agent mode; if triggered by a comment/issue event with @claude, it's tag mode. See src/modes/detector.ts.
How It Runs
Single entrypoint: src/entrypoints/run.ts orchestrates everything — prepare (auth, permissions, trigger check, branch/comment creation), install Claude Code CLI, execute Claude via base-action/ functions (imported directly, not subprocess), then cleanup (update tracking comment, write step summary). SSH signing cleanup and token revocation are separate always() steps in action.yml.
base-action/ is also published standalone as @anthropic-ai/claude-code-base-action. Don't break its public API. It reads config from INPUT_-prefixed env vars (set by action.yml), not from action inputs directly.
Key Concepts
Auth priority: github_token input (user-provided) > GitHub App OIDC token (default). The claude_code_oauth_token and anthropic_api_key are for the Claude API, not GitHub. Token setup lives in src/github/token.ts.
Mode lifecycle: detectMode() in src/modes/detector.ts picks the mode name ("tag" or "agent"). Trigger checking and prepare dispatch are inlined in run.ts: tag mode calls prepareTagMode() from src/modes/tag/, agent mode calls prepareAgentMode() from src/modes/agent/.
Prompt construction: Tag mode's prepareTagMode() builds the prompt by fetching GitHub data (src/github/data/fetcher.ts), formatting it as markdown (src/github/data/formatter.ts), and writing it to a temp file via createPrompt(). Agent mode writes the user's prompt directly. The prompt includes issue/PR body, comments, diff, and CI status. This is the most important part of the action — it's what Claude sees.
Things That Will Bite You
- Strict TypeScript:
noUnusedLocalsandnoUnusedParametersare enabled. Typecheck will fail on unused variables. - Discriminated unions for GitHub context:
GitHubContextis a union type — callisEntityContext(context)before accessing entity-specific fields likecontext.issueorcontext.pullRequest. - Token lifecycle matters: The GitHub App token is obtained early and revoked in a separate
always()step inaction.yml. If you move token revocation intorun.ts, it won't run if the process crashes. Same for SSH signing cleanup. - Error phase attribution: The catch block in
run.tsusesprepareCompletedto distinguish prepare failures from execution failures. The tracking comment shows different messages for each. action.ymloutputs reference step IDs: Outputs likeexecution_file,branch_name,github_tokenreferencesteps.run.outputs.*. If you rename the step ID, update the outputs section too.- Integration testing happens in a separate repo (
install-test), not here. The tests in this repo are unit tests.
Code Conventions
- Runtime is Bun, not Node. Use
bun test, notjest. moduleResolution: "bundler"— imports don't need.jsextensions.- GitHub API calls should use retry logic (
src/utils/retry.ts). - MCP servers are auto-installed at runtime to
~/.claude/mcp/github-{type}-server/.
Security hardening for GitHub Actions
Workflow jobs in this repository that call Claude run with three protections. Keep them when you add or edit a workflow.
- Egress-firewall runner. The job has
runs-on: ubuntu-24.04-firewall, a GitHub-hosted runner that filters the job's outbound network traffic. Do not move a job that calls Claude to another runner. - Network allow list.
.github/egress-firewall.yamllists the hosts those jobs may reach, besides any that GitHub's firewall allows by default. Keepmode: enforce, which is what makes the firewall block the rest. Follow that file's header when you add a host. - Auto permission mode. Every step that runs the Claude Code action (
uses: anthropics/claude-code-action, or this repository's own./and./base-action) passes--permission-mode autoinclaude_args. A tool call that needs permission and that the allowed tools do not cover then runs only if Claude Code's safety review passes it. Allow only the tools the job needs, and keep any--disallowedToolslist a step has. Useclaude-opus-4-6or a newer model: on an older one Claude Code falls back to its default permission mode.
claude.yml answers @claude mentions. The Claude Code action sets --permission-mode acceptEdits for those, and the --permission-mode auto in the workflow's claude_args, which comes after it, replaces it.
.github/workflows/workflow-hardening.yml fails when a job that runs the Claude Code action or mentions ANTHROPIC_FEDERATION_RULE_ID breaks protection 1 or 3, or when the allow list is missing, empty, not mode: enforce, or names a host with *. It cannot see a job that calls Claude another way, so check new workflows by hand too. If a job cannot meet protection 1 or 3, add it with the reason to the matching exemption table in .github/scripts/check_workflow_hardening.py. A job in EXEMPT_FROM_AUTO_MODE must set no permission mode at all. Do not skip or weaken the check.
Keep each workflow's permissions: block minimal, and never print tokens or environment variables in workflow logs.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

