Run it from scripts, on a schedule or on pull requests, then check what it did.
1 / 4
Headless, scheduled and GitHub runs
Claude Code can run with nobody at the keyboard: from a script or an automated pipeline (claude -p), as a task scheduled in the cloud (/schedule), or in GitHub, where it answers when someone writes @claude in a pull request. With nobody watching, permissions and hooks matter even more.
2 / 4
claude -p: Claude in a script
claude -p runs one prompt without the interactive session: pipe input in, and it prints the answer and exits, with exit code 0 on success. Nobody is there to approve steps, so list what it may do with --allowedTools. Add --output-format json when another program reads the result.
3 / 4
Reviews on pull requests
Claude can review code too. Run /code-review in a session for a check before you push, or have an admin switch on Code Review, so every pull request on GitHub is reviewed automatically, with comments on the exact lines.
4 / 4
Verify the result
Claude can say “Fixed!” just as confidently when the fix doesn’t work. Don’t take its word: ask to see the failing test that now passes, the full diff, and what it couldn’t check. The less you watched it work, the more carefully you check.