PTENES
MODULE 6.1

🎭 Two agents side by side in the same project

How people who use both agents day to day handle session handoffs, keep two terminals in sync, divide work to avoid overlap, share MCP, and keep governance simple.

7
Topics
50
Minutes
Adv.
Level
Operac.
Type

🎯What you get here

A real, tested workflow from someone who works with both agents. You’ll learn how to configure a VS Code setup, pass context between them in 30 seconds, divide work without getting in each other’s way, and prepare for new runtimes to arrive.

Detailed content

1

πŸ“‹ Session handoff β€” the standardized summary

A short, structured summary you ask the current agent for BEFORE handing things off to the other one. This is the feature that unlocks a dual workflow. Without it, you keep re-explaining context. With it, you have a cheat sheet and can move on.

Handoff template (5 sections)

# Session handoff β€” 2026-05-24 16:30

## 🎯 Foco atual
Implementar autenticaΓ§Γ£o OAuth no /api/auth com Google.

## πŸ“‚ Arquivos tocados (com estado)
- src/api/auth.ts          ← parcial, falta validaΓ§Γ£o JWT
- src/api/auth.test.ts     ← testes do happy path passando
- prisma/schema.prisma     ← adicionou model OAuthAccount

## βœ… DecisΓ΅es tomadas
- Usar passport.js (nΓ£o auth0)
- JWT em cookie httpOnly (nΓ£o localStorage)
- Refresh token rotacionando a cada 1h

## 🚧 Problema aberto
JWT verification falhando com "jwt malformed" no payload de teste.
Tentei 3 abordagens (recriar token, mudar secret, verificar
cookie parse) sem sucesso. ProvΓ‘vel bug na lib ou no setup do test.

## ⏭ Próximos passos
1. Investigar setup do test (jest mock do passport?)
2. Se persistir, trocar passport por jose lib
3. Implementar refresh endpoint
4. Cobertura de erro paths

βœ“ Good handoff

  • β€’ Short (fits on one page)
  • β€’ Fixed structure (5 sections)
  • β€’ List of files WITH status
  • β€’ Explicit decisions (not obvious from the code)
  • β€’ Current problem with previous attempts

