PTENES
Playbook + CLI · Claude Code × Codex

One brain, two agents

Use the same second brain with Claude Code and Codex: the right agent and model for each task, manuals and skills always in sync, and usage tracked. Pure bash, no dependencies.

A brain glowing amber, connected by beams to two computer terminals
What it is

The same brain, without becoming two

Your second brain (the astra-2cerebro kit’s Markdown folder) can be read by Claude Code and Codex. Each one enters through a different door: CLAUDE.md e .claude/skills on one side, AGENTS.md e .agents/skills on the other side. cerebro-duplo keeps the interfaces the same and decides which one to use.

🪞 Parity

duplo.sh verificar checks that AGENTS.md = CLAUDE.md, that each skill is mirrored byte for byte, and that each one has the openai.yaml from Codex. sync fixes it. The skill duplo-verificar reports and proposes changes without making them on its own.

🧭 Routing

The skill qual-agente reads the request, chooses the agent, model, and effort level using a table (MCP configured, repo open, heavy reasoning, low-cost routine), and returns the command. Profiles .env store the model and effort level for each task type.

📒 Usage and quota

uso registrar logs each session in registro-uso.md; uso resumo totals by agent and profile. No made-up prices: minutes and sessions here, money in the provider’s pricing table.

How it works

From request to log entry

A short cycle, repeated in each session. The model and effort flags are the actual ones from both CLIs (read from --help): --model/--effort in Claude Code, -m/-c model_reasoning_effort in Codex.

request→ /qual-agente or $qual-agente→ agent + profile→ duplo.sh claude|codex <perfil>→ work on the brain→ duplo.sh sync→ duplo.sh uso registrar
1

Route

Specific MCP → the agent that has it. Code → where the repo is open. Audit, architecture, large wiki → raciocinio. Find, summarize, draft → rotina.

2

Open

duplo.sh claude raciocinio prints and executes cd cérebro && claude --model fable --effort high. --so-mostrar only prints.

3

Sync

Did you edit the manual or a skill? sync rewrites the mirror from the canonical version (AGENTS.md, .claude/skills). Never deletes; warns.

4

Record

One line per session: agent, profile, model, effort, minutes, task. On Thursday, uso resumo shows where the quota went.

Prerequisites

What needs to exist

One astra-2cerebro brain and bash. Agents are only needed when starting a session.

One brain

Folder created by the astra-2cerebro kit, with AGENTS.md, CLAUDE.md, .claude/skills/ e .agents/skills/.

# if you don't have one yet
git clone https://github.com/inematds/astra-2cerebro.git
# follow the kit's INSTALAR.md

bash + coreutils

Linux, macOS, Git Bash, or WSL. diff, awk, cp. No Node, Python, or packages.

bash --version   # 4+
diff --version
awk --version

Claude Code and/or Codex

Optional. verificar, sync e uso work without either one.

claude --version   # tested: 2.1.263
codex --version    # tested: 0.153.3
User guide · step by step

Install, verify, route, log

Real commands. Replace ~/meu-cerebro through your brain’s folder.

1

Install in the brain

Clones the repo and copies the two skills to .claude/skills e .agents/skills, e o duplo.sh (with perfis/ e modelos/) to scripts/. Runs the verificar at the end.

git clone https://github.com/inematds/cerebro-duplo.git
cd cerebro-duplo
bash instalar.sh ~/meu-cerebro
2

Check parity

Identical manual, mirrored skills, openai.yaml present, valid manual routes. Exit code 1 if there’s a PROBLEM; a broken route is just a WARNING (the /iniciar creates multiple files afterward).

cd ~/meu-cerebro
bash scripts/duplo.sh verificar
# OK: AGENTS.md and CLAUDE.md are identical
# OK: 10 identical skills on both sides
# == result: 0 issue(s), 6 warning(s)
3

Adjust the profiles to your plan

