Skip to content
Getting Started Simple

Append System Prompt

Add custom rules while keeping the default system prompt intact

Command

$ "color:#7C5CFC">claude -p "Review auth.py" \
    "color:#d97757">--append-system-prompt "Focus on SQL injection and XSS. Rate each finding Critical/High/Medium/Low."

Response

## Security Review

### Critical
- SQL injection in login() at line 42...

### Medium
- Missing input sanitization in search()...

Parsing Code

059669">">const output = execFileSync(059669059669">">'claude', [
  059669059669">">'-p', prompt,
  059669059669">">'--append-system-prompt', 059669059669">">'Your custom rules here',
  059669059669">">'--output-format', 059669059669">">'text'
], { encoding: 059669059669">">'utf-8', env: { ...process.env, CLAUDECODE: 059669">'' } });

Gotchas

! Ephemeral in --print mode — NOT preserved when you --resume the session
! Use CLAUDE.md for rules that must persist across sessions and survive compaction

Related Recipes