Skip to main content

FlyWire Coding Cortex

Pip-installable connector for AI coding agents: install once, then every Cursor / OpenClaw / Claude session can run FlyWire-derived neurons (leaky integrate-and-fire on real synapse edges) and map population rates into coding drives (implement, stop, reverse, steer, groom).

Code license MIT
Circuit data FlyWire-derived, CC BY-NC 4.0
Anatomy browser FlyWire Codex
Default seed 668 neurons · ~19k signed edges (FAFB v783 escape/steering subgraph)

Honesty bar: Wiring and contact counts come from public FlyWire data. Membrane dynamics, task→current encoding, and the rate→coding map are models. This does not claim biologically calibrated coding skill or that a fruit fly “understands” your codebase.


Why this exists

Most agent “skills” are markdown instructions. This package is a pip-installable tool plus an ambient skill/MCP connector so agents can call a real runtime every session—without cloning a folder into every project.

coding task
    │
    ▼
sense (risk / tests / urgency → currents)
    │
    ▼
LIF on FlyWire-derived circuit.json
    │
    ▼
population rates (gf, dnp09, mdn, loom, …)
    │
    ▼
CodingSignals (primary drive + clamps)
    │
    ▼
agent acts  ──verify──►  Hebbian coding memory

Quick start

# From this repository
pip install -e .
# Optional (needed for --profile full):
# pip install -e ".[full]"

flywire-cortex fetch --profile seed
flywire-cortex install
flywire-cortex status

Smoke test:

flywire-cortex reset
flywire-cortex sense --text "urgent failing auth bug"
flywire-cortex step --ms 50
flywire-cortex signals

Example: giant-fiber stop drive

flywire-cortex reset
flywire-cortex stimulate gf --strength 0.5 --ms 80
flywire-cortex step --ms 10
flywire-cortex signals
# → primary: "gf", escape: true, stop: true

If pip install fails (SSL / corporate proxy), you can still run from source:

$env:PYTHONPATH = "C:\path\to\flywire-coding-cortex\src"
python -m flywire_coding_cortex.cli status

Install

1. Package

pip install flywire-coding-cortex          # when published to PyPI
# or
pip install -e .                          # from a clone
# or
uv tool install .

pip install does not download connectome dumps. Data is opt-in via fetch.

2. Circuit profile

flywire-cortex fetch --list-profiles
flywire-cortex fetch --profile seed       # default, offline after copy

3. Wire agents

flywire-cortex install
# or subset:
flywire-cortex install --targets cursor openclaw

Copies skill/ into:

Target Path
Cursor ~/.cursor/skills/flywire-coding-cortex/
OpenClaw ~/.openclaw/workspace/skills/flywire-coding-cortex/ (and ~/.openclaw/skills/ when present)
Claude ~/.claude/skills/flywire-coding-cortex/

Also writes ~/.flywire-coding-cortex/mcp.snippet.json.

4. Optional MCP connector (Cursor)

Add to your Cursor MCP config:

{
  "mcpServers": {
    "flywire-coding-cortex": {
      "command": "flywire-cortex",
      "args": ["mcp"]
    }
  }
}

Then restart the agent session. Tools exposed:

Tool Purpose
cortex_status Active profile + neuron/edge counts
cortex_sense Task text → sensory currents
cortex_step Advance LIF (ms, optional text)
cortex_stimulate Stim a role group (gf, dnp09, …)
cortex_signals Clamped coding drives JSON
cortex_remember Query / strengthen / weaken memory

Download profiles

Choose (and later change) how much FlyWire data to pull. Profiles are cached side-by-side under ~/.flywire-coding-cortex/profiles/<name>/. status / step always use the active profile.

Profile Approx size Command What you get
seed ~0.3–5 MB flywire-cortex fetch Bundled curated subgraph (668 cells by default)
codex ~60–300 MB flywire-cortex fetch --profile codex Public Codex gzipped CSVs + ETL rebuild
full ~10.6 GB flywire-cortex fetch --profile full --yes Zenodo Feathers + ETL (explicit confirm)
flywire-cortex fetch --list-profiles
flywire-cortex fetch --profile seed --force     # re-copy / switch back
flywire-cortex fetch --profile full --yes
flywire-cortex fetch --profile full --yes --include-synapses   # also ~9.5 GB synapse table
flywire-cortex status

Rules:

  • Agents must never auto-run full. Ask the human first.
  • full requires --yes and pip install 'flywire-coding-cortex[full]' (pandas + pyarrow).
  • URLs live in data/manifest.json so mirrors can be edited without code changes.

Codex dump base (FAFB v783):

https://storage.googleapis.com/flywire-data/codex/data/fafb/783


Every coding turn (agent loop)

The bundled skill instructs agents to run this loop (CLI or MCP):

  1. status — ensure a circuit exists (fetch --profile seed if missing)
  2. sense --text "…" — encode the task into currents (risk, test-red, urgency, ambiguity)
  3. step --ms 50 — run LIF on real edges
  4. signals — read primary drive and clamps
  5. Act only under that primary drive (see Roles)
  6. Apply practices
  7. After verify: remember strengthen|weaken

LIF voltage/rates persist across separate CLI invocations in ~/.flywire-coding-cortex/state/lif_state.json. Use flywire-cortex reset to clear between unrelated tasks.


CLI reference

flywire-cortex <command> …
Command Description
fetch Download / activate a profile (--profile, --list-profiles, --force, --yes, --include-synapses)
status Home path, active profile, neuron/edge/role counts
sense Encode task text (or --risk / --test-red / --urgency / --ambiguity)
step Advance simulation (--ms, optional --text)
stimulate Stim a group: gf, dnp09, mdn, lc4, lplc2, dng11, escw, dna01, dna02, …
signals Emit coding drives JSON (--ms to step first)
reset Clear persisted LIF state
remember query | strengthen | weaken | add-node | add-edge
install Copy skills + print MCP snippet (--targets)
mcp Run MCP stdio server

remember examples

flywire-cortex remember query --text "auth middleware"
flywire-cortex remember strengthen --pre concept:tests --post role:dnp09 --why "ci green"
flywire-cortex remember weaken --pre concept:migration --post role:dnp09 --why "broke prod"
flywire-cortex remember add-node --pre concept:oauth --label "OAuth flow"
flywire-cortex remember add-edge --pre concept:oauth --post role:lc4 --why "auth is high risk"

Roles → coding drives

FlyWire-style role names are coding lenses. Rates come from the live sim; the bridge picks a winner-take-most primary.

Role Drive Agent should
lc4 / lplc2 Risk / loom Scan blast radius, security, regressions
gf Escape / stop Do not ship; halt feature work; unblocker
dnp09 Forward Implement the requested change
mdn Reverse Revert / undo a bad direction
dna01 / dna02 Steer Write L vs R tradeoff, then choose
dng11 Groom Cleanup, rename, lint-only
escw Effort under pressure Polish without scope creep
ascending Proprioception Read local conventions before inventing
sensory External constraint Honor ticket / failing test / user text

Example signals payload:

{
  "primary": "dnp09",
  "escape": false,
  "stop": false,
  "reverse": false,
  "walk_drive": 0.42,
  "nervous": 0.12,
  "support": ["lc4"],
  "rationale": "primary=dnp09 walk=0.42 nervous=0.12 mdn=0.0 gf=False"
}

Thinking practices

Applied on top of rates (see skill/practices.md):

  1. Winner-take-most — one primary drive per turn
  2. Inhibition delay — high risk → list blast radius before edits
  3. Recurrent working set — ≤5 active files/APIs
  4. Hebbian writeback — strengthen only after verify; weaken on failure
  5. Sparse coding — smallest change that satisfies the drive
  6. Bilateral steer — design forks get an explicit L/R paragraph
  7. Proprioception first — read neighbors before new patterns
  8. Refractory — after gf / mdn, no new feature drive that turn
  9. Population scores — prefer CLI sense scores over vibes
  10. Consolidate — end of session: 3 new + 1 weakened memory edges

Architecture

flywire-coding-cortex/
  pyproject.toml
  README.md                 ← you are here
  INSTALL.md
  LICENSE                   ← MIT (code)
  data/
    circuit.seed.json       ← curated FlyWire subgraph (CC BY-NC)
    manifest.json           ← profile URLs / sizes
    DATA_LICENSE.md
  memory/
    seed-graph.json         ← starter coding-memory ontology
  skill/
    SKILL.md                ← Cursor / OpenClaw / Claude skill
    roles.md
    practices.md
  src/flywire_coding_cortex/
    cli.py                  ← entrypoint
    lif.py                  ← LIF on CSR adjacency
    sense.py                ← task → currents
    bridge.py               ← rates → CodingSignals
    memory.py               ← Hebbian graph
    paths.py                ← FLYWIRE_CORTEX_HOME helpers
    mcp_server.py
    install_skills.py
    assets/                 ← copies shipped in the wheel
    etl/
      download.py           ← fetch profiles
      build_circuit.py      ← Codex / Feather → circuit.json

Runtime home (FLYWIRE_CORTEX_HOME)

Default: ~/.flywire-coding-cortex/

Path Contents
config.json Active profile name
profiles/<name>/circuit.json Active wiring
profiles/<name>/raw/ Downloaded dumps (gitignored)
state/lif_state.json Persisted voltages / rates / stims
memory/graph.json Coding synapses (not FlyWire edges)
mcp.snippet.json MCP config helper

Override:

# bash
export FLYWIRE_CORTEX_HOME=/path/to/cortex-home

# PowerShell
$env:FLYWIRE_CORTEX_HOME = "D:\cortex-home"

What is real vs modeled

Real (measured / extracted) Modeled
Neuron IDs, sides, types, roles in the subgraph LIF τ, threshold, noise, weight scale
Signed synapse counts from Codex NT types Task text → current injection
Graph adjacency used for spike propagation Rate → coding-drive clamps
Hebbian coding-memory edges

Environment & dependencies

  • Python ≥ 3.10 (3.10+ recommended; annotations use modern syntax)
  • Required: numpy
  • Optional [full]: pandas, pyarrow (Zenodo Feather profile)
pip install -e ".[full]"

Limitations (v1)

  • Does not simulate the full ~139k-neuron brain every turn
  • Does not call live Codex apps (sign-in wall); uses static public files
  • Does not depend on DesktopFly or any overlay app
  • full downloads are large; confirm disk and network before --yes
  • MCP server is a minimal JSON-RPC subset (initialize, tools/list, tools/call)

Troubleshooting

Symptom Fix
flywire-cortex not found pip install -e . or set PYTHONPATH=…/src and run python -m flywire_coding_cortex.cli
circuit.seed.json missing Run fetch --profile codex once to rebuild, or ensure data/circuit.seed.json exists in the repo
Rates always zero across commands Call sense/stimulate then step; state persists—use reset between unrelated tasks
full refuses to run Pass --yes; install [full] extras
Skill not picked up Re-run flywire-cortex install; start a new agent session
SSL errors on pip install Fix certs / use a venv; interim: PYTHONPATH + python -m …

Citation & attribution

Please cite FlyWire when using or redistributing circuit extracts:

Project sites: flywire.ai · codex.flywire.ai

Code in this repository is MIT. Derived JSON and downloaded dumps remain under FlyWire’s CC BY-NC 4.0 terms — see data/DATA_LICENSE.md.


Contributing / publishing

git clone <this-repo>
cd flywire-coding-cortex
pip install -e ".[full]"
flywire-cortex fetch --profile seed
flywire-cortex install

To rebuild the shipped seed from Codex dumps:

flywire-cortex fetch --profile codex --force
# copies rebuilt circuit into data/circuit.seed.json and package assets

When ready for GitHub/PyPI: tag a release, ensure circuit.seed.json is committed, and document the CC BY-NC split in the release notes.

Release files for flywire-coding-cortex 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flywire-coding-cortex 0.1.0
File Size Uploaded
flywire_coding_cortex-0.1.0.tar.gz 128.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flywire-coding-cortex 0.1.0
File Interpreter ABI Platform
flywire_coding_cortex-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 257.8 kB

Release files / flywire_coding_cortex-0.1.0.tar.gz

Download URL flywire_coding_cortex-0.1.0.tar.gz
Size 128.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6591a4af8cd66bce4996b6edaf75eb288864a0af9d34a1d7f8bdacf9da4b2f46
BLAKE2b-256 checksum
How to use checksums
64f1b6b95a2d113d52c1934cf4974494d707acba4d07b938ce8016e648443340
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / flywire_coding_cortex-0.1.0-py3-none-any.whl

Download URL flywire_coding_cortex-0.1.0-py3-none-any.whl
Size 129.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a3161c7eb90b8463eb6e948b4e527489ee90869dcd78f452449fb491344149b
BLAKE2b-256 checksum
How to use checksums
0e35a9603aec954a3bfc85351f360240085f43279d829aa13d2e1c1490e62343
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page