Use --append-system-prompt for Pipeline-Specific Rules
When running Claude Code in CI or automation, you often want to add extra constraints without fully replacing the default system prompt. --append-system-prompt lets you tack on additional instructions at the end.
claude --append-system-prompt \
"Never modify migration files. If a schema change is needed, create a new migration." \
"Fix the failing tests in the auth module"
This stacks on top of any existing CLAUDE.md context rather than replacing it — you get the project's standard instructions plus your pipeline-specific rules.
A few practical uses:
# Enforce output format for script parsing
claude -p \
--append-system-prompt "Output only valid JSON. No markdown, no explanation." \
"Audit the npm dependencies for known vulnerabilities"
# Add read-only mode guardrails to a review job
claude -p \
--append-system-prompt "Do not write or modify any files. Analysis only." \
"Review the changes in this PR for potential security issues"
# Restrict scope in a focused automation task
claude -p \
--append-system-prompt "Only modify files in src/components/. Do not touch tests." \
"Update all Button components to use the new design tokens"
Rules in --append-system-prompt take effect for that run only — they don't persist and don't pollute your CLAUDE.md.
--append-system-prompt is how you add guardrails without rebuilding the whole fence.
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.