Ask HN: Are there any best practices for getting LLMs to return *only* code?

  • Did you try telling it in the prompt: “Show me only the code I have requested in a markdown code block”?