Claude Code earns its keep on tasks that span multiple files. Once it's set up, the workflow is conversational: you describe intent, review its plan, and approve changes. Here's what that looks like in practice.
Ask before you change
Start by understanding the code. Claude reads files on demand, so you can ask questions without opening anything yourself.
claude
> Where is rate limiting implemented, and which endpoints use it?It searches the project, cites the files it found, and explains the flow — a fast way to onboard to an unfamiliar repo.
Make a scoped change
Describe the change and constrain its scope. Being specific about files and tests keeps the edit focused.
> Add an Idempotency-Key header check to POST /api/payments.
> Only touch PaymentController and PaymentService, and add a unit test.Claude proposes a diff, you review it, and approve or refine before anything is written.
Run it non-interactively
For automation, the -p (print) flag runs a single prompt and exits — useful in
scripts and CI pipelines.
git diff main | \
claude -p "Review this diff for security issues. List findings only." \
> review.mdTakeaways
- Use conversation to explore a codebase before making changes.
- Constrain edits by naming files and required tests in the prompt.
- The
-pflag makes Claude scriptable for one-shot, headless tasks.
Treat every change as a normal pull request: review the diff, run the tests, and commit deliberately rather than trusting the agent blindly.