braina AGENTS.md

Project-specific instructions for Braina, a neuroscience project that studies how signals such as EEG, fMRI, and MEG relate to one another.

In plain words
What is it for?
They are for work on Braina's Python analysis examples, MCP server, tutorials, and information-theory methods such as entropy, mutual information, and Granger causality.
Why use it?
They help an agent explain specialist ideas in simple terms and check proposed code against the project's stated tools and research sources.

Instructions file for CodexOpenCode

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/agents-md
Clone the repo
git clone --depth 1 https://github.com/brainets/braina

Made for: Codex, OpenCode.

Per session 1,013 This file is loaded in full into every session.
When invoked 1,013 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.01013 $0.01013
Opus 5 $0.00507 $0.00507
Sonnet 5 $0.00203 $0.00203
Haiku 4.5 $0.00101 $0.00101

Measured yesterday against content hash 3cb702c9bbb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

braina AGENTS.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 yesterday.

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.

AGENTS.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 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. Project Structure

  • /mcp: MCP server (braina_mcp.py) exposing 30+ tools for Frites/HOI analysis. Registered as an MCP server for Codex.
  • /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 (BrainHack 2026, Granger causality, master's thesis).

3. Core Libraries

  • Frites (v0.4.0+): Single-trial functional connectivity and information-theoretical analysis.
    • Key modules: frites.conn (covgc, dfc, pid, ii, te, fit, ccf, spec), frites.simulations (StimSpecAR), frites.workflow (WfMi, WfStats, WfConnComod).
    • GitHub: brainets/frites
  • HOI (v0.2.0+): Higher-Order Interactions analysis.
    • Key metrics: Oinfo, GradientOinfo, InfoTopo, RedundancyMMI, SynergyMMI, RSI, DTC.
    • GitHub: brainets/hoi
  • XGI (v0.7.0+): Hypergraph and higher-order network analysis.
    • GitHub: xgi-org/xgi

4. Source of Truth & Expertise

  • Examples first: Always consult /examples for usage patterns before writing new code.
  • MCP tools as reference: Read mcp/braina_mcp.py for canonical function signatures and parameter conventions.
  • Source code on GitHub: For implementation details, read brainets/frites and brainets/hoi source code.
  • Papers: Read PDFs in /papers for theoretical background when needed.

Read the full file on GitHub · 62 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. yesterday First seen · 62 lines · 1,013 tokens per session scan A 3cb702c9bbb4

Subscribe to this mod's changes

braina AGENTS.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,013 tokens to every session, about $0.0051 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.

Related

Other instructions, from other repositories