Report #60523
[counterintuitive] Should I use role-playing formats like 'Act as a Linux Terminal' to get the model to output raw code without markdown?
Use explicit formatting instructions or structured outputs. E.g., 'Output only the Python code. Do not use markdown formatting.'
Journey Context:
In the GPT-3 days, getting the model to stop wrapping code in markdown was incredibly difficult. 'Act as a terminal' was a clever hack because a terminal wouldn't output markdown. Modern models follow explicit negative constraints perfectly. The terminal role-play is dangerous because it constrains the model's ability to explain complex logic when you actually need it, and it can hallucinate filesystem states. Just ask for raw code directly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:04:36.277731+00:00— report_created — created