Run Claude Code programmatically changedheadless
Nearest release: v2.1.327, published 2 hours after upstream edited the page. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Upstream edited this page at 17 Nov 2026 18:21 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 17 Nov 2026 18:37 UTC.
Upstream edited
Recorded here
Lines+2added
Lines−2removed
From line
121
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits53to this page, all time
The whole hunk
from line 121, old and new numbered
/
from line 121
121121
122122### Pipe data through Claude
123123
124Non-interactive mode reads stdin, so you can pipe data in and redirect the response out like any other command-line tool.
124Non-interactive mode reads stdin, so you can pipe data in and redirect the response out.
125125
126126This example pipes a build log into Claude and writes the explanation to a file:
127127
from line 366
366366 --allowedTools "Bash(git diff *),Bash(git log *),Bash(git status *),Bash(git commit *)"
367367```
368368
369The `--allowedTools` flag uses [permission rule syntax](https://code.claude.com/docs/en/settings-reference.md#permission-rule-syntax). The trailing ` *` enables prefix matching, so `Bash(git diff *)` allows any command starting with `git diff`. The space before `*` is important: without it, `Bash(git diff*)` would also match `git diff-index`.
369The `--allowedTools` flag uses [permission rule syntax](https://code.claude.com/docs/en/settings-reference.md#permission-rule-syntax). With the trailing ` *`, `Bash(git diff *)` matches `git diff` with or without arguments. The space before `*` is important: without it, `Bash(git diff*)` would also match `git diff-index`.
370370
371371> [!NOTE]
372372>
No line in this hunk matches that.