Second Brain 2.0 for Codex & Local Agents

    One-time purchase. Build your AI infrastructure.

    Your Coding Agent Forgets.
    Your Second Brain Doesn’t.

    For people running OpenAI Codex CLI or a local coding agent who are tired of re-explaining the project every session. Your Second Brain is a file-system and memory architecture, not a Claude plugin. AGENTS.md, repo-native skills, and a SQL memory layer drive the same context whether you type into Codex, Claude Code, or a local model.

    Agent-agnostic • AGENTS.md + CLAUDE.md shipped • Runs local, offline-capable

    Same Codex.
    A Brain It Can Actually Read.

    Same agent, same prompt. The difference is the context it wakes up with.

    Without Second Brain

    "Add rate limiting to the checkout endpoint"

    "Sure. Before I start, can you tell me your framework, where middleware lives, and how you usually store counters? I don’t have context on this repo yet, so paste the relevant files and I’ll work from there."

    With Second Brain

    "Add rate limiting to the checkout endpoint"

    "Read AGENTS.md. Stack is Next.js + Upstash Redis, middleware lives in lib/middleware/, and your convention is sliding-window 100 req/min keyed by IP. Wrote lib/middleware/rate-limit.ts matching the pattern you used on the auth route last week. Tests added. No context questions needed."AGENTS.md is loaded before the first token, so Codex starts where you left off.

    Without Second Brain

    "Which agent should I run this refactor in?"

    "That depends on your setup. Claude Code, Codex, and local models each have different context handling, so you’d need to configure each one separately for this project."

    With Second Brain

    "Which agent should I run this refactor in?"

    "Both are already configured. Codex reads AGENTS.md, Claude Code reads CLAUDE.md, and both point at the same skills and the same SQL memory. Run the refactor in whichever you prefer today. The context, review rules, and past decisions are identical because they come from one source, not two forks."One brain, two surfaces. Switch agents without re-teaching the project.

    Without Second Brain

    "Work on this client repo without anything leaving my machine"

    "Understood, though I don’t retain anything between sessions. You’ll need to re-share the project structure and any decisions each time we start."

    With Second Brain

    "Work on this client repo without anything leaving my machine"

    "Running against your local model. Memory backend is PocketBase, a local SQLite file on this laptop, so decisions, patterns, and indexed code stay on disk. Recalled three past choices for this client from the last month. Nothing was sent to a cloud API to do it."Local model plus local memory. The context never leaves your device.

    What Is a Second Brain?

    Every coding-agent session starts from zero unless the context is already in the repo. A Second Brain is that context, written into files your agent reads on startup and a memory layer that compounds, wired for Codex and Claude Code at the same time.

    AGENTS.md + CLAUDE.md

    Both surfaces ship together. Codex reads AGENTS.md, Claude Code reads CLAUDE.md, and both point at one set of rules and skills. No fork, no drift.

    SQL Memory Backbone

    Decisions, patterns, and past sessions persist in a local SQL database with decay scoring. Your agent recalls them before it writes a line.

    Repo-Native Skills

    Skills live as files in the repo, readable by any agent. Edit one, duplicate it, chain it. Not locked inside a vendor UI.

    Local by Default

    PocketBase on your laptop means the whole memory layer runs offline. Good for client work, local models, and keeping code off cloud APIs.

    Plus: Agent-Agnostic Infrastructure

    Two Agents, One Brain

    Run codex vs claude code on the same repo with identical context. The comparison tests the agent, not which one you configured.

    Local-Model Ready

    Point a local model at the repo. It reads the same AGENTS.md and the same on-disk memory the cloud agents use.

    Indexed Codebases

    Any repos you point at get cloned and semantically indexed. Recall searches across all of them, from whichever agent you run.

    Compounds Over Time

    Every decision and every fix is persisted once and available to every agent, every session, going forward.

    How it fits together

    You

    talk to Claude

    Second Brain

    structures your context

    Claude

    works with full context

    Surfaces

    AGENTS.md • CLAUDE.md • local model

    Better Output

    every time

    The result: Instead of re-explaining your project every session, your agent already knows it. Codex reads AGENTS.md, Claude Code reads CLAUDE.md, a local model reads the same files. The context, the rules, and the memory come from one place, so switching agents costs you nothing.

    Static Context vs Engineered Context

    Static Context

    Engineered Context

    Setup

    You re-paste the project into each agent

    AGENTS.md + CLAUDE.md written once, read by both

    Memory

    Agent forgets everything on session end

    SQL memory persists decisions and patterns on disk

    Agent lock-in

    Config tied to one vendor’s tool

    Codex, Claude Code, or a local model read the same brain

    Privacy

    Context flows through a cloud API

    Local PocketBase backend, offline-capable, nothing leaves the laptop

    Skills

    Locked inside a UI you can’t edit

    Markdown files in your repo you own and change

    Comparison

    Different context per agent skews the test

    Identical context, so codex vs claude code is a fair fight

    This is why ChatGPT Memory, Notion AI, Cowork, DIY setups, courses, and one-off implementation services all hit the same wall.

    Personalized

    not templated

    Connected

    not isolated

    Measured

    not guessed

    Compounding

    not static

    Owned

    not rented

    Built for How Codex Users Actually Work

    Four patterns we see with people running Codex and local agents. Which one is you?

    The Codex CLI Native

    You live in the Codex terminal. The agent is fast, but every new session starts blank and you burn the first ten minutes re-explaining the repo before any real work happens.

    "I love the CLI. I hate that it forgets my project the second I close the tab."

    Backend dev, Codex daily

    The Agent Comparer

    You run codex vs claude code on the same problems to see which wins. You want the project context to be identical across both, so the comparison is about the agent and not about which one you happened to configure.

    "I switch agents by mood. The setup shouldn’t reset every time I do."

    Indie hacker, multi-agent

    The Local-Model Operator

    You run models locally for privacy or cost. Client code and decisions cannot go to a cloud API, so you need a memory layer that lives on your machine and still gives the agent real context.

    "Client work means nothing leaves the laptop. Memory included."

    Consultant, local-first

    The Repo-Native Builder

    You already keep an AGENTS.md and a few scripts, but they drift and half of them are stale. You want the repo itself to be the source of truth, structured so any agent reads it the same way.

    "My AGENTS.md was three versions behind reality. Now it maintains itself."

    Staff engineer, agent-tooling

    54%

    Never opened a terminal

    58%

    Non-technical roles

    87%

    Disorganized files

    8/8

    Setup friction = #1 blocker

    Iwo Szapar

    I'm Iwo Szapar. For the past 14 weeks, I sat down with 95 professionals — one at a time, 1-2 hours each — and manually built their Second Brains. What I was really doing was context engineering. That's also what made it impossible to scale.

    I was the bottleneck. So I built Second Brain 2.0.

    Deliverables that took 3 hours now ship in 15 minutes. Not because AI remembers more. Because AI validates before you review.

    Co-founded the AI Maturity Index with Harvard researchers (420,000 data points, acquired by ISG in 2026). Helped 3,000+ companies and 25,000+ professionals at Microsoft, Walmart, and governments worldwide.

    Trusted By

    MicrosoftWalmartDeloittePwC

    How It Wires Up Your Agents

    Self-paced. No call needed. Questionnaire, personalized repo, first shared-context session.

    Questionnaire maps which agents you run (Codex, Claude Code, local model), your stack, and your review rules.

    Primary agent (Codex CLI / Claude Code / local model)

    Stack and test framework

    Privacy needs (local-only vs cloud sync)

    Existing AGENTS.md or CLAUDE.md to merge in

    Output:Agent profile + surfaces to generate

    After setup

    AI Systems Decay. MemoryOS Prevents It.

    New clients, new projects, new preferences — if AI doesn't learn about them, it falls behind. MemoryOS runs decay detection on your SQL database, flagging knowledge items not accessed in 30+ days, tracking confidence scores, and monitoring context pressure across 38 dimensions.

    Decay Detection (file + data layer)Context PressureConfig AuditHealth Scores

    Beyond chat, shared context

    Not Locked to One Agent.
    One Brain, Every Agent.

    Every command reads the same repo files and the same SQL memory, so it behaves the same in Codex, Claude Code, or a local model. Type one command, get context-aware work, not a blank-slate guess.

    Context

    Codex Surface

    AGENTS.md

    The file Codex reads on startup. Stack, rules, conventions, and a pointer to your memory. Generated from the same source as CLAUDE.md so the two never drift.

    → Codex starts with full project context

    Claude Code Surface

    CLAUDE.md

    The Claude Code equivalent, built from the identical rule set. Switch agents and the context is the same, because it comes from one place.

    → Claude Code reads the same rules

    Cross-Agent Memory

    /recall

    Searches the SQL memory backbone and every indexed repo. Finds the decision you made last month, from whichever agent you happen to be running today.

    → 3 matches: past rate-limit decision + 2 patterns

    Compare

    Reverse-Engineer a Branch

    /schematic

    Point at any branch or PR. The agent reads the diff and writes the spec that would have produced it. Works the same in Codex or Claude Code.

    → specs/rate-limit-refactor.md

    Pre-Ship Gate

    /validate-build

    Runs typecheck, lint, and tests before you ship. Same gate whichever agent wrote the code, so quality does not depend on your agent choice.

    → tsc ok, lint ok, tests pass

    API Debug Console

    /debug-api

    Tail logs, replay failed webhooks, inspect the last N requests to an endpoint. Reads your real infra through MCP, agent-agnostic.

    → Last 50 requests, 2 failures traced

    Own

    Safe Migrations

    /migrate-database

    Writes reversible migrations with backfills and rollback plans against your own database. Runs local, nothing routed through a vendor.

    → migration + rollback written

    Persist a Decision

    /save

    Writes a decision or pattern into the local SQL memory with rationale. Next session, any agent recalls it before proposing something new.

    → decision logged, decay score 1.0

    Security Audit

    /security-review

    Reviews auth, input validation, secrets, and the OWASP top 10 across recent diffs. Fresh context, runs in whichever agent you prefer.

    → PASS with 1 warning on /api/login

    Repo-native skills. Build your own in minutes.

    Every skill is a markdown file. Read it, edit it, duplicate it, and any agent that reads the repo can run it.

    Your Data Stays on Your Computer

    The Guide is a remote plugin that reads your local brain structure to give guidance. Your actual content, client data, and personal information never leave your computer. We only see which tools you call and how often — for product improvement.

    The 5 Layers of Context Engineering

    Context engineering isn't one thing — it's a stack. Each layer makes AI smarter about you and your work.

    01

    Project Instructions (CLAUDE.md)

    A file at the root of your workspace that Claude reads on every conversation. Your preferences, rules, writing style, tool conventions — loaded automatically, every time.

    # CLAUDE.md
    ## Voice: Direct, no fluff. Never use "leverage" or "synergy."
    ## Clients: Enterprise SaaS, 50-200 employees
    ## When writing proposals: Use the 3-part framework from /templates
    02

    Persistent Memory

    AI learns from every conversation and stores patterns, client details, and decisions in a local SQL database with 12 queryable collections and confidence scoring. Month 1: knows your name. Month 6: knows your client's pricing objections, when the last interaction was, and which proposals need updating.

    03

    Tool Connections (MCP)

    The Model Context Protocol lets any agent read and act on your real tools. GitHub for repos and PRs, the terminal for commands, your database for state. Codex and Claude Code both speak MCP, so the same connections work no matter which agent you run.

    Codex CLIClaude CodeGitHubVS CodeTerminalPocketBaseSupabaseLocal Model
    04

    Skills & Workflows

    Reusable commands like /daily-briefing or /draft-proposal that combine multiple tools and context sources into one action. Type one command, get a complete output that would've taken 30 minutes manually.

    05

    Hooks — Deterministic Automation

    This is where context engineering gets powerful. Hooks are shell commands that fire automatically at specific points — before a tool runs, after a file is saved, when a session starts. They don't rely on AI judgment. They always execute.

    SessionStart

    Load AGENTS.md + recalled memory

    When the agent opens, inject the active task and past decisions before the first prompt

    PreToolUse

    Block edits on main branch

    A guard fires before any code change, forcing a session branch, same rule for every agent

    PostToolUse

    Log decisions to SQL memory

    After a meaningful change, persist the pattern so the next session recalls it

    Stop

    Extract learnings when the queue fills

    When a session ends with events queued, compound them into memory

    # AGENTS.md: the context Codex reads before the first token

    # AGENTS.md
    ## Stack
    Next.js + Supabase + shadcn. Tests: Vitest + Playwright.
    
    ## Rules
    - Never edit on main. Use a session branch.
    - Match existing middleware patterns in lib/middleware/.
    - Recall past decisions before proposing a new one.
    
    ## Memory
    Local PocketBase at .memory/brain.db. Recall before you write.

    The system configures your hooks automatically. You don't write JSON — you tell it what you want enforced.

    Most "AI setups" only use Layer 1.

    A Second Brain uses all 5 layers working together. That's why the output quality is fundamentally different.

    What no other AI tool gives you

    Your Database.
    Your Infrastructure.
    Your Rules.

    Every AI wrapper stores your data on their servers. Cancel and it's gone. Your Second Brain deploys on infrastructure you own — Supabase + Vercel, both free tier. Cancel us and keep everything.

    Your Own Database

    PocketBase local SQLite or Supabase. Your decisions, patterns, and indexed code sit in tables you can query with SQL. Not locked in a vendor API.

    Your Own Context Files

    AGENTS.md and CLAUDE.md live in your repo, in git, editable by hand. The agent reads them. You own them.

    Your Own Agents

    Codex, Claude Code, or a local model, all running on your machine against your files. Your code and memory never leave your device.

    Updates Without Lock-In

    Skills and rules are files, not pinned vendor code. Improve a skill and every agent that reads the repo picks it up. No platform migration.

    Typical AI SaaS
    • Data stored on their servers
    • Cancel = lose everything
    • They control pricing, features, access
    • Your AI context locked in their format
    • Monthly rent for what should be yours
    Second Brain 2.0
    • Your Supabase database — you have the password
    • Cancel us, keep everything deployed
    • Open source formats: markdown, JSON, SQL
    • 95+ API endpoints running on your Vercel
    • One-time build, $0-20/mo to run

    SaaS expires. Infrastructure compounds.

    What Builders Say

    Wouter van den Bijgaart

    AI Developer

    Replaced DIY setup

    "I built my own system and spent 3 hours a week maintaining it. The Second Brain does the maintenance automatically."

    Gabe Marusca

    Consultant / Dev

    20+ hrs/week saved

    "Now I type /yalla and ship features I used to spend a day on."

    Damian

    Professional

    Profoundly changed

    "The regular AI tools now just seem like child’s play. This has profoundly changed how I work."

    Pricing

    Pay once. Own it forever.

    Quick math

    97 professionals are running their Second Brain right now. If it saves you 5 hours per week at $200/hr, that's $4,000/month in recovered time. The Kickstart pays for itself in the first week. One purchase. No subscriptions.

    For technical users who want full control

    DIY

    The full system. You set it up.

    $98.50one-time

    $197 with SB50

    Full repo: 55 skills, 21 agents, 7 integrations

    Setup guide + Health Check MCP

    Community access

    Self-serve — you configure at your pace

    MemoryOS available separately ($199/yr)

    No support included

    7-day money-back guarantee.

    Get DIY - $98.50
    Most Popular

    For professionals who want it working today

    Kickstart

    AI configures it. You're running in minutes.

    $298.50one-time

    $597 with SB50

    Everything in DIY

    AI agent builds your system from your answers

    48-hour priority async support

    First year of MemoryOS Pro included ($349 value)

    Async support — no calls needed

    7-day money-back guarantee.

    Get Kickstart - $298.50

    For leaders who want it built for them

    Done-With-You

    2-hour onboarding call + full setup.

    $1,248.50one-time

    $2,497 with SB50

    Everything in Kickstart

    2-hour onboarding call with Iwo

    I deploy your infrastructure (Vercel + Supabase)

    Monthly Second Brain updates (new agents, skills, tools)

    12 months MemoryOS included

    2-hour call + direct access to Iwo

    7-day money-back guarantee.

    Get DWY - $1,248.50

    Your system stays current. Automatically.

    New tools and skills ship through MemoryOS. Updates arrive without you doing anything. Health monitoring spots what needs attention. Weekly recommendations tell you what to fix. Included in Kickstart and Done-With-You.

    What Happens After You Buy

    1

    Get Repo

    5 min

    Instant email with GitHub repo

    2

    Questionnaire

    15 min

    Answer about role and workflows

    3

    Build

    ~60 min

    System generates, configured for you

    4

    First Win

    7 min

    Run /overview, priorities are there

    5

    Deploy Infra

    30 min

    One-click Vercel + Supabase (optional)

    FAQ

    Better System.
    Better Output. Every Time.

    Stop fighting generic AI. Start with a system that knows you.

    Kickstart — Most Popular

    $298.50

    Done-With-You

    $1,248.50
    7-day money-back guarantee
    95+ professionals deployed