Add Custom Rules Without Breaking the Default Prompt with --append-system-prompt
The --system-prompt flag replaces Claude's entire default prompt, which strips away all built-in context about tools, safety, and coding behaviour. Most of the time, you just want to add a few extra rules on top, not replace everything.
# Add a project-specific constraint to the default prompt
claude --append-system-prompt "Always use TypeScript strict mode and never use 'any'"
# Load rules from a file for longer instruction sets
claude --append-system-prompt-file ./team-rules.txt
The append flags add your text to the end of the default system prompt without replacing it. Claude retains all its built-in capabilities and still knows how to use tools correctly, but now has your additional constraints in context for the full session.
This is ideal for:
- Enforcing coding conventions on a specific project
- Adding a reminder about a framework version ("This project uses Laravel 11, not 10")
- Keeping security rules front-of-mind throughout the session
You can combine an append flag with a replacement flag when you need full control over the base prompt but still want additive instructions:
claude --system-prompt-file ./core-prompt.txt --append-system-prompt "Never commit to main directly"
For permanent project-wide rules that persist across sessions, CLAUDE.md is the right tool. Use --append-system-prompt for session-specific or scripted overrides where you want precise, one-time control.
Appending to the system prompt extends Claude's context without sacrificing its defaults.
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.