Industrial
Linguistics
Slide 8 of 55

Claude Code - Advanced

Slide 8 / 55

Course concept

Headless mode

claude "Perform a code review of …"

claude -p "Explain this project"

claude -c -p "Continue with the next task"

cat pgexplain.log | claude -p "What are our slowest queries? Why?"

Fun ideas:

  • Trigger on service failure to read logs

  • Once per month search for functions that are never called

  • Look for out-of-date documentation

  • Do a web search on our product to see what people are saying about it

  • Use claude agents when you want background sessions you can monitor later

Narration

Listen or continue with the transcript

Transcript

Claude Code has a headless mode that lets you automate tasks from the command line.

Here are the current command-line patterns:

Run claude by itself for an interactive session.

Run claude followed by a prompt in quotes for a one-off interactive request.

Use claude -p for print mode when you want a non-interactive answer from a script. Combine it with claude -c -p to continue the most recent conversation in print mode.

You can also pipe input: "cat pgexplain.log | claude -p 'What are our slowest queries? Why?'" - this feeds log files or other data directly into Claude for analysis.

For background sessions and monitoring, use claude agents. Headless mode is powerful for automation and batch processing, but keep the command shape explicit so scripts are predictable.