βœ— Useless handoff

  • β€’ "I'm working on feature X" (vague)
  • β€’ 20 pages of context (no one reads them)
  • β€’ No current problem (doesn't know what to do)
  • β€’ Decisions you can read from the code (redundant)
  • β€’ No next step

πŸ’‘Becomes a skill

Perfect candidate for a skill session-handoff in both runtimes (written once via polyskill). You run /session-handoff or $session-handoff, gets the completed template ready to paste into the other agent.

Key concepts

5 fixed sections
Focus, files, etc.
Candidate skill
Standardizes
Short > complete
Single page
Current problem
+ attempts
2

πŸ–₯️ Two terminals, one project β€” VS Code setup

Practical setup that works: VS Code open in the project, two terminal panes β€” one running claude, another running codex. Same filesystem, same git, same docs. You switch panels with a shortcut.

VS Code ASCII layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Explorer β”‚  src/api/auth.ts                                       β”‚
β”‚          β”‚  ──────────────────────────────────────                β”‚
β”‚ β–Ύ src    β”‚  export async function login(req, res) {               β”‚
β”‚   api    β”‚    // implementaΓ§Γ£o aqui                               β”‚
β”‚   ui     β”‚    ...                                                 β”‚
β”‚ β–Έ tests  β”‚  }                                                     β”‚
β”‚          β”‚                                                        β”‚
β”‚          β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚          β”‚ TERMINAL 1: claude         β”‚ TERMINAL 2: codex         β”‚
β”‚          β”‚ > refatorando auth.ts      β”‚ > escrevendo testes       β”‚
β”‚          β”‚ [Claude pensa…]            β”‚ [Codex pensa…]            β”‚
β”‚          β”‚                            β”‚                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
⌨️

Terminal split

Ctrl+Shift+5 (VS Code) splits the panel. Each half runs an agent.

🎨

Profile per agent

Create 2 terminal profiles in VS Code: "Claude" and "Codex". Different colors, agent auto-start.

⚑

focus shortcut

Ctrl+Shift+` focuses the terminal. Use the arrow keys to navigate between panels without a mouse.

Ideal workspace settings

// .vscode/settings.json
{
  "terminal.integrated.profiles.osx": {
    "Claude Code": {
      "path": "/bin/zsh",
      "args": ["-c", "claude"],
      "color": "terminal.ansiBlue"
    },
    "OpenAI Codex": {
      "path": "/bin/zsh",
      "args": ["-c", "codex"],
      "color": "terminal.ansiMagenta"
    }
  },
  "files.watcherExclude": {
    "**/.claude/**": false,
    "**/.codex/**": false,
    "**/.agents/**": false
  }
}

Key concepts

Terminal split
Side-by-side panels
Colorful profile
Visual distinction
focus shortcuts
No mouse
Repo settings
.vscode/ in git
3

⚠️ Avoiding conflicts β€” when both edit

If both agents edit the same file at the same time, one overrides the other. It’s the #1 way to lose work with a dual workflow. The solution is simple discipline: split by area or phase.

πŸ“‚ Division by area

Each agent works in different folders:

Claude   β†’ src/api/    (backend)
Codex    β†’ src/ui/     (frontend)

No overlap, no conflicts. Simpler.

βš™οΈ Division by phase

Same area, different phases:

Claude   β†’ implementa src/x.ts
Codex    β†’ escreve testes/x.test.ts

Coordinates: implementation done? Tell Codex to run a test.

Advanced strategies

Git branch per agent: claude works in feat/x-impl, codex in feat/x-test. Merge later.
Manual lock via comment: whoever gets there first adds it // LOCKED by claude β€” 16:30 at the top. Someone else sees it and respects it.
git stash between switches: before switching agents, stash any partial work. The other agent works in a clean state.

⚠️The scenario to avoid

Two agents editing src/api/auth.ts in parallel. Claude finishes and writes. Codex finishes 30s later and writes over itβ€”Claude’s work is lost. You discover at the next commit that half the changes are missing. 1–2 hours of drama to reconstruct it.

Key concepts

Division by area
Simpler
Division by phase
Implementation vs. test
Branch per agent
Advanced
Last-write-wins
Loses work
4

πŸ”Œ Shared MCP servers

MCP servers run as independent processes. Configured once, both agents connect to the same. The server isn’t duplicatedβ€”only the declaration on the client (JSON for Claude, TOML for Codex).

Mirrored configuration

# Claude: .mcp.json (no projeto)
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@mcp/github"],
      "env": { "TOKEN": "${GITHUB_TOKEN}" }
    }
  }
}

# Codex: .codex/config.toml (no projeto)
[mcp_servers.github]
command = "npx"
args = ["-y", "@mcp/github"]

[mcp_servers.github.env]
TOKEN = "${GITHUB_TOKEN}"

# Resultado:
# Os dois agentes apontam pro MESMO server (mesmo binΓ‘rio,
# mesmas credenciais, mesmas ferramentas expostas).
πŸ”§

Independent server

MCP server is a process. It starts when called and stays available. It doesn't matter who called it.

πŸ”‘

Centralized env

Use .env shared. The GitHub token is in one place β€” both clients read it.

πŸ›‘οΈ

Allowlist by runtime

Each client can have a different allowlist. Codex allows everything, Claude allows read-only access. OK.

πŸ’‘Maintenance

A skill that needs a specific MCP? Declare it in openai.yaml sidecar for Codex AND in the frontmatter or doc for Claude. Polyskill handles this automatically when building.

Key concepts

Single server
Doesn't duplicate
central .env
Credentials once
2x declaration
JSON + TOML
Independent allowlist
By client
5

πŸͺ Hooks shared via script

Hooks are shell commands. Put the logic in scripts/check.sh in the project, both runtimes point to this script. Maintenance in one placeβ€”edit the script, and both agents follow it.

Recommended standard

# scripts/lint-on-edit.sh β€” lΓ³gica central
#!/bin/bash
set -e

CHANGED_FILE="$1"  # passado pelo hook

if [[ "$CHANGED_FILE" == *.ts ]]; then
  npx tsc --noEmit "$CHANGED_FILE"
  npx eslint "$CHANGED_FILE"
fi

if [[ "$CHANGED_FILE" == *.py ]]; then
  ruff check "$CHANGED_FILE"
fi

# .claude/settings.json β€” declara o hook
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Edit",
      "hooks": [{
        "type": "command",
        "command": "./scripts/lint-on-edit.sh ${file}"
      }]
    }]
  }
}

# .codex/config.toml β€” mesma coisa
[[hooks]]
event = "post_tool_use"
matcher = "edit"
command = "./scripts/lint-on-edit.sh ${file}"

βœ“ Logic in the script

  • β€’ Update the script β†’ applies to both
  • β€’ Script can be tested outside the agent
  • β€’ Versioned alongside the code
  • β€’ Can also be used in CI/pre-commit

βœ— Inline logic in hooks

  • β€’ Duplicates regex/commands across both runtimes
  • β€’ Forgets to update one side
  • β€’ Hard to test in isolation
  • β€’ Can't be reused outside hooks

πŸ’‘Git pre-commit hook too

Put scripts/lint-on-edit.sh no .git/hooks/pre-commit (or via husky). The same logic applies to both agents and manual commits. Triple guarantee.

Key concepts

Shared script
Core logic
Hook = wrapper
Only calls a script
Exit 0/1
Pass/block
Reuse in CI
Same script
6

πŸ“Š Governance β€” when to use which

Set of rules for choosing an agent by task type. Without a written rule, choices come down to unstable intuition. With a rule, new team members have a standard to follow.

Rule of thumb (real example)

Category
Claude Code
Codex
Long refactor (multi-file)
βœ“ Standard
backup
Deep debugging (hypotheses)
βœ“ Standard
backup
Test generation
backup
βœ“ Standard
Well-defined CRUD
backup
βœ“ Standard
Research/architecture (sub-agents)
βœ“ Standard
backup
Stuck in a loop
handoff β†’
β†’ over here
πŸ“

Write in CLAUDE.md/AGENTS.md

Put the rule in the project manual. Everyone on the team sees it.

πŸ”¬

Periodic A/B testing

Every 2–3 months, redo a task in both. Calibrate the rule.

🎲

"Grab the idle one"

When it's a tie, use whichever has less context loaded.

πŸ’‘Quarterly review

Models are updated all the time. What was one model’s strength may be another model’s strength 3 months later. Schedule a review of the rule of thumb every quarter. Without a review, the rule becomes a myth.

Key concepts

Written rule
Time consultation
A/B test
Calibrates
Default + backup
Always an alternative
Quarterly
Fixed review
7

πŸš€ Next runtimes β€” preparing for the future

The ecosystem doesn't stop at Claude+Codex. Gemini CLI, Cursor, Copilot, JetBrains AI Assistant are on the polyskill roadmap. Your cross-runtime skills are already readyβ€”all that’s missing is the adapter.

Polyskill roadmap

βœ“
Claude Code β€” complete adapter, production-ready
βœ“
OpenAI Codex β€” complete adapter, production-ready
βœ“
Portable β€” canonical source
πŸ”œ
Gemini CLI β€” under discussion, waiting for a stable spec
πŸ”œ
Cursor β€” under discussion
πŸ”œ
GitHub Copilot β€” under discussion
πŸ”œ
JetBrains AI Assistant β€” under discussion

How to contribute a new adapter

  1. Repo fork inematds/pollyskill
  2. Create a new file in src/adapters/<nome>.ts implementing an interface Adapter (parse, emit, validate)
  3. Register in src/adapters/index.ts: register(new SeuAdapter());
  4. Add an example in examples/<nome>-example/ with round-trip
  5. Open a PR with a tag new-adapter

Community β€” Early AI Dopters

The patterns behind polyskill, updates as new runtimes gain adapters, and a working group of builders shipping cross-runtime tools β€” all of this lives at:

skool.com/earlyaidopters/about

🦜The investment that lasts

Every skill you write in the portable format is future-proof. When Gemini gets an adapter, your skill works there on day 1. When Cursor does? Same thing. When β€œClaude 5 Code” comes along? Same thing. You don't rewrite it.

Key concepts

Via PR adapter
Standard contribution
Future-proof skill
Investment lasts
Community
Early AI Dopters
parse+emit+validate
Single slash

🎯Module summary

βœ“
Session handoff in 5 sections β€” becomes a skill, standardizes the transition.
βœ“
Two terminals in VS Code with colored profiles β€” focus shortcut, committed settings.
βœ“
Avoid overlap: by area OR by phase β€” simple discipline, zero lost work.
βœ“
Shared MCP server, declaration 2Γ— β€” central credentials (.env).
βœ“
Hooks call a central script β€” reusable in CI/pre-commit too.
βœ“
Governance = written rule of thumb + quarterly review β€” no myths.
βœ“
Gemini/Cursor/Copilot are coming β€” portable skills are ready.

🏁 Course complete!

You completed all 6 paths. Now you know the anatomy of both runtimes, how to migrate, how to write cross-runtime skills with polyskill, and how to work with both day to day.