Claude Code system prompt
The Claude Code system prompt here is (as usual) fascinating.
There are a lot of instructions on things it got wrong out of the box, like these:
"Do what has been asked; nothing more, nothing less."
"NEVER create files unless they're absolutely necessary for achieving your goal."
"ALWAYS prefer editing an existing file to creating a new one."
but mostly it's surprising how few instructions there really are.
40% of the prompt are tool use instructions.
They're pretty standard, so let's skip those. There are some interesting bits like
"ALWAYS prefer editing an existing file to creating a new one".
20% are development workflows.
There's a lot of stuff about GIT workflows and testing.
"VERY IMPORTANT: run the lint and typecheck commands if they were provided"
Another 25% are behavioral instructions. Clearly developed while using it. Things like
"You are allowed to be proactive, but only when the user asks you to do something"
Then there are some I found particularly interesting:
"You MUST answer concisely with fewer than 4 lines of text"
"One word answers are best" <- HA!
"Avoid introductions, conclusions, and explanations"
"DO NOT ADD ***ANY*** COMMENTS unless asked"
"You should NOT answer with unnecessary preamble or postamble"
"Do not add additional code explanation summary unless requested"
And finally, a ton of examples.
What I'm thinking:
Reading system prompts is a great way to develop intuition on how to better use these tools.
It's also a great way to get better at writing prompts. (For example, add examples.)
But mostly, I'd LOVE to learn how the evals for this are set up.