Good vs Bad Context: A Side-by-Side Comparison
beginner 10 min 📋 Copy-paste ready
Sources not yet verified
Scenario
Context: You're debugging a React component that's throwing a TypeError
Goal: Get AI to help you find and fix the bug efficiently
Anti-pattern: Asking 'fix this bug' with no context, expecting AI to read your mind
Tools: GitHub Copilot ChatClaudeCursor
Key Takeaways
- Always include the exact error message with stack trace
- Show the relevant code, not just describe it
- Provide context about where the code is called from
- Mention the data source (API, state, props) when relevant
- Good context = faster, more accurate help
Try It Yourself
Prompt Template
I'm getting [ERROR] in my [LANGUAGE/FRAMEWORK] app.
**Error:**
```
[paste exact error here]
```
**Code:**
```
[paste relevant code here]
```
**Context:**
- Called from: [where]
- Data comes from: [source] Variations to Try
- Add: 'I've already tried [X] but it didn't work because [Y]'
- Add: 'The expected behavior is [X] but instead I see [Y]'
- Add: 'This started happening after I [recent change]'
Sources
Tempered AI — Forged Through Practice, Not Hype
? Keyboard shortcuts