SA² Research & Engineering

Intercognitive Collaboration: Engineering a Native Go IDE for Multi-Model Human-AI Teamwork

6 min read

Claude, Gemini, GPT and Grok, each labelled AI, linked to each other and to a human engineer at the centre, inside a ring labelled runtime-enforced governance. The Code Badger mascot sits at the lower left.

Most AI coding tools built over the past two years share an implicit assumption: that software development is a conversation between one human and one model. Whether it is a chat sidebar bolted onto an Electron editor or an autonomous CLI agent running in a terminal pane, the underlying architecture is a single-agent loop.

At Strategic Agentic Acceleration (SA²), our research began from a different premise. When we studied how complex software actually gets designed, debugged, and verified, the failure modes of single-agent workflows fell into two predictable buckets:

  • Single-model monoculture: Asking a model to generate code and then critique its own output reinforces the same architectural blind spots and training biases.
  • Passive human rubber-stamping: When an agent dumps a 600-line multi-file diff into a chat window, human cognitive fatigue sets in. Engineers either micromanage every line (destroying speed) or approve everything blindly (destroying repository hygiene).

We call the alternative intercognitive collaboration—designing software systems where human engineers and multiple distinct AI reasoning architectures (Claude, Gemini, GPT, Grok) operate as complementary cognitive nodes under deterministic, runtime-enforced governance.

Left: one human and one model pass a prompt and a 600-line diff back and forth, and the model critiques its own output, leading to monoculture and rubber-stamping. Right: Claude, Gemini, GPT and Grok work inside a runtime-enforced governance boundary. Model A drafts, Model B audits the staged diff, and the human approves or denies.
Single-agent loop versus intercognitive collaboration.

To test these principles on real production repositories, we realised a plugin or VS Code fork wouldn’t cut it. We ended up building Code Badger, a native macOS IDE written in Go. Here is what our research taught us about multi-model coordination—and the systems engineering required to make it run locally without bloat.

1. Why Single-Agent Loops Break Down

In our internal experiments testing multi-file refactors and concurrency bugs across real codebases, we observed a consistent pattern: frontier models have asymmetric strengths.

One model family might excel at decomposing a sprawling system requirement into clean module boundaries, while another is markedly sharper at spotting subtle race conditions, edge-case nil dereferences, or security regressions in the resulting patch. Yet existing tooling forces developers to either manually copy-paste diffs between browser tabs and CLI tools, or lock themselves into a single vendor’s ecosystem.

True intercognitive collaboration requires three runtime primitives that chat interfaces lack:

  • Adversarial cross-examination: Model A drafts an implementation against an objective; Model B audits the staged diff against acceptance criteria before the human is ever interrupted.
  • Persistent shared state: Agents and humans need a unified view of objectives, verified decisions, file diffs, and build outputs—not a scrolling chat transcript where context decays.
  • Hard-coded authority boundaries: Human governance cannot rely on polite system prompts (“Please ask before deleting files”). It must be enforced by the execution runtime itself.
Three cards. 01 Adversarial cross-examination: Model A drafts, Model B audits the staged diff. 02 Persistent shared state: one board of objectives, decisions, file diffs and build output, read by you and the AI agents. 03 Hard-coded authority boundaries: a polite prompt is struck out and replaced by a runtime gate that holds actions for sign-off.
The three runtime primitives that chat interfaces lack.

2. Why We Built the Runtime in Go Instead of Forking VS Code

Early on, we faced the classic devtools fork-in-the-road: fork VS Code (like almost every other AI IDE) to inherit a mature extension ecosystem, or build a native desktop runtime from scratch.

Forking VS Code makes sense when your primary workload is inline autocomplete. It becomes a bottleneck the moment you orchestrate three or four concurrent agents streaming responses, running local test suites, watching filesystem events, and staging diffs simultaneously. Electron’s multi-process Chromium architecture already consumes hundreds of megabytes of RAM at idle; layering parallel agent streams and terminal PTYs on top quickly degrades responsiveness on developer laptops.

