braina GEMINI.md

Project instructions for braina, a Python project that analyzes interactions in brain-recording data such as EEG, fMRI, and MEG. They explain its scientific purpose, commands, examples, and how to verify its analysis libraries.

In plain words
What is it for?
Use them to check the development environment, run verification tests, start the tool server, and run example analyses of neural data.
Why use it?
They help an agent work safely in a specialized research codebase where terms such as entropy and mutual information may be unfamiliar.

Instructions file for Gemini CLI

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/brainets/braina/gemini-md
Clone the repo
git clone --depth 1 https://github.com/brainets/braina

Made for: Gemini CLI.

Per session 1,269 This file is loaded in full into every session.
When invoked 1,269 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01269 $0.01269
Opus 5 $0.00634 $0.00634
Sonnet 5 $0.00254 $0.00254
Haiku 4.5 $0.00127 $0.00127

Measured 2d ago against content hash b0f40feee4ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

braina GEMINI.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

GEMINI.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Project: braina (Brain Interaction Analysis)

1. Project Context & Purpose

  • Goal: Analyzing complex neural interactions using Frites, HOI, and XGI toolboxes.
  • Focus: Information Theoretical Analysis of electrophysiological data (fMRI, MEG, EEG, LFP, MUA).
  • Organization: Institut de Neurosciences de la Timone (BraiNets), Marseille, France.
  • Novice Mode: The user may be a novice in this domain. Explain mathematical concepts (entropy, mutual information, O-information, Granger causality) simply and verify all proposed code before recommending it.

2. Commands

# Verify environment (all core dependencies)
uv run check_env.py

# Run the verification test suite for Frites + HOI
uv run mcp/verify_libs.py

# Launch the MCP server standalone
uv run mcp/braina_mcp.py

# Run any example script (all use uv inline dependencies)
uv run examples/frites/conn/ex_conn_covgc.py
uv run examples/hoi/metrics/ex_oinfo.py

All scripts use uv with PEP 723 inline script metadata (# /// script blocks) for dependency management.

3. Project Structure

  • /mcp: MCP server (braina_mcp.py) exposing 30+ tools for Frites/HOI analysis.
  • /examples: ~50 Python example scripts organized by library:
    • examples/frites/ — AR models, connectivity, mutual information, statistics, simulations.
    • examples/hoi/ — Information theory, HOI metrics, tutorials, statistics.
  • /papers: Research papers forming the theoretical foundation.
  • /tutorials: Hands-on learning materials:
    • multivariate_information_theory_frites_hoi_xgi/ — Integrating frites, hoi, and xgi.
    • seeg_ebrains_frites/ — SEEG data analysis with frites.
  • /usecases: Real-world analysis scenarios.

4. MCP Server Tools (mcp/braina_mcp.py)

Tool categories:

  • Data I/O: inspect_data, read_pdf, load_data, save_data
  • Frites connectivity: frites_conn_covgc, frites_conn_dfc, frites_conn_pid, frites_conn_ii, frites_conn_te, frites_conn_fit, frites_conn_spec, frites_conn_ccf
  • Frites workflows: frites_wf_stats (WfStats), frites_wf_mi (WfMi), frites_wf_conn_comod (WfConnComod)
  • Frites simulation: frites_sim_ar (StimSpecAR)
  • HOI metrics: hoi_oinfo, hoi_gradient_oinfo, hoi_infotopo, hoi_redundancy_mmi, hoi_synergy_mmi, hoi_rsi, hoi_dtc, hoi_get_nbest_mult

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 80 lines · 1,269 tokens per session scan A b0f40feee4ce

Subscribe to this mod's changes

braina GEMINI.md is an instructions file published in the GitHub repository brainets/braina (5 stars, last pushed 3mo ago), licensed BSD-3-Clause. It adds 1,269 tokens to every session, about $0.0063 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.