Claude Sonnet 4.5 is giving really weird advice about context windows in RAG style systems. "Put your system prompt AFTER the context"
Please don’t.
I realize that there are misguided people who do it, but doing it that way confuses models, and doubles the amount of reasoning any LLM agent will have to do in order to complete a task -- making errors and hallucinations more, not less likely.
The better way to handle a batch job like this, is to put your system prompt at the beginning. Remember, a system prompt frames the exercise, and colors everything the model does after it.
A system prompt can include specific instructions or tool outlines, but the thing it really should be controlling is the mindset of your agents.
If the context is long or complex, the better way to handle this, is to append additional or re-stated instructions at the end.
As a rule:
- - The less your agents have to reason through the better.
- - If extensive multi-step reasoning is required, you may be looking at multiple tasks or iterations.
Think in terms of talking to a nine year old with a PhD.
If a theoretical human child with infinite education couldn't do it after telling them how, your AI is going to struggle, and your tasks need to be smaller.