Qualitative comparison, no benchmark figures. Left: an Electron or VS Code fork stacks a bundled Chromium engine, multiple processes, a Node extension host and a chat sidebar, with parallel agent streams and terminal PTYs layered on top. It gains a mature extension ecosystem but responsiveness degrades as agents multiply. Right: a single compiled Go binary runs one goroutine per stream for Anthropic, Google Gemini, OpenAI, xAI and local CLI runners under a context.Context cancellation tree, where a stop rule cancels every stream. It uses the native macOS window, Keychain and FSEvents, owns every byte between the model and the disk, and gives up the long tail of VS Code extensions.
Forking VS Code versus building a native Go runtime. A qualitative comparison, not a benchmark.

We chose Go as the core runtime for macOS (supporting both Apple Silicon and Intel on macOS 12+) for four specific systems reasons:

  • First-class concurrency for multi-model orchestration: Managing parallel token streams from Anthropic, Google Gemini, OpenAI, and xAI APIs—alongside local CLI runners like Claude Code, Codex, and Grok Build—maps naturally to Go’s goroutines, channels, and context.Context cancellation trees. When a developer aborts an agent run or hits a stop rule, every downstream subprocess and HTTP stream terminates in milliseconds.
  • Cold-start speed and lean memory footprint: A compiled Go binary launches directly into a native macOS window without spinning up a bundled browser engine, leaving system memory free for Docker containers, local compilers, and language servers.
  • Zero-proxy local privacy: Because the desktop binary speaks directly to model endpoints and local CLI tools, user source code never passes through an SA² intermediary server. Credentials stay isolated inside the native macOS Keychain (Security.framework) rather than sitting in plaintext .env or JSON config files.
  • Single-binary distribution: Shipping a notarised, self-contained .app bundle with zero runtime dependencies eliminates the Node/Python environment drift that plagues many agentic developer tools.

Honest Engineering Tradeoffs

Building natively in Go on macOS is not free of friction. You give up the long tail of third-party VS Code extensions, and bridging Go to native macOS system APIs (Keychain access, FSEvents file watching, menu bars, and WebKit/native windowing) requires disciplined CGo boundaries and careful memory management across the Go/Objective-C runtime divide. We also had to build our diff staging, integrated terminal PTY management, and Git state tracking from the ground up rather than inheriting them from Monaco/VS Code. For a governance-first control room, that tradeoff was worth making—we own every byte between the model and the disk.

3. Translating Governance Theory into Runtime Mechanics

The hardest engineering problem in intercognitive collaboration is balancing autonomous velocity against human authority. If an agent asks permission before reading every file, it is useless. If it can run arbitrary shell commands unsupervised, it is dangerous.

We solved this by placing a deterministic policy layer—powered by our deterministic execution engine—between the agent layer and the local OS/filesystem.

The Human Engineer exchanges approvals with the Control Room & Diff Staging. Every action then passes through Deterministic Policy & Stop Rules before it reaches one of three targets: Frontier APIs (Claude, Gemini, GPT, Grok), Local CLI Agents (Claude Code, Codex, Grok Build) or the Local OS / PTY (staged patch FS, builds and Git).
The deterministic policy layer sits between the agent layer and the local OS and filesystem.
Text version of the diagram
[ Human Engineer ] <---> [ Control Room & Diff Staging ]
                                    |
                    (Deterministic Policy & Stop Rules)
                                    |
        +---------------------------+---------------------------+
        |                           |                           |
[ Frontier APIs ]          [ Local CLI Agents ]        [ Local OS / PTY ]
(Claude, Gemini,           (Claude Code, Codex,        (Staged Patch FS,
   GPT, Grok)                  Grok Build)              Builds & Git)

In practice, this separates execution into two distinct modes:

Supervised Diff & Command Staging (Default)

By default, agents do not write directly to your working tree or execute unvetted terminal commands. Proposed file edits are captured as structured patches, cross-reviewed if multi-model verification is enabled, and presented alongside an explicit command list. Nothing touches disk or runs in your shell until you approve it.

Timed, Per-Project Autonomy Mode

When a developer wants speed—such as scaffolding a feature, iterating on a failing test suite, or refactoring a module—switching on a timed, per-project autonomy mode grants the agent team autonomous execution strictly within user-defined boundaries:

  • Permitted autonomous loop: Agents can read files, apply staged edits, run local builds and unit tests, inspect compiler errors, and create local commits iteratively until acceptance criteria pass.
  • Hard-blocked runtime gates: High-risk actions—including git push, branch merges, file deletions, modifying repository permissions, or accessing sensitive paths (.env, SSH keys, credential stores)—remain enforced at the runtime level, halting execution for human sign-off regardless of what a model outputs.
  • Snapshots for batch undo: Before each file is first changed during a run, Code Badger saves its original contents. One Undo restores the files the run edited (up to 16 MB), and leaves anything you changed afterwards alone. It can’t undo changes made by build or test commands.
Left, the default: agents propose edits and commands, which are captured as structured patches and staged commands, optionally cross-reviewed by a second model, then wait for your approval with Approve and Deny buttons in amber. Only then are they applied to disk or run in your shell. Right, an opt-in timed, per-project autonomy mode: a permitted loop of read files, apply staged edits, run builds and unit tests, inspect compiler errors and create local commits until acceptance criteria pass. Hard-blocked runtime gates, shown in amber, halt execution for sign-off on git push, branch merges, file deletions, repository permissions, .env, SSH keys and credential stores.
Two execution modes. Approvals and runtime gates are shown in amber: they hold work for you, they are not errors.

4. Three Empirical Lessons from Our Research

Running intercognitive workflows daily across our own Go and systems codebases surfaced a few counterintuitive findings:

  • Cross-model review shines on interfaces and edge cases, not formatting: Having GPT or Gemini review a Claude-generated patch catches subtle API contract mismatches and unhandled error paths far more reliably than a second pass from the same model. However, running cross-model critique on trivial boilerplate just adds latency—selective routing matters.
  • Traceable decisions beat chat logs: Developers rarely re-read a 4,000-word agent chat transcript, but they will audit a structured Control Room log showing: Objective → Proposed Plan → Model B Critique → Verification Check Passed → Diff Ready. Structuring agent output around verifiable state transitions dramatically lowers review fatigue.
  • BYO subscriptions eliminate adoption friction: Developers already pay for Anthropic, OpenAI, Google, or xAI plans—or run Claude Code and Codex CLIs locally. Letting engineers plug existing API keys and CLI subscriptions directly into a unified Control Room without token markups removes the economic friction of multi-model teamwork.
Five steps: 01 Objective, set by you. 02 Proposed plan, from Model A. 03 Model B critique, from a second model. 04 Verification check passed, a runtime check. 05 Diff ready, which waits for your approval in amber.
A traceable decision chain, as recorded in the Control Room log.
Code Badger window with the Connect your own agent panel open, listing Claude Code, Codex and Grok Build as found on this Mac, next to the Code Badger welcome screen.
A real capture from Code Badger 1.0.1 in dark mode: connecting a CLI agent that is already installed on the Mac. Claude Code, Codex and Grok Build are detected with their versions. Captured from the shipping app, not a mock-up.

What’s Next

We are continuing to research formal verification hooks, multi-agent task decomposition patterns, and deterministic sandboxing for local developer environments.

If you develop on macOS and want to test this architecture on your own repositories, Code Badger 1.0.1 is the commercial release built directly from this research. It is available now at codebadger.ai as a one-time Founder’s Edition (US$49, capped at 1,500 licences, with zero recurring subscription and no SA² server in the loop for your code or prompts).