Coding task · Vibe coding with Claude Code course · Module 15: Advanced Claude Code

Practice: Pre-commit review script

A boatswain checks the cargo before the ship sails. The pipe | passes one command's output to the next, and -p makes Claude answer and exit. Lines starting with # are comments, so write the commands on new lines without #.

Task

In commands.sh write the code-review.sh script: get the staged changes (git diff --cached), pipe them into claude -p and ask it to point out bugs and security issues.