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.

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.
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.
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.
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.
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.
Specific MCP → the agent that has it. Code → where the repo is open. Audit, architecture, large wiki → raciocinio. Find, summarize, draft → rotina.
duplo.sh claude raciocinio prints and executes cd cérebro && claude --model fable --effort high. --so-mostrar only prints.
Did you edit the manual or a skill? sync rewrites the mirror from the canonical version (AGENTS.md, .claude/skills). Never deletes; warns.
One line per session: agent, profile, model, effort, minutes, task. On Thursday, uso resumo shows where the quota went.
One astra-2cerebro brain and bash. Agents are only needed when starting a session.
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
Linux, macOS, Git Bash, or WSL. diff, awk, cp. No Node, Python, or packages.
bash --version # 4+ diff --version awk --version
Optional. verificar, sync e uso work without either one.
claude --version # tested: 2.1.263 codex --version # tested: 0.153.3
Real commands. Replace ~/meu-cerebro through your brain’s folder.
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
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)
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
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"
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
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)
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
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
The complete version, with explanations and quota rules, is at docs/roteamento.md.
| Task | Agent | Profile |
|---|---|---|
| Uses a specific MCP (calendar, email, browser) | what has the MCP configured | padrao |
| Long code, refactoring, connection script | where the repo is already open | codigo |
| Audit, architecture, difficult decision, large wiki | either one (more quota available) | raciocinio |
| Find a document, summarize a meeting, draft an email | either one | rotina |
| Interview, discovery conversation | what you’d rather discuss | padrao |
| Scheduled routine, without supervision | what already has the scheduling | rotina |
Captured on this machine against test/fixture, a small brain for the kit.
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)
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
Version 1.0.0 completes the verify → route → record cycle. Everything else is optional and depends on actual usage.
duplo.sh with check, sync, claude/codex by profile, usage; skills qual-agente e duplo-verificar; 4 profiles; installer; 38 tests; 6 documents.verificar like pre-commit in the versioned brain (today it’s a snippet in docs/paridade.md).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)./rotina from the kit that runs uso resumo every Friday and records the reading in rotinas/registro.md.