Stop wasting tokens on "Act as a Senior Developer" A developer guide argues that using constraint-based prompts instead of persona-based ones can improve AI model reasoning by up to 30%, citing tests where accuracy rose from 65% to 94% with few-shot and thinking prompts. The article recommends XML tags to prevent prompt leakage and chain-of-thought triggers for complex logic, based on the author's experiments with Claude and GPT-4o. Stop wasting tokens on "Act as a Senior Developer" If you're still using a single paragraph to describe your AI's personality, you're leaving 30% of the model's reasoning capability on the table. Ditch the persona for a constraint checklist The "Persona" approach is a lazy habit. When you tell a model to "be a world-class React developer," it pulls from a generic cloud of "React developer" data. Instead, give it a set of hard rules it cannot break. The Use Case: You need a model to refactor a messy TypeScript component without changing the logic or adding new dependencies. The "Before" Standard Persona : "You are an expert TypeScript developer. Please refactor this code to be cleaner and more professional. Follow best practices." The "After" Constraint-Based : "Refactor the provided TypeScript code under these strict constraints: 1. Zero new npm packages. 2. No changes to the function signatures keep public APIs identical . 3. Extract logic into hooks if the component exceeds 60 lines. 4. Use early returns to eliminate nested if-else blocks. 5. Output ONLY the code block. No conversational filler." The difference? The "After" prompt removes the model's "choice." It doesn't have to decide what "professional" means—it just has to count lines and check for nested ifs. Use XML tags to stop prompt leakage If you're feeding a model a large codebase or a long documentation file, it will eventually get confused about where your instructions end and the data begins. This is where "prompt bleeding" happens, and it's a nightmare for AI Coding /en/category/ai-coding/ workflows. Stop using "Here is the code: code ". Use XML tags. They are an absolute godsend for Claude /en/tags/claude/ and GPT-4o because they create clear boundaries that the attention mechanism can latch onto. The Use Case: You're asking the AI to analyze a specific bug across three different files. The Setup: Instead of a wall of text, structure it like this: