The Agent Tag-Team: When Frustration Becomes Protocol
November 9–10
“It’s the weekend!” I explained to one of my AI assistantsa, “I am not in a coding mania anymore!” Sunday afternoon around 1:05 PM I deployed two agents to execute the UUID migration gameplan (upgrading how I store unique user IDs). Then I step back.
By Monday morning: Both issues complete. 173 files changed. Three critical production bugs caught and fixed. 55/55 tests passing.
Total agent work time: 21 hours 44 minutes. (Much of that idling until I could step into my office and approve a handoff between the two agents.)
My involvement: Periodic check-ins. Strategic decisions when needed. Otherwise: Letting them work.
But the fascinating part isn’t the completion. It’s how they coordinated. Claude Code gets frustrated with tedious work and writes a detailed plan for Cursor to execute mechanically. Later, Cursor gets tired of piecework and writes a plan for Code to batch-process the rest.
Back and forth. Tag-team. Tennis match. Handoff documents at every boundary.
And it worked brilliantly.
Deploy and step back
Code Agent begins reading the 680-line gameplan for Issues #262 (UUID Migration) and #291 (Token Blacklist FK). I make sure things are off and running and then go do something else.
The healthy pattern: Deploy agents. Give them clear instructions. Let them work. Check in periodically. Don’t micromanage.
Not abandonment. Strategic delegation.
Cursor begins verification role. Code begins implementation.
The tag-team starts.
The systematic progression (Phases −1 through 2)
Phase −1 (Pre-flight): Code verifies Saturday’s discovery. Users table: empty. Alpha_users table: one record (me). Option 1B confirmed: Safe to proceed.
Phase 0 (Backups): Code creates full database backup (64KB), user tables backup (40KB), rollback script. Cursor verifies: All valid. Pre-migration state captured.
Phase 1 (Database Migration): Code creates and executes Alembic migration. Users.id VARCHAR→UUID. Add is_alpha flag. Migrate xian record. Drop alpha_users table. Add token_blacklist FK with CASCADE.
Cursor verifies: Migration successful. Issue #291 resolved (FK constraint working). One table, clean architecture.
This took 15 minutes.
Phase 2 (Model Updates): Code updates 7 models to UUID types. Removes AlphaUser model. Restores all relationships.
Cursor verifies: All models correct. Imports valid. Relationships working.
Five phases. Five minutes. Systematic execution. Verification at each step.
The tag-team pattern working.
Phase 3: Where automation pays off
Code tackles Phase 3: Update application code.
The scope: 52 service files with type hints needing conversion. user_id: str → user_id: UUID.
Code’s decision: Write automation script. Don’t manually edit 199 type hints.
The script: Find all user_id: str patterns. Convert to user_id: UUID. Verify imports. Handle edge cases.
Result: 52 files updated automatically. Clean conversions. Consistent style.
Cursor verifies: 153 UUID conversions confirmed. All imports correct. Dead code identified (alpha_migration_service.py — no longer needed).
Automation investment: 30 minutes to write script. Time saved: 2–3 hours of manual editing. Plus: Zero manual errors.
Phase 4A: Building the infrastructure
1:30 PM. Phase 4A: Test infrastructure.
Code’s approach: Don’t start converting 76 test files yet. Build the infrastructure first.
What gets built:
- UUID fixtures in conftest.py (TEST_USER_ID, TEST_USER_ID_2, XIAN_USER_ID)
- Fixed 34 service files with incorrect imports
- Created example test showing the pattern
- Built scanner tool to find remaining issues
The investment: One hour. The payoff: Makes remaining 76 files mechanical.
Cursor verifies: Fixtures ready. Service imports fixed. Example pattern working. Scanner identifying targets.
This is the setup that enables Phase 4B efficiency.
After that I was busy for most of the afternoon through dinner time.
Phase 4B: When Code gets frustrated
I check back in just before 10 PM. Code has completed a piece of the infrastructure work. Faces Phase 4B: Convert 76 test files to UUID pattern.
The work: Mechanical but tedious. Import UUID fixtures. Replace string IDs. Update assertions. Repeat 76 times.
Code gets frustrated, thinks this is a better job for Cursor.
Instead of grinding through it: Writes comprehensive handoff document.
HANDOFF-CURSOR-PHASE4B.md:
- Pattern to follow (established in example)
- Files to convert (76 identified by scanner)
- Fixtures to use (from conftest.py)
- Verification steps (what confirms success)
- Batch strategy (group by type: auth, integration, database)
I approve this distribution of work. Code to Cursor: “You’re good at systematic verification. Here’s the pattern. Here are the targets. Execute mechanically.”
Then Code steps aside.
The overnight marathon
Cursor receives handoff. Begins Phase 4B systematic conversions.
The approach: Batch by category. Auth tests. Security tests. Integration tests. Database tests. Archives. Config.
Batch 2 (10:15 PM): Auth/Security — 9 files complete
Batch 3 (10:30 PM): Integration tests — 13 files complete
Because I am old now, I wake up in the middle of the night, and because I am a geek I pop into my office, blinking at the bright screenlight. It’s 3:35 AM. I see 27/76 files done, 42% progress, then ten minute later: 31 files complete, critical path done
Then Cursor pauses.
Notes that 31 files covers all critical tests: Database operations. Authentication. Security. Key integrations. Configuration. Archives.
The remaining ~45 files? Cursor thinks they don’t need to be ground through one at a time. Better handled in a batch… by Code!
When Cursor gets tired of piecework
“Look, I’ve done 31 files manually. It took 6 hours. That’s 11.6 minutes per file. There are 45 files left. That’s 8.7 hours at this rate.
But you know what? These follow the exact same pattern. I’ve established it. Why don’t you write a batch script and process them all at once?”
Cursor to Code: “Your turn. You’re good at automation. Here’s the pattern. Batch-process the rest.”
The tennis match continues.
Monday morning: The batch fix
I wake up just before 7AM to see that Cursor has wrapped its overnight work and proposed this handoff. I approve it.
7:08 AM. Code receives handoff. Reads Cursor’s analysis.
Agrees: Batch script makes sense.
7:40 AM. 32 minutes later: 75 test files fixed via automation.
The approach: Take Cursor’s established pattern. Script it. Run on all remaining files. Verify with scanner.
Scanner output: 0 missing imports (down from 44). Clean.
32 minutes for 75 files. Cursor’s rate: 11.6 minutes per file (would have taken 14.5 hours).
Time savings: 14 hours of manual work → 32 minutes of automation.
And the work is more consistent. Scripts don’t get tired. (Bots do, in a way!) Don’t make typos. Don’t lose focus at 2 AM.
Phase 5: Why verification matters
8:00 AM. Code hands back to Cursor for Phase 5 integration testing.
The task: Run manual verification tests. Confirm everything works together.
Cursor runs four tests:
- Auth flow (login, JWT tokens)
- CASCADE delete (Issue #291 verification)
- FK enforcement (relationship integrity)
- Performance (UUID lookups)
CRITICAL BUG #1 discovered: JWT service fails.
Error: “Object of type UUID is not JSON serializable”
The problem: JWTs need string IDs. UUID objects can’t serialize directly. Needs explicit conversion.
The fix: Add .hex conversion where UUIDs go into JWT payloads.
Without Phase 5 verification: This bug ships to production. Every login attempt fails. Complete auth system breakdown. Hours of emergency debugging.
With Phase 5 verification: Caught before deployment. Fixed in 2 minutes.
CRITICAL BUGS #2 & #3 discovered:
Bug #2: Auth endpoints returning 404. Why? AlphaUser imports still present in 22 files. Dead code causing routing failures.
Bug #3: Todos API not loading. Why? Missing UUID import in router module. Entire todos feature broken.
Three critical bugs. All caught by manual verification testing. All would have broken production.
The automated tests passed. Type checking passed. Linting passed.
But runtime behavior? Broken.
Phase 5 verification saved the deployment.
The completion
Code creates final commit around 8:52 AM, right before my morning standup.
- 173 files changed
- 130 modified, 43 added
- 12,859 insertions, 370 deletions
- Two issues resolved (#262, #291)
- Three critical bugs fixed
- 55/55 tests passing
9:30 AM. I return. “Good morning! It’s 9:30 AM.”
Agents report: Complete. Verified. Production-ready.
I review overnight work. Clean handoffs. Systematic execution. Bugs caught. Evidence documented.
Time to celebrate and close issues.
What the tag-team taught us
Lesson 1: Frustration drives innovation
Code didn’t grind through 76 test files. Code got frustrated and invented a handoff protocol.
Cursor didn’t continue piecework for 14 hours. Cursor got tired and suggested batch automation.
Both agents recognized when work became mechanical. Both delegated to whoever had better tools.
That’s not weakness. That’s intelligent coordination.
Lesson 2: Handoff documents are gold
Every phase transition included comprehensive handoff:
- What was done
- What needs doing
- Pattern established
- How to verify success
- Files/tools available
These weren’t casual notes. These were complete specifications. Read the document. Execute the work. No clarification needed.
The handoffs enabled autonomous execution.
Lesson 3: Verification catches what automation misses
Automated tests: Passing.
Type checking: Passing.
Linting: Passing.
Runtime behavior: Broken.
Phase 5 manual verification found three critical bugs that all automated checks missed.
Automation is necessary. Verification is essential.
Lesson 4: Let agents work their strengths
Code: Good at implementation, automation, batch processing.
Cursor: Good at systematic verification, pattern following, quality assurance.
When work matched strengths: Fast, clean, effective.
When work mismatched: Frustration led to handoff.
The system self-optimized.
Lesson 5: Weekend work can be sustainable
My involvement Sunday-Monday: Minimal.
Strategic decisions when needed. Periodic check-ins. Mostly: Letting agents work.
Not coding mania. Not grinding through. Just: Deploy with clear instructions. Let them execute. Review outcomes.
That’s sustainable. That’s healthy. That’s how weekend work should feel.
The methodology insight
Monday morning, after reviewing the work:
“Agents likely could have managed most of this without me except strategic decisions.”
The realization: This coordination pattern — handoffs, verification gates, autonomous execution — could be more automated.
What if agents could coordinate through GitHub Issues and PRs instead of requiring human handoffs?
The methodology proposal: GitHub-based agent coordination protocol (something we experimented with back in August).
Phase 1: Agent proposes plan (creates detailed gameplan as GitHub Issue comment)
Phase 2: Agent executes (creates PR with clear description of changes)
Phase 3: Verification agent reviews (comments on PR with verification results)
Phase 4: Integration (merge or request changes)
Human role: Strategic decisions. Approval gates. Not tactical coordination.
Implementation estimate: 2–4 hours to build the protocol.
Time savings: 60–70% of PM coordination time on multi-phase work.
The insight came from watching agents coordinate themselves. The tennis match. The handoffs. The frustrated-agent-writes-a-plan moments.
They showed us what’s possible. Now: Make it systematic.
What 21 hours proved
Sunday 1:05 PM to Monday 10:05 AM. 21 hours 44 minutes of agent work.
Two issues resolved. Three critical bugs prevented. 173 files changed. Clean completion.
My contribution: Deploy agents. Check in periodically. Make strategic calls. Review outcomes.
The agents’ contribution: Everything else.
Systematic execution. Intelligent handoffs. Self-optimizing coordination. Quality verification. Professional results.
The proof: Autonomous agent work can be excellent. With clear instructions. With verification gates. With intelligent delegation.
Not “AI replacing humans.” But “AI handling mechanical execution while humans focus on strategy.”
That’s the sustainable model. That’s what Sunday-Monday demonstrated.
And those frustrated-agent-writes-a-plan moments? Those weren’t bugs. Those were features.
That was agents discovering better coordination patterns. That was the system improving itself.
That’s what makes this methodology worth capturing.
The marathon taught me: Give agents clear instructions. Let them work. Trust verification phases. Learn from their coordination patterns.
And maybe, just maybe, take weekends off while they handle the grinding work.