The model names included in the repo are for this machine. Edit scripts/perfis/*.env. Trusted sources: claude --help (aliases fable, opus, sonnet; effort low…max) and your ~/.codex/config.toml.

bash scripts/duplo.sh perfis
#   code         claude: claude-opus-5-5/high     codex: gpt-6-astra/high
#   standard     claude: sonnet/medium  codex: gpt-6-astra/medium
#   reasoning    claude: claude-opus-5-5/high   codex: gpt-6-astra/high
#   routine      claude: sonnet/low     codex: gpt-6-astra/low
nano scripts/perfis/padrao.env
4

Ask which agent to use

Inside any session. The skill responds in four lines: agent · profile · model/effort, two reasons, the command, and the log entry for the end.

# in Claude Code
/qual-agente preciso auditar o cérebro, faz um mês que não rodo
# in Codex
$qual-agente preciso auditar o cérebro, faz um mês que não rodo

# typical response:
# codex · reasoning · gpt-6-astra/high
# Auditing requires heavy reasoning: a cheap model inflates the score.
# Codex because Claude Code has already used more of its quota this week.
# bash scripts/duplo.sh codex raciocinio
# when closing: bash scripts/duplo.sh uso registrar codex raciocinio 25 "auditoria mensal"
5

Open the agent with the profile

The script prints the command before running it. With --so-mostrar only prints (useful for checking the flags without using quota).

bash scripts/duplo.sh claude raciocinio --so-mostrar
# command: cd ~/meu-cerebro && claude --model fable --effort high --name duplo:raciocinio

bash scripts/duplo.sh codex rotina --so-mostrar
# command: codex -C ~/meu-cerebro -m gpt-6-astra -c model_reasoning_effort=\"low\"

bash scripts/duplo.sh codex raciocinio      # actually opens
6

Sync after editing

Always edit the canonical version (AGENTS.md, .claude/skills/...). O sync rewrites the other side. --fonte claude reverses the direction in the manual when the good edit is in CLAUDE.md.

bash scripts/duplo.sh sync                  # AGENTS.md → CLAUDE.md; .claude/skills → .agents/skills
bash scripts/duplo.sh sync --fonte claude   # CLAUDE.md → AGENTS.md
bash scripts/duplo.sh verificar             # 0 issue(s)
7

Record usage and read the summary

One line per session in registro-uso.md (created from the template the first time). The summary is what drives the quota rule: when the week is tight, step down one level or switch agents.

bash scripts/duplo.sh uso registrar codex raciocinio 25 "auditoria mensal"
bash scripts/duplo.sh uso registrar claude rotina 8 "resumo reunião 06/09"
bash scripts/duplo.sh uso resumo
# | Agent | Sessions | Minutes |
# | claude | 1 | 8 |
# | codex  | 1 | 25 |
# total: 2 sessions, 33 minutes
8

Agent parity report

The skill duplo-verificar runs the verificar and turns the output into a short report with one fix per item. It doesn’t fix anything on its own: it ends by asking if it can apply the changes.

/duplo-verificar       # Claude Code
$duplo-verificar       # Codex

Routing table (summary)

The complete version, with explanations and quota rules, is at docs/roteamento.md.

TaskAgentProfile
Uses a specific MCP (calendar, email, browser)what has the MCP configuredpadrao
Long code, refactoring, connection scriptwhere the repo is already opencodigo
Audit, architecture, difficult decision, large wikieither one (more quota available)raciocinio
Find a document, summarize a meeting, draft an emaileither onerotina
Interview, discovery conversationwhat you’d rather discusspadrao
Scheduled routine, without supervisionwhat already has the schedulingrotina
Examples

Real outputs

Captured on this machine against test/fixture, a small brain for the kit.

Parity broken and fixed

One more line in the CLAUDE.md and a skill edited only in the mirror.

$ duplo.sh --dir cerebro verificar
PROBLEMA: AGENTS.md e CLAUDE.md divergem (diff abaixo)
    +- linha só no CLAUDE.md
PROBLEMA: skill 'rotina' difere entre .claude/skills e .agents/skills:
    Files .claude/skills/rotina/SKILL.md and .agents/skills/rotina/SKILL.md differ
== resultado: 2 problema(s), 6 aviso(s)

$ duplo.sh --dir cerebro sync
manual: CLAUDE.md gravado a partir de AGENTS.md
skills: 1 sincronizada(s) .claude/skills -> .agents/skills

$ duplo.sh --dir cerebro verificar
OK: AGENTS.md e CLAUDE.md são idênticos
OK: 8 skills idênticas nos dois lados
== resultado: 0 problema(s), 6 aviso(s)

Tests

bash test/testes.sh: 38 assertions covering verify, sync, usage, profiles, and installer.

PASS: verificar passa na fixture íntegra
PASS: verificar falha quando AGENTS.md e CLAUDE.md divergem
PASS: sync conserta o manual a partir de AGENTS.md
PASS: verificar acusa skill sem cópia no espelho
PASS: sync não apaga skill só no espelho
PASS: uso resumo soma por agente (claude 2 sessões, 45 min)
PASS: claude --so-mostrar imprime cd + claude --model --effort
PASS: codex --so-mostrar imprime codex -C -m -c model_reasoning_effort
PASS: duplo.sh instalado verifica o cérebro com as 10 skills
...
== resultado: 38 passaram, 0 falharam
Roadmap

What exists and what’s coming

Version 1.0.0 completes the verify → route → record cycle. Everything else is optional and depends on actual usage.

1.0.0
Full cycle (done)duplo.sh with check, sync, claude/codex by profile, usage; skills qual-agente e duplo-verificar; 4 profiles; installer; 38 tests; 6 documents.
next
Pre-commit hook readyOptional script that installs the verificar like pre-commit in the versioned brain (today it’s a snippet in docs/paridade.md).
next
Third agentBlock DUPLO_<AGENTE>_* in the profiles and cmd_<agente> in the script for any runtime that can read AGENTS.md (the path is in docs/migracao.md).
idea
Weekly summary as a routineOne /rotina from the kit that runs uso resumo every Friday and records the reading in rotinas/registro.md.