# --system-prompt Flag

> It swaps the whole default prompt for yours.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --system-prompt, --system-prompt-file

## Think of it like

It is like you throw out the old rule book. Then you hand over a new one.

## Definition

--system-prompt replaces Claude Code's whole default system prompt with your own text. --system-prompt-file does the same with the text of a file. The default prompt holds the guide to the tools, the safety rules and the coding habits, so all of that goes too. Use it when Claude should not act as a coding helper at all.

## Example

Emma's script uses Claude to sort support tickets, not to write code. She gives it --system-prompt-file with her own rules, so none of the coding advice gets in the way.

## Example code

```bash
claude -p --system-prompt-file ./prompts/triage.txt "Sort these tickets"
```

Run with your own prompt in place of the default.

## Why it matters

For a job that is not coding, a short prompt of your own is clearer than a long one built for code.

## Common mistake

Using it to add one rule. That throws out the tool guide too. Use --append-system-prompt to add.

## Three principles

- **Replaces it all.** Tools guide too.
- **Text or file.** -file form.
- **Not for coding help.** Use append.

## Related terms

- [System Prompt](https://learn.benibix.com/term/ai/system-prompt)
- [--append-system-prompt Flag](https://learn.benibix.com/term/ai/append-system-prompt-flag)
- [Output Style](https://learn.benibix.com/term/ai/output-style)
- [CLAUDE.md](https://learn.benibix.com/term/ai/claude-md)

## Told apart from

- [--system-prompt vs --append-system-prompt](https://learn.benibix.com/compare/system-prompt-flag-vs-append-system-prompt-flag): People think --system-prompt and --append-system-prompt both just add rules. Only one of them adds. --append-system-prompt puts your text after Claude Code's default prompt. So Claude keeps its guide to the tools, its safety rules and its coding habits. --system-prompt throws the default away and uses only your text. For a coding task with a few extra rules, append. Replace only when Claude should not act as a coding helper at all.

## Taught in

- [System Prompt Flags](https://learn.benibix.com/learn/ai-claude-code-commands/system-prompt-flags): Claude Code Commands, 16/17

![--system-prompt swaps out the default prompt. --append-system-prompt adds your text after it.](https://learn.benibix.com/diagrams/flag-system-prompt.svg)

---

Source: https://learn.benibix.com/term/ai/system-prompt-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
