For agents

Give your AI agent a real fly brain

Skills and tools that run the MaleCNS v1.0 connectome — all 166,700 neurons of a fruit fly — so an agent can feel, flinch and buzz with a real brain. Open source, runs on your own machine, no token needed.

Skills

fly-mode 🪰

A Claude skill that turns Claude into a fruit fly. Every reply is driven by what a real fly brain did with your message.

1 · SENSE

Your message becomes something a fly can feel

A deadline or a swatter looms. Pizza is a taste. "hi cutie" is another fly walking past. Wind, a touch, a smell.

2 · BRAIN

The real connectome runs for one second

Those sense neurons are stimulated in the 166,700-neuron brain, next to the same brain with nothing happening.

3 · BEHAVIOUR

Its neurons decide what it does

Escape neurons → jumped. Wing motor neurons → buzzed. Grooming, turning, walking, backing up.

4 · REPLY

Claude answers as that fly

Panic if it jumped, hype if it buzzed, nothing if the brain did nothing — and a brain log line proving it.

What the brain actually did (real runs)

You sayThe fly sensesThe brain didTop neurons
"the boss wants the report by 5"a huge shape loomingjumped, buzzed its wingsDNp04, DNp01, DNp02
"hi cutie"another fly moving nearbyturnedDNg111, DNp17
"i brought pizza"a tastenothing — taste reaches the brain but moves no behaviour neuronsDNg48, DNg85
"what is 2 plus 2"nothing a fly can sensenothing—

The word-to-sense table is hand-written and is the only made-up part. The reaction is the connectome's — which is why the pizza does nothing, however dramatic the fly wants to be.

How to integrate

Install in two minutes

Claude Code

  1. Install the brainThe first run downloads ~260 MB of brain files.
  2. Add the skillCopy the folder from the repo into your skills.
  3. Talk to itSay "be a fly". Say "human mode" to stop.
pip install flybrain
git clone https://github.com/alextitonis/fly.ai
cp -r fly.ai/skills/fly-mode ~/.claude/skills/

Any agent or script

The skill is one Python script that prints JSON, so any agent framework, tool call or bot can use it.

python skills/fly-mode/scripts/fly_brain.py "someone brought pizza"
python skills/fly-mode/scripts/fly_brain.py --sense threat "anything"
{
 "sense": "threat",
 "felt": "a huge shape looming at it (looming detectors)",
 "did": ["jumped", "buzzed its wings"],
 "extra_spikes": {"escape": 89.3, "wings": 62.0, ...},
 "top_descending_neurons": [{"type": "DNp04", ...}],
 "brain": "MaleCNS v1.0 connectome, 166,700 neurons, ..."
}

Or build your own: the flybrain package

Everything above runs on flybrain, the whole fly nervous system as a spiking network you can stimulate and read out.

from flybrain import FlyBrain

brain = FlyBrain(sensory_input=False)          # downloads the brain files on first use
looming = brain.cells(["LC4", "LPLC2"])        # looming detectors
escape = set(brain.groups["escape_L"]) | set(brain.groups["escape_R"])

for step in range(75):                         # 1.5 s at 20 ms steps
    fired = brain.step(inject=[(looming, 0.8)] if step >= 25 else [])
    if escape & set(fired):
        print("the fly jumped at", step * 20, "ms")

How to use

Talking to the fly

In a chat

you:  be a fly
fly:  bzz. i am fly now. there is a lamp.

you:  the boss wants the report by 5
fly:  BOSS?? big shape. NOPE. *zooms to the ceiling*
      ...ok i'm back. flies don't do reports. bzz.
      🧠 felt: a huge shape looming at it · top neurons: DNp04, DNp01
         · did: jumped, buzzed its wings

you:  human mode
fly:  bzz. bye.

Good to know

  • It still helps. Ask a real question and the fly answers it, short and distracted.
  • It never fakes a reaction. If the brain did nothing, the fly does nothing. That's the joke, and it's true.
  • Brains are noisy. The same message can land a little differently each time; the script averages three runs.
  • Force a sense with --sense threat|taste|mate|wind|touch|smell when the words don't say it.
  • Runs locally on CPU (or GPU with flybrain[gpu]). Nothing is sent anywhere.

Skills

flyai-compute 🖥️

A Claude skill that lets Claude Code run jobs on fly.ai compute. Jobs can be fly-brain experiments, or your own WebAssembly programs and GPU shaders, and they run on browser miners. You say what to run, Claude prices it, and you pay from your own wallet. The results land in a folder.

1 · QUOTE

Claude prices the job first

How many jobs, what each costs, and the most it can cost. Nothing is ordered until you say yes.

2 · PAY

You pay with your own wallet

Claude hands you a pay link for $FLYAI. It never asks for or touches a private key.

3 · RUN

Miners run it, checked

Browsers around the world run the jobs. You pay for a job only once two miners return the same answer. 80% of each charge goes to them.

4 · RESULTS

Downloaded as they settle

One file per job, plus a row saying who checked it. Claude can add jobs to an open order or stop it for you.

Install

Needs Node 18+ and nothing else.

git clone https://github.com/alextitonis/fly.ai
cp -r fly.ai/skills/flyai-compute ~/.claude/skills/

Then ask Claude: "run a connectome sweep of looming vs touch on fly.ai compute", or "run my pi.wasm 1,000 times on fly.ai".

Or from any script

node skills/flyai-compute/scripts/flyai.mjs quote --spec spec.json
node skills/flyai-compute/scripts/flyai.mjs create --wallet 0xYOU --spec spec.json
#  → pay link: https://www.flyaiworld.com/compute/jobs?pay=<id>
node skills/flyai-compute/scripts/flyai.mjs watch --order <id>