LLM persona via --append-system-prompt
Inject style/role/safety rules at the system level — keeps your user prompt focused on the data, not on persona-prefixing.
Setup
- → claude /login OR export ANTHROPIC_API_KEY=sk-…
Cost per run
<$0.01
The one-liner
$ curl -s \
"https://hn.algolia.com/api/v1/search?query=AI&tags=front_page&hitsPerPage=15" \
| jq -r '.hits[] | "[\(.points // 0)] \(.title)"' \
| claude -p \
--append-system-prompt "You are a senior analyst at trends101. You reject hype. Cite specific titles. Output ≤120 words." \
"Today's HN AI pulse."What each stage does
- [01] curl
curl … hn.algolia.com/api/v1/search?query=AI&tags=front_pageHN Algolia: front-page stories matching 'AI'. tags=front_page filters to curator-promoted stories. - [02] jq
jq -r '.hits[] | "[\(.points // 0)] \(.title)"'Compact `[points] title` lines. - [03] claude
--append-system-prompt "You are a senior analyst …"Adds to the default system prompt without replacing it. Use this 90% of the time. `--system-prompt` replaces entirely (risky — loses claude's safety defaults). - [04] claude
"Weekly r/singularity pulse."User prompt stays minimal — just states the task. Persona/style/length rules live in the system prompt, not muddled into the user message.
Expected output (sample)
Three threads dominate today's front page: (1) 'Claude 4.7 outperforms GPT-5 on SWE-Bench Verified' is anchored at 612 points but with 230 dissenting comments arguing benchmark contamination. (2) The agentic-RAG vs vanilla-RAG debate continues — 'Vector search is dead' at 481 is the most-discussed. (3) Quiet enthusiasm for local-first ML — 'Llama 4 on a $400 mini-PC' at 312 is the most-saved post. Skepticism rising overall.
Caveats & tips
- Use `--append-system-prompt-file ./prompts/persona.md` for longer system prompts.
- System-prompt content is cached server-side (better hit rate on repeated runs with same persona).