All articles

Appending to the System Prompt

Sometimes you want Claude to follow a standing rule for a whole run, not just a one-off request buried in a prompt. The --append-system-prompt flag adds your own instructions on top of Claude Code's built-in ones.

What it does

The system prompt is the set of instructions that shapes how Claude behaves. With --append-system-prompt, you tack extra guidance onto the end of it. That guidance applies for the run, so it steers every response rather than a single turn.

claude --append-system-prompt "Always respond with concise, numbered steps."

Why append instead of prompt

You could put the same instruction in your normal prompt, but appending to the system prompt keeps it separate from the task itself. The task can change from turn to turn while the standing rule stays put. It is a clean way to set tone, format, or constraints once.

A good fit for headless runs

This flag shines in scripts and automation. Pair it with -p to lock in a style for machine-driven output:

cat report.md | claude -p "review this" --append-system-prompt "Only flag blocking issues. Be terse."

Now every headless run in your pipeline carries the same rules, so results stay consistent no matter who or what triggers them.

Keep it focused

Appended instructions are powerful, so keep them short and specific. A couple of clear rules work better than a long list. Think of it as a small overlay on top of the defaults: enough to shape behavior, not so much that it fights the task you actually asked for.

Comments

Be the first to comment.