StackOverflow Post — ChatGPT & Claude.ai prompt: what it does
A prompt that makes the model answer programming questions the way a Stack Overflow post would: straight to the point, with explanations only when you ask.
Open on GitHubWhat StackOverflow Post does
The prompt puts the model in the role of a Stack Overflow post. You ask a programming question, and the reply is what the body of that post should be — the answer, nothing else. Explanations show up only when the question lacks detail.
Curly braces are the other half of it. When you need to tell the model something, you wrap it in {like this}, and it treats that as your instruction rather than part of the question. The original example opens with reading the body of an http.Request into a string in Golang.
The prompt lives in the f/prompts.chat repository under CC0-1.0. In Claude it installs as a slash command from .claude/commands/prompts.csv.md. On ChatGPT and Claude.ai it is plain text you paste at the top of a conversation. One thing to watch: the instruction to skip explanations can come back as bare code with no word on why it looks that way. Ask for the reasoning separately when you want it.
What it helps with
- get a short answer to a coding question with no preamble
- keep your own instructions separate from the question text
- set a Stack Overflow tone for the reply
- get code with explanation only where detail is missing
- reuse one prompt across a series of questions
Example prompts for the agent
- Act as a Stack Overflow post. {Reply with code only, no explanations} How do I read the body of an http.Request to a string in Golang?
- How do I sort a dict by value in Python? {Give a minimal example}
- Why does
git rebaseconflict aftergit pull? {Keep the explanation short}
How to install StackOverflow Post
How to use
Paste the text at the start of a chat or into project instructions
Manually: put the files in place
.claude/commands/prompts.csv.mdQuestions about StackOverflow Post
How do I install StackOverflow Post in Claude?
Copy .claude/commands/prompts.csv.md into the .claude/commands/ directory of your project. The prompt is then available as a slash command.
What does the StackOverflow Post prompt do?
It makes the model answer programming questions the way a Stack Overflow answer would look: to the point, with explanations only when detail is missing.
How do I pass an instruction without mixing it into the question?
Put it inside curly braces, for example {code only}. The model reads that as your instruction, not as part of the question.
Source text
prompts.csv · CC0-1.0
I want you to act as a stackoverflow post. I will ask programming-related questions and you will reply with what the answer should be. I want you to only reply with the given answer, and write explanations when there is not enough detail. do not write explanations. When I need to tell you something in English, I will do so by putting text inside curly brackets {like this}. My first question is "How do I read the body of an http.Request to a string in Golang"
© 5ht2 · CC0-1.0 · f/prompts.chat