Why Your AI Pair Programming Sessions Feel Unproductive
"The AI keeps suggesting irrelevant code." "Each round of fixes breaks something new." "I could've written this faster myself." If you've started pairing with an AI agent recently, chances are you've hit at least one of these walls.
Antigravity's agents become genuinely reliable partners once you know how to work with them — and when they don't, the cause is usually one of a handful of recurring patterns. Here are ten I've run into myself, each with a way around it.
In this guide, we'll walk through the 10 most common pitfalls beginners encounter when pair programming with Antigravity's AI, complete with real examples and practical workarounds. Mastering these fundamentals will transform how you collaborate with AI.
Pitfall 1: Vague Prompts That Leave Too Much to Interpretation
The single most common mistake is giving the AI overly vague instructions.
What this looks like:
// ❌ Vague prompts
"Make this code better"
"Fix the bug"
"Make it faster"
AI isn't a mind reader. "Better" could mean more readable, more performant, or more secure — each requiring a completely different approach.
How to avoid it:
// ✅ Specific, actionable prompts
"Refactor this function to use a Map for O(1) lookups instead of
the nested loop. The goal is to improve performance for datasets
over 1,000 items. Ensure existing tests still pass."
Structure your prompts with three elements: what you want, why you want it, and how you'd like it done. The more specific you are, the better Antigravity's AI will deliver.
Pitfall 2: Starting Without Providing Project Context
Antigravity's AI doesn't automatically know your project's architecture, conventions, or tech stack. Without context, its suggestions may technically work but completely miss your project's patterns.
How to avoid it:
Use AGENTS.md and Knowledge Items to share your project's ground rules with the AI.
<!-- Example AGENTS.md -->
# Project Rules
- Framework: Next.js 16 (App Router)
- Language: TypeScript (strict mode)
- Styling: Tailwind CSS v4
- Testing: Vitest + Playwright
- Naming: camelCase (variables), PascalCase (components)Before starting a task, reference relevant files using @filename to give the AI the context it needs. For a deeper dive into getting started, check out the Antigravity Complete Beginner's Guide 2026.
Pitfall 3: Blindly Accepting AI-Generated Code
"The AI wrote it, so it must be correct" is a dangerous assumption. AI generates syntactically valid code, but it may miss edge cases, business logic nuances, or security concerns.
What this looks like:
// AI-generated code that looks correct
function calculateDiscount(price: number, discount: number): number {
return price * (1 - discount / 100);
}
// ⚠️ Problem: No validation for discount > 100 or negative valuesHow to avoid it:
// ✅ Improved version with proper validation
function calculateDiscount(price: number, discount: number): number {
if (price < 0) throw new Error("Price must be non-negative");
if (discount < 0 || discount > 100) {
throw new Error("Discount must be between 0 and 100");
}
return price * (1 - discount / 100);
}
// Expected output: calculateDiscount(1000, 20) → 800Always review diffs before committing. Antigravity's Diff View makes it easy to spot exactly what changed and catch potential issues.
Pitfall 4: Requesting Too Many Changes at Once
Asking the AI to "build the entire authentication system from scratch" in a single prompt almost always leads to subpar results. The longer the output, the more likely quality degrades toward the end.
How to avoid it:
Break tasks into small, focused steps:
// ✅ Incremental approach
Step 1: "Define the user model schema"
Step 2: "Create the signup API endpoint"
Step 3: "Add password hashing and validation"
Step 4: "Implement the login API with JWT token generation"
Step 5: "Build the authentication middleware"
Keep each interaction focused on one responsibility. This ensures high quality at every step and makes it much easier to catch issues early.
Pitfall 5: Pasting Error Messages Without Context
When something breaks, many developers simply paste the stack trace and ask "fix this." Without context about what triggered the error, the AI often produces band-aid fixes that don't address the root cause.
How to avoid it:
Provide structured error reports:
// ✅ Effective error reporting
"I'm getting the following error:
Error: TypeError: Cannot read properties of undefined (reading 'map')
Location: src/components/UserList.tsx, line 42
Steps to reproduce: Navigate to the user list page when the API
returns an empty response
Expected behavior: An empty list is displayed
Actual behavior: White screen / crash"
Including what you did, where it happened, and what you expected gives the AI enough information to provide a targeted fix.
Pitfall 6: Letting Conversations Run Too Long
Continuing the same chat session for dozens of turns causes the context window to bloat, leading to degraded response quality. The AI may start contradicting its earlier suggestions or losing track of the current state.
How to avoid it:
- Start a fresh session after roughly 30 turns
- Summarize the current state before beginning the new session
- Use Antigravity's Auto-continue feature wisely, but know when to reset
// Example prompt for a fresh session
"I'm implementing an authentication system. Current state:
- Signup API: Complete (src/api/auth/signup.ts)
- Login API: Complete (src/api/auth/login.ts)
- Auth middleware: Not started
Next step: Implement the authentication middleware."
Fresh context leads to sharper, more focused responses.
Pitfall 7: Postponing Tests Until Later
"Let's get it working first and add tests later" is a recipe for trouble — especially with AI-assisted development. Without tests, you can't tell when an AI-suggested fix silently breaks something else.
How to avoid it:
Ask the AI to generate tests alongside the implementation code:
// ✅ Request code and tests together
// src/utils/formatCurrency.ts
export function formatCurrency(amount: number, locale = "ja-JP"): string {
return new Intl.NumberFormat(locale, {
style: "currency",
currency: locale === "ja-JP" ? "JPY" : "USD",
}).format(amount);
}
// src/utils/formatCurrency.test.ts
import { describe, it, expect } from "vitest";
import { formatCurrency } from "./formatCurrency";
describe("formatCurrency", () => {
it("formats Japanese yen correctly", () => {
expect(formatCurrency(1500)).toBe("¥1,500");
});
it("formats US dollars correctly", () => {
expect(formatCurrency(29.99, "en-US")).toBe("$29.99");
});
it("handles zero amount", () => {
expect(formatCurrency(0)).toBe("¥0");
});
});
// Expected output: All tests passHaving tests gives you a safety net for future refactoring. For more on effective prompting strategies, see the Prompt Engineering Practical Guide.
Pitfall 8: Ignoring Dependency Checks
AI-generated code sometimes imports libraries that aren't installed in your project. Running the code produces confusing "module not found" errors that send you on a wild goose chase.
How to avoid it:
# Check if a package the AI used is actually installed
# Example: AI generated code using zod
cat package.json | grep zod
# If no output, you need to install it
npm install zod
# Expected output: added 1 packageAfter the AI generates code, scan the import statements and verify each package exists in your package.json. Antigravity's integrated terminal makes it easy to install missing packages on the spot.
Pitfall 9: Neglecting Version Control
With AI-assisted development, you iterate quickly — and it's common to realize that a previous version was actually better. Without frequent commits, you lose the ability to go back.
How to avoid it:
- Make small, focused commits after each completed feature or fix
- Use Antigravity's Checkpoints feature for easy rollback
- Create a branch before trying experimental AI suggestions
# Before trying an experimental change
git checkout -b feature/ai-experiment
# Work with AI → if it works, merge
git checkout main
git merge feature/ai-experiment
# If it doesn't work, discard
git checkout main
git branch -D feature/ai-experimentFor advanced version management strategies with AI, check out 10x Your Vibe Coding Productivity with Antigravity, which covers these techniques in depth.
Pitfall 10: Over-Relying on AI and Stalling Your Growth
The final — and perhaps most insidious — pitfall is delegating all technical judgment to the AI. While AI excels at code generation and pattern matching, architecture decisions, business logic, and design trade-offs are fundamentally human responsibilities.
How to avoid it:
- When the AI suggests an approach, ask why before accepting it
- Set aside time each week to write code without AI assistance
- Treat reading AI-generated code as a learning opportunity
// ✅ Prompts that deepen understanding
"Refactor this function, and explain why you chose
that particular approach over alternatives."
Think of AI not as something that thinks for you, but as a partner that thinks with you. This mindset is what separates developers who grow from those who plateau.
Summary
Most AI pair programming pitfalls trace back to one root cause: poor communication between developer and AI. Write specific prompts, provide project context, break tasks into small pieces, and always review before committing — these fundamentals will make your Antigravity workflow dramatically more effective.
Nobody writes the perfect prompt on their first try. What matters is recognizing these patterns and improving incrementally. Start applying these 10 principles today, and you'll notice a real difference in your AI-assisted development sessions.