Use --system-prompt to Fully Replace Claude's Default Prompt
When you need complete control over how Claude behaves, --system-prompt lets you replace the entire default system prompt with your own. This is different from --append-system-prompt, which adds to the existing prompt.
claude --system-prompt "You are a senior Python reviewer. Only flag security issues and performance problems. Ignore style."
This is powerful for building specialised tools on top of Claude Code. You can turn it into a focused code reviewer, a documentation writer, or a migration assistant with zero extra baggage from the default prompt.
You can also load the prompt from a file, which is cleaner for longer instructions:
claude --system-prompt-file ./prompts/security-audit.txt
A few rules to keep in mind. --system-prompt and --system-prompt-file are mutually exclusive, so pick one. But you can combine either with the append flags for layered control:
# Replace the base prompt, then add project-specific rules on top
claude --system-prompt-file ./base-prompt.txt --append-system-prompt "Always use TypeScript strict mode"
This works in both interactive and print mode, making it ideal for CI pipelines where you want a completely custom agent persona.
When you need Claude to be something specific, don't add to the default prompt. Replace it.
Log in to leave a comment.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.