NeuroLoop™ CLI for NodeJS
24
stars
38
commits
TypeScript
primary language
Jul 19, 2026
updated
NeuroLoop is a BCI-aware AI coding and life companion powered by real-time consumer EXG devices. It reads brainwaves and physiology continuously and uses that live biometric data to inform every response — adapting its tone, offering guided protocols, and labelling meaningful mental states as they happen.
NeuroLoop™ runs on top of the pi coding agent framework and communicates with the NeuroSkill™ State of Mind BCI server, which exposes a local WebSocket API for real-time neural data.
| Device | Channels | Sample Rate | Transport | Notes |
|---|---|---|---|---|
| Muse (2016 / 2 / S / S Athena) | 4 (TP9, AF7, AF8, TP10) | 256 Hz | BLE | Includes PPG + IMU streams |
| OpenBCI Ganglion | 4 | 200 Hz | BLE | Native adapter |
| Neurable MW75 Neuro | 12 | 500 Hz | BLE + RFCOMM | Behind mw75-rfcomm feature flag |
| Hermes V1 | 8 (Fp1, Fp2, AF3, AF4, F3, F4, FC1, FC2) | 250 Hz | BLE GATT | ADS1299 + 9-DOF IMU |
Via NeuroSkill's built-in LSL adapter, NeuroLoop can ingest streams from Lab Streaming Layer publishers (e.g. OpenBCI/BrainFlow pipelines, MATLAB, Python pylsl, custom broadcasters).
NeuroSkill also supports remote LSL over encrypted iroh QUIC tunnels (rlsl-iroh), so a remote EEG source can stream into your local Skill app and become available to NeuroLoop automatically.
.ics sources on Linux/Windows)
~/.neuroskill/memory.md) across sessionsneuroskill compare runs proactively in the background so results are ready when neededweb_fetch and web_search available to the agent/key (no file editing required); keys are stored securely in ~/.neuroloop/auth.jsongpt-oss:20b as the default local model)~/.neuroloop/models.json interactively (/model-config add) or open it in your system editor (/model-config open)/updates, and live version route/status commands (/version, /llm route)npx neuroloop
Requires Node.js ≥ 20 (enforced at startup). The NeuroSkill™ EXG server must be running and a supported EXG device connected for live biometric features (see Supported Devices above).
On every user message the harness:
neuroskill status via WebSocket and injects the live EXG snapshot into a visible chat bubble and the LLM system promptskills/neuroskill-protocols/SKILL.md) on demandNEUROLOOP.md) and any persistent agent memory so the LLM always has full contextThe LLM receives the live EXG data, behavioural guidance, and domain-specific history. The user sees only the EXG snapshot bubble.
NeuroLoop extends the pi TUI with:
◆ NeuroLoop™ vX.Y.Z), connection status, device info, skills sync status, and command hintsfocus, cog.load, relax, engage, drowsy, mood, ♥ bpm) and EEG band bars (δ θ α β γ) updated via WebSocket; the most recent EXG label and its timestamp are shown right-aligned◉ / ◌), "last updated" age, context usage, and current model/theme and persistence to ~/.neuroloop/theme.json/llm) showing server status, model catalog with download progress, and one-click actions (start/stop server, select/download/pause/resume models)| Command | Description |
|---|---|
/exg | Show a full EXG snapshot in the chat |
/exg on | Re-enable the live EXG panel and reconnect WebSocket |
/exg off | Disable the live EXG panel and disconnect WebSocket |
/exg <seconds> | Change the status poll interval (e.g. /exg 0.5) |
/exg port <n> | Connect to the NeuroSkill™ server on a different port |
/exg-session [index] | Current or Nth session metrics (0 = latest) |
/sessions | List all recorded EXG sessions |
/sleep [index] | Sleep staging summary |
/compare | Compare last two sessions (~60 s, uses cache) |
/label <text> | Create a timestamped EXG annotation (supports --context) |
/labels <query> | Semantic search over EXG annotations (supports --k) |
/calibrate | Start EXG calibration sequence |
/neuro <cmd> [args…] | Run any neuroskill subcommand directly (output shown in chat) |
/connect | Connect to NeuroSkill™ server |
| Command | Description |
|---|---|
/llm | Open the interactive LLM manager popup (server status, model catalog, actions) |
/llm models | Show model catalog in chat (downloaded, downloading, available) |
/llm status | Show LLM server status (running/stopped, model, context, vision) |
/llm route | Show active inference route and fallback chain |
/llm connect [remote|local|auto] | Start/connect Skill LLM with local fallback |
/llm start | Start the Skill LLM inference server |
/llm stop | Stop the Skill LLM inference server |
/llm list | Show model catalog with active marker, quant, size, state |
/llm add <repo> <file> | Add external HuggingFace model (supports --mmproj) |
/llm remove <file> | Delete a locally-cached model |
/llm select <file> | Set the active text model |
/llm download <file> | Start downloading a model (progress shown in footer) |
/llm pause [file] | Pause an active download |
/llm resume [file] | Resume a paused download |
/llm cancel [file] | Cancel an active download |
/llm fit | Check which models fit in available RAM/VRAM |
| Command | Description |
|---|---|
/key | Interactive: choose a provider, paste your API key → saved to ~/.neuroloop/auth.json |
/key list | Show all supported providers and which ones are currently configured |
/key remove | Interactive: pick a stored key to delete |
/key remove <id> | Directly remove a specific provider key (e.g. /key remove google) |
/model-config [add|open|path|show] | Manage ~/.neuroloop/models.json from TUI or open in system editor |
| Command | Description |
|---|---|
/health [sub] | HealthKit data — sleep, workouts, hr, steps, summary, metrics, location |
/hooks [sub] | Proactive hook rules — list, add, remove, enable, disable, update, suggest, log |
/dnd [on|off] | Do Not Disturb status / toggle |
| Command | Description |
|---|---|
/theme | Interactive theme picker (7 built-in themes) |
/theme <name> | Switch directly (e.g. /theme dracula, /theme matrix, /theme calm) |
/toasts | Toggle smart brain state notifications on/off |
/toasts on | Enable smart brain state toasts |
/toasts off | Disable smart brain state toasts |
/config | Show current NeuroLoop settings |
/config compression <mode> | Set response compression (standard, strong, off) |
/config device <gpu|cpu> | Set inference device |
| Command | Description |
|---|---|
/say <text> | Speak text aloud via on-device TTS (supports --voice, --http) |
/notify <title> [body] | Send an OS notification |
/screenshots [query] | Search screenshots (OCR / CLIP) or get EEG-session screenshots |
/timer | Start focus timer |
/umap | 3D UMAP projection of EXG data |
/listen [--seconds n] | Stream live EXG broadcast events |
/skills-update | Force-refresh skills submodule from GitHub |
/version [refresh] | Show local/npm/GitHub version status |
/updates [all|reset] | Show unseen changelog updates, full changelog, or reset seen state |
| Tool | Description |
|---|---|
neuroskill_run | Run any neuroskill subcommand (status, session, sessions, sleep, search-labels, interactive, label, search, compare, umap, listen, notify, calibrate, raw, …) |
neuroskill_label | Create a timestamped EXG annotation for a notable mental/emotional/somatic moment |
run_protocol | Execute a multi-step guided protocol with OS notifications, step timing, and per-step EXG labelling |
prewarm | Kick off a background neuroskill compare run so the result is ready when needed |
memory_read | Read the agent's persistent memory file (~/.neuroskill/memory.md) |
memory_write | Write or append to the persistent memory file |
web_fetch | Fetch the content of a URL |
web_search | Search the web |
The following skill files are loaded from skills/ and made available to the LLM for contextual injection:
| Skill | Description |
|---|---|
neuroskill-status | status command — full device/session/scores snapshot |
neuroskill-sessions | session and sessions commands — per-session metrics and session history |
neuroskill-sleep | sleep and umap commands — sleep staging and UMAP visualisation |
neuroskill-labels | label, search-labels, interactive commands — EXG annotations and semantic search |
neuroskill-search | search and compare commands — ANN similarity search and session comparison |
neuroskill-streaming | listen, notify, calibrate, timer, raw — real-time events and notifications |
neuroskill-transport | WebSocket and HTTP transport, port discovery, output modes, global flags |
neuroskill-protocols | 100+ guided protocols organised by EXG signal — loaded on-demand |
neuroskill-data-reference | All metric fields, value ranges, and their meaning |
neuroskill-recipes | Shell and scripting recipes for automation and pipelines |
neuroskill-metrics | Full scientific reference for all EXG indices (METRICS.md) |
NeuroLoop exposes 40+ neuroscientific metrics derived from the Muse headset, including:
⚠️ Research Use Only. All metrics are experimental outputs from consumer-grade EXG hardware. They are not validated clinical measurements, not FDA/CE-cleared, and must not be used for diagnosis or treatment.
See METRICS.md for the full scientific reference for every metric.
neuroloop/
├── src/
│ ├── main.ts # Entry point — session setup, skill loading, model registry
│ ├── neuroloop.ts # ExtensionFactory — tools, hooks, renderers, TUI, WebSocket
│ ├── compression.ts # Response compression (standard/strong/off)
│ ├── memory.ts # Persistent memory helpers (~/.neuroskill/memory.md)
│ ├── model-config.ts # models.json helpers + system-open integration
│ ├── runtime-updates.ts # npm/GitHub version checks + runtime installs
│ ├── skill-llm.ts # Skill app LLM boot/connect/register helpers
│ ├── skills-sync.ts # skills submodule sync helpers
│ ├── tui/
│ │ ├── index.ts # Barrel export for all TUI modules
│ │ ├── themes.ts # 7 switchable color themes with persistence
│ │ ├── toast.ts # Smart brain state alert rules with cooldowns
│ │ ├── command-palette.ts # Fuzzy-searchable command overlay (SelectList)
│ │ ├── render-scheduler.ts # 16ms debounced render batching (replaces 30s timer)
│ │ ├── overlay-panel.ts # EXG sidebar with sparklines, bands, trends
│ │ ├── overlay-manager.ts # Stacking, modal exclusivity, Esc dismissal
│ │ ├── llm-panel.ts # Bordered LLM manager popup with progress bars
│ │ └── logo.ts # ASCII art NeuroLoop™ logo (full/compact/mini)
│ ├── neuroskill/
│ │ ├── index.ts # Public barrel
│ │ ├── run.ts # runNeuroSkill() — CLI executor + cross-platform port discovery
│ │ ├── signals.ts # detectSignals() — prompt domain detection
│ │ └── context.ts # selectContextualData() — parallel data fetching + compare cache
│ └── tools/
│ ├── web-fetch.ts # web_fetch tool
│ ├── web-search.ts # web_search tool
│ └── protocol.ts # run_protocol tool — step-by-step guided protocols
├── skills/ # Domain skill files (one subdirectory per skill)
├── NEUROLOOP.md # Capability index injected every turn
├── METRICS.md # Full neuroscientific reference for all EXG metrics
└── dist/ # Compiled output (neuroloop.js)
Agent data is stored under ~/.neuroloop/ (sessions, auth, settings, models, port config).
auth.json, memory.md, port config, and calibration state are written with 0o600 (owner-only); directories with 0o700web_fetch blocks requests to private/loopback/RFC-1918/link-local networks and file:// URLscmd.exe (shell: true); on Unix, execFile is used without a shellweb_fetch has a hard 30s timeout via AbortSignal.any() in addition to the caller's cancellation signalAbortSignal.any(), AbortSignal.timeout(), global fetch)lsof fallback validates pgrep output is numeric before interpolating into shell commands/health JSON response structure, not just HTTP 200npm audit)The quickest way to add an API key is the built-in /key command:
/key # interactive provider picker → paste key → done
/key list # see what is configured
/key remove # interactive removal
/key remove google # remove a specific provider directly
Keys are stored in ~/.neuroloop/auth.json. Supported providers:
| Provider | ID | Environment variable |
|---|---|---|
| Google Gemini | google | GEMINI_API_KEY |
| Anthropic (Claude) | anthropic | ANTHROPIC_API_KEY |
| OpenAI (GPT) | openai | OPENAI_API_KEY |
| Mistral AI | mistral | MISTRAL_API_KEY |
| Groq | groq | GROQ_API_KEY |
| xAI (Grok) | xai | XAI_API_KEY |
| OpenRouter | openrouter | OPENROUTER_API_KEY |
| Cerebras | cerebras | CEREBRAS_API_KEY |
You can also set keys via environment variables or by editing ~/.neuroloop/auth.json directly:
{
"google": { "type": "api_key", "key": "AIza..." },
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
"openai": { "type": "api_key", "key": "sk-..." }
}
After adding a key, switch to a model from that provider with /model (Ctrl+L).
NeuroLoop supports all pi-compatible providers (Anthropic, OpenAI, Gemini) as well as any locally running Ollama models. gpt-oss:20b is always registered as the default Ollama model even when Ollama is unreachable.
Model selection order:
~/.neuroloop/settings.json/v1/chat/completions)gpt-oss:20b when none are listed first)When the Skill app has a running LLM, it is registered as the skill-llm provider and connected to directly via the OpenAI-compatible HTTP API — no CLI overhead for inference. If the Skill app's LLM server has an API key configured, set the SKILL_LLM_API_KEY environment variable.
NeuroSkill's EXG embedding/search stack is powered by ZUNA (Zyphra/ZUNA), which converts 5-second EXG epochs into dense vectors used for similarity search, session compare, cross-modal joins, and sleep-stage pipelines.
Current catalog families include:
Many families include mmproj projector files for image input in the Skill app LLM server.
../skill)NeuroLoop tracks the NeuroSkill backend capabilities and exposes them through /neuro, neuroskill_run, and convenience commands where available. This includes:
The agent auto-discovers the NeuroSkill™ server port using a cross-platform strategy:
~/.neuroloop/neuroskill_port.jsonlsof process scan (macOS/Linux)You can override the port at runtime with /exg port <n> — the chosen port is persisted for future sessions. The port is also passed to the neuroskill CLI via --port to skip mDNS discovery.
If you use NeuroLoop™ in academic work, please cite it as:
@software{neuroloop2026,
author = {Nataliya Kosmyna and Eugene Hauptmann},
title = {{NeuroLoop™: An EXG-Aware AI Companion Powered by Real-Time Brainwave Analysis}},
year = {2026},
version = {0.0.9},
url = {https://github.com/NeuroSkill-com/neuroloop}
}
NeuroLoop™ builds on the following neuroscientific foundations. If you use specific metrics, please also cite the primary literature listed in METRICS.md. Key upstream works include:
@article{krigolson2017choosing,
author = {Krigolson, Olav E. and Williams, Chad C. and Norton, Angela and Hassall, Cameron D. and Colino, Francisco L.},
title = {Choosing {MUSE}: Validation of a Low-Cost, Portable {EEG} System for {ERP} Research},
journal = {Frontiers in Neuroscience},
volume = {11},
pages = {109},
year = {2017},
doi = {10.3389/fnins.2017.00109}
}
@inproceedings{cannard2021validating,
author = {Cannard, Christian and Wahbeh, Helané and Delorme, Arnaud},
title = {Validating the Wearable {MUSE} Headset for {EEG} Spectral Analysis and Frontal Alpha Asymmetry},
booktitle = {2021 IEEE International Conference on Bioinformatics and Biomedicine (BIBM)},
year = {2021},
doi = {10.1109/bibm52615.2021.9669778}
}
@article{coan2004frontal,
author = {Coan, James A. and Allen, John J. B.},
title = {Frontal {EEG} Asymmetry as a Moderator and Mediator of Emotion},
journal = {Biological Psychology},
volume = {67},
number = {1--2},
pages = {7--50},
year = {2004},
doi = {10.1016/j.biopsycho.2004.03.002}
}
@article{casali2013theoretically,
author = {Casali, Adenauer G. and Gosseries, Olivia and Rosanova, Mario and Boly, Melanie and Sarasso, Simone and Casali, Karina R. and Casarotto, Silvia and Bruno, Marie-Aurélie and Laureys, Steven and Tononi, Giulio and Massimini, Marcello},
title = {A Theoretically Based Index of Consciousness Independent of Sensory Processing and Behavior},
journal = {Science Translational Medicine},
volume = {5},
number = {198},
pages = {198ra105},
year = {2013},
doi = {10.1126/scitranslmed.3006294}
}
@article{klimesch1999eeg,
author = {Klimesch, Wolfgang},
title = {{EEG} Alpha and Theta Oscillations Reflect Cognitive and Memory Performance: A Review and Analysis},
journal = {Brain Research Reviews},
volume = {29},
number = {2--3},
pages = {169--195},
year = {1999},
doi = {10.1016/s0165-0173(98)00056-3}
}
@article{donoghue2020parameterizing,
author = {Donoghue, Thomas and Haller, Matar and Peterson, Erik J. and Varma, Paroma and Sebastian, Priyadarshini and Gao, Richard and Noto, Torben and Lara, Antonio H. and Wallis, Jonathan D. and Knight, Robert T. and Bhatt, Parveen and Voytek, Bradley},
title = {Parameterizing Neural Power Spectra into Periodic and Aperiodic Components},
journal = {Nature Neuroscience},
volume = {23},
pages = {1655--1665},
year = {2020},
doi = {10.1038/s41593-020-00744-x}
}
@article{pope1995biocybernetic,
author = {Pope, Alan T. and Bogart, Edward H. and Bartolome, Debbie S.},
title = {Biocybernetic System Evaluates Indices of Operator Engagement in Automated Task},
journal = {Biological Psychology},
volume = {40},
number = {1--2},
pages = {187--195},
year = {1995},
doi = {10.1016/0301-0511(95)05116-3}
}
@article{bandt2002permutation,
author = {Bandt, Christoph and Pompe, Bernd},
title = {Permutation Entropy: A Natural Complexity Measure for Time Series},
journal = {Physical Review Letters},
volume = {88},
number = {17},
pages = {174102},
year = {2002},
doi = {10.1103/PhysRevLett.88.174102}
}
@article{tononi2004information,
author = {Tononi, Giulio},
title = {An Information Integration Theory of Consciousness},
journal = {BMC Neuroscience},
volume = {5},
pages = {42},
year = {2004},
doi = {10.1186/1471-2202-5-42}
}
GPLv3
37 commits
1 commits
TypeScript
99.3%
NeuroLoop™ CLI for NodeJS
24
stars
38
commits
TypeScript
primary language
Jul 19, 2026
updated
NeuroLoop is a BCI-aware AI coding and life companion powered by real-time consumer EXG devices. It reads brainwaves and physiology continuously and uses that live biometric data to inform every response — adapting its tone, offering guided protocols, and labelling meaningful mental states as they happen.
NeuroLoop™ runs on top of the pi coding agent framework and communicates with the NeuroSkill™ State of Mind BCI server, which exposes a local WebSocket API for real-time neural data.
| Device | Channels | Sample Rate | Transport | Notes |
|---|---|---|---|---|
| Muse (2016 / 2 / S / S Athena) | 4 (TP9, AF7, AF8, TP10) | 256 Hz | BLE | Includes PPG + IMU streams |
| OpenBCI Ganglion | 4 | 200 Hz | BLE | Native adapter |
| Neurable MW75 Neuro | 12 | 500 Hz | BLE + RFCOMM | Behind mw75-rfcomm feature flag |
| Hermes V1 | 8 (Fp1, Fp2, AF3, AF4, F3, F4, FC1, FC2) | 250 Hz | BLE GATT | ADS1299 + 9-DOF IMU |
Via NeuroSkill's built-in LSL adapter, NeuroLoop can ingest streams from Lab Streaming Layer publishers (e.g. OpenBCI/BrainFlow pipelines, MATLAB, Python pylsl, custom broadcasters).
NeuroSkill also supports remote LSL over encrypted iroh QUIC tunnels (rlsl-iroh), so a remote EEG source can stream into your local Skill app and become available to NeuroLoop automatically.
.ics sources on Linux/Windows)
~/.neuroskill/memory.md) across sessionsneuroskill compare runs proactively in the background so results are ready when neededweb_fetch and web_search available to the agent/key (no file editing required); keys are stored securely in ~/.neuroloop/auth.jsongpt-oss:20b as the default local model)~/.neuroloop/models.json interactively (/model-config add) or open it in your system editor (/model-config open)/updates, and live version route/status commands (/version, /llm route)npx neuroloop
Requires Node.js ≥ 20 (enforced at startup). The NeuroSkill™ EXG server must be running and a supported EXG device connected for live biometric features (see Supported Devices above).
On every user message the harness:
neuroskill status via WebSocket and injects the live EXG snapshot into a visible chat bubble and the LLM system promptskills/neuroskill-protocols/SKILL.md) on demandNEUROLOOP.md) and any persistent agent memory so the LLM always has full contextThe LLM receives the live EXG data, behavioural guidance, and domain-specific history. The user sees only the EXG snapshot bubble.
NeuroLoop extends the pi TUI with:
◆ NeuroLoop™ vX.Y.Z), connection status, device info, skills sync status, and command hintsfocus, cog.load, relax, engage, drowsy, mood, ♥ bpm) and EEG band bars (δ θ α β γ) updated via WebSocket; the most recent EXG label and its timestamp are shown right-aligned◉ / ◌), "last updated" age, context usage, and current model/theme and persistence to ~/.neuroloop/theme.json/llm) showing server status, model catalog with download progress, and one-click actions (start/stop server, select/download/pause/resume models)| Command | Description |
|---|---|
/exg | Show a full EXG snapshot in the chat |
/exg on | Re-enable the live EXG panel and reconnect WebSocket |
/exg off | Disable the live EXG panel and disconnect WebSocket |
/exg <seconds> | Change the status poll interval (e.g. /exg 0.5) |
/exg port <n> | Connect to the NeuroSkill™ server on a different port |
/exg-session [index] | Current or Nth session metrics (0 = latest) |
/sessions | List all recorded EXG sessions |
/sleep [index] | Sleep staging summary |
/compare | Compare last two sessions (~60 s, uses cache) |
/label <text> | Create a timestamped EXG annotation (supports --context) |
/labels <query> | Semantic search over EXG annotations (supports --k) |
/calibrate | Start EXG calibration sequence |
/neuro <cmd> [args…] | Run any neuroskill subcommand directly (output shown in chat) |
/connect | Connect to NeuroSkill™ server |
| Command | Description |
|---|---|
/llm | Open the interactive LLM manager popup (server status, model catalog, actions) |
/llm models | Show model catalog in chat (downloaded, downloading, available) |
/llm status | Show LLM server status (running/stopped, model, context, vision) |
/llm route | Show active inference route and fallback chain |
/llm connect [remote|local|auto] | Start/connect Skill LLM with local fallback |
/llm start | Start the Skill LLM inference server |
/llm stop | Stop the Skill LLM inference server |
/llm list | Show model catalog with active marker, quant, size, state |
/llm add <repo> <file> | Add external HuggingFace model (supports --mmproj) |
/llm remove <file> | Delete a locally-cached model |
/llm select <file> | Set the active text model |
/llm download <file> | Start downloading a model (progress shown in footer) |
/llm pause [file] | Pause an active download |
/llm resume [file] | Resume a paused download |
/llm cancel [file] | Cancel an active download |
/llm fit | Check which models fit in available RAM/VRAM |
| Command | Description |
|---|---|
/key | Interactive: choose a provider, paste your API key → saved to ~/.neuroloop/auth.json |
/key list | Show all supported providers and which ones are currently configured |
/key remove | Interactive: pick a stored key to delete |
/key remove <id> | Directly remove a specific provider key (e.g. /key remove google) |
/model-config [add|open|path|show] | Manage ~/.neuroloop/models.json from TUI or open in system editor |
| Command | Description |
|---|---|
/health [sub] | HealthKit data — sleep, workouts, hr, steps, summary, metrics, location |
/hooks [sub] | Proactive hook rules — list, add, remove, enable, disable, update, suggest, log |
/dnd [on|off] | Do Not Disturb status / toggle |
| Command | Description |
|---|---|
/theme | Interactive theme picker (7 built-in themes) |
/theme <name> | Switch directly (e.g. /theme dracula, /theme matrix, /theme calm) |
/toasts | Toggle smart brain state notifications on/off |
/toasts on | Enable smart brain state toasts |
/toasts off | Disable smart brain state toasts |
/config | Show current NeuroLoop settings |
/config compression <mode> | Set response compression (standard, strong, off) |
/config device <gpu|cpu> | Set inference device |
| Command | Description |
|---|---|
/say <text> | Speak text aloud via on-device TTS (supports --voice, --http) |
/notify <title> [body] | Send an OS notification |
/screenshots [query] | Search screenshots (OCR / CLIP) or get EEG-session screenshots |
/timer | Start focus timer |
/umap | 3D UMAP projection of EXG data |
/listen [--seconds n] | Stream live EXG broadcast events |
/skills-update | Force-refresh skills submodule from GitHub |
/version [refresh] | Show local/npm/GitHub version status |
/updates [all|reset] | Show unseen changelog updates, full changelog, or reset seen state |
| Tool | Description |
|---|---|
neuroskill_run | Run any neuroskill subcommand (status, session, sessions, sleep, search-labels, interactive, label, search, compare, umap, listen, notify, calibrate, raw, …) |
neuroskill_label | Create a timestamped EXG annotation for a notable mental/emotional/somatic moment |
run_protocol | Execute a multi-step guided protocol with OS notifications, step timing, and per-step EXG labelling |
prewarm | Kick off a background neuroskill compare run so the result is ready when needed |
memory_read | Read the agent's persistent memory file (~/.neuroskill/memory.md) |
memory_write | Write or append to the persistent memory file |
web_fetch | Fetch the content of a URL |
web_search | Search the web |
The following skill files are loaded from skills/ and made available to the LLM for contextual injection:
| Skill | Description |
|---|---|
neuroskill-status | status command — full device/session/scores snapshot |
neuroskill-sessions | session and sessions commands — per-session metrics and session history |
neuroskill-sleep | sleep and umap commands — sleep staging and UMAP visualisation |
neuroskill-labels | label, search-labels, interactive commands — EXG annotations and semantic search |
neuroskill-search | search and compare commands — ANN similarity search and session comparison |
neuroskill-streaming | listen, notify, calibrate, timer, raw — real-time events and notifications |
neuroskill-transport | WebSocket and HTTP transport, port discovery, output modes, global flags |
neuroskill-protocols | 100+ guided protocols organised by EXG signal — loaded on-demand |
neuroskill-data-reference | All metric fields, value ranges, and their meaning |
neuroskill-recipes | Shell and scripting recipes for automation and pipelines |
neuroskill-metrics | Full scientific reference for all EXG indices (METRICS.md) |
NeuroLoop exposes 40+ neuroscientific metrics derived from the Muse headset, including:
⚠️ Research Use Only. All metrics are experimental outputs from consumer-grade EXG hardware. They are not validated clinical measurements, not FDA/CE-cleared, and must not be used for diagnosis or treatment.
See METRICS.md for the full scientific reference for every metric.
neuroloop/
├── src/
│ ├── main.ts # Entry point — session setup, skill loading, model registry
│ ├── neuroloop.ts # ExtensionFactory — tools, hooks, renderers, TUI, WebSocket
│ ├── compression.ts # Response compression (standard/strong/off)
│ ├── memory.ts # Persistent memory helpers (~/.neuroskill/memory.md)
│ ├── model-config.ts # models.json helpers + system-open integration
│ ├── runtime-updates.ts # npm/GitHub version checks + runtime installs
│ ├── skill-llm.ts # Skill app LLM boot/connect/register helpers
│ ├── skills-sync.ts # skills submodule sync helpers
│ ├── tui/
│ │ ├── index.ts # Barrel export for all TUI modules
│ │ ├── themes.ts # 7 switchable color themes with persistence
│ │ ├── toast.ts # Smart brain state alert rules with cooldowns
│ │ ├── command-palette.ts # Fuzzy-searchable command overlay (SelectList)
│ │ ├── render-scheduler.ts # 16ms debounced render batching (replaces 30s timer)
│ │ ├── overlay-panel.ts # EXG sidebar with sparklines, bands, trends
│ │ ├── overlay-manager.ts # Stacking, modal exclusivity, Esc dismissal
│ │ ├── llm-panel.ts # Bordered LLM manager popup with progress bars
│ │ └── logo.ts # ASCII art NeuroLoop™ logo (full/compact/mini)
│ ├── neuroskill/
│ │ ├── index.ts # Public barrel
│ │ ├── run.ts # runNeuroSkill() — CLI executor + cross-platform port discovery
│ │ ├── signals.ts # detectSignals() — prompt domain detection
│ │ └── context.ts # selectContextualData() — parallel data fetching + compare cache
│ └── tools/
│ ├── web-fetch.ts # web_fetch tool
│ ├── web-search.ts # web_search tool
│ └── protocol.ts # run_protocol tool — step-by-step guided protocols
├── skills/ # Domain skill files (one subdirectory per skill)
├── NEUROLOOP.md # Capability index injected every turn
├── METRICS.md # Full neuroscientific reference for all EXG metrics
└── dist/ # Compiled output (neuroloop.js)
Agent data is stored under ~/.neuroloop/ (sessions, auth, settings, models, port config).
auth.json, memory.md, port config, and calibration state are written with 0o600 (owner-only); directories with 0o700web_fetch blocks requests to private/loopback/RFC-1918/link-local networks and file:// URLscmd.exe (shell: true); on Unix, execFile is used without a shellweb_fetch has a hard 30s timeout via AbortSignal.any() in addition to the caller's cancellation signalAbortSignal.any(), AbortSignal.timeout(), global fetch)lsof fallback validates pgrep output is numeric before interpolating into shell commands/health JSON response structure, not just HTTP 200npm audit)The quickest way to add an API key is the built-in /key command:
/key # interactive provider picker → paste key → done
/key list # see what is configured
/key remove # interactive removal
/key remove google # remove a specific provider directly
Keys are stored in ~/.neuroloop/auth.json. Supported providers:
| Provider | ID | Environment variable |
|---|---|---|
| Google Gemini | google | GEMINI_API_KEY |
| Anthropic (Claude) | anthropic | ANTHROPIC_API_KEY |
| OpenAI (GPT) | openai | OPENAI_API_KEY |
| Mistral AI | mistral | MISTRAL_API_KEY |
| Groq | groq | GROQ_API_KEY |
| xAI (Grok) | xai | XAI_API_KEY |
| OpenRouter | openrouter | OPENROUTER_API_KEY |
| Cerebras | cerebras | CEREBRAS_API_KEY |
You can also set keys via environment variables or by editing ~/.neuroloop/auth.json directly:
{
"google": { "type": "api_key", "key": "AIza..." },
"anthropic": { "type": "api_key", "key": "sk-ant-..." },
"openai": { "type": "api_key", "key": "sk-..." }
}
After adding a key, switch to a model from that provider with /model (Ctrl+L).
NeuroLoop supports all pi-compatible providers (Anthropic, OpenAI, Gemini) as well as any locally running Ollama models. gpt-oss:20b is always registered as the default Ollama model even when Ollama is unreachable.
Model selection order:
~/.neuroloop/settings.json/v1/chat/completions)gpt-oss:20b when none are listed first)When the Skill app has a running LLM, it is registered as the skill-llm provider and connected to directly via the OpenAI-compatible HTTP API — no CLI overhead for inference. If the Skill app's LLM server has an API key configured, set the SKILL_LLM_API_KEY environment variable.
NeuroSkill's EXG embedding/search stack is powered by ZUNA (Zyphra/ZUNA), which converts 5-second EXG epochs into dense vectors used for similarity search, session compare, cross-modal joins, and sleep-stage pipelines.
Current catalog families include:
Many families include mmproj projector files for image input in the Skill app LLM server.
../skill)NeuroLoop tracks the NeuroSkill backend capabilities and exposes them through /neuro, neuroskill_run, and convenience commands where available. This includes:
The agent auto-discovers the NeuroSkill™ server port using a cross-platform strategy:
~/.neuroloop/neuroskill_port.jsonlsof process scan (macOS/Linux)You can override the port at runtime with /exg port <n> — the chosen port is persisted for future sessions. The port is also passed to the neuroskill CLI via --port to skip mDNS discovery.
If you use NeuroLoop™ in academic work, please cite it as:
@software{neuroloop2026,
author = {Nataliya Kosmyna and Eugene Hauptmann},
title = {{NeuroLoop™: An EXG-Aware AI Companion Powered by Real-Time Brainwave Analysis}},
year = {2026},
version = {0.0.9},
url = {https://github.com/NeuroSkill-com/neuroloop}
}
NeuroLoop™ builds on the following neuroscientific foundations. If you use specific metrics, please also cite the primary literature listed in METRICS.md. Key upstream works include:
@article{krigolson2017choosing,
author = {Krigolson, Olav E. and Williams, Chad C. and Norton, Angela and Hassall, Cameron D. and Colino, Francisco L.},
title = {Choosing {MUSE}: Validation of a Low-Cost, Portable {EEG} System for {ERP} Research},
journal = {Frontiers in Neuroscience},
volume = {11},
pages = {109},
year = {2017},
doi = {10.3389/fnins.2017.00109}
}
@inproceedings{cannard2021validating,
author = {Cannard, Christian and Wahbeh, Helané and Delorme, Arnaud},
title = {Validating the Wearable {MUSE} Headset for {EEG} Spectral Analysis and Frontal Alpha Asymmetry},
booktitle = {2021 IEEE International Conference on Bioinformatics and Biomedicine (BIBM)},
year = {2021},
doi = {10.1109/bibm52615.2021.9669778}
}
@article{coan2004frontal,
author = {Coan, James A. and Allen, John J. B.},
title = {Frontal {EEG} Asymmetry as a Moderator and Mediator of Emotion},
journal = {Biological Psychology},
volume = {67},
number = {1--2},
pages = {7--50},
year = {2004},
doi = {10.1016/j.biopsycho.2004.03.002}
}
@article{casali2013theoretically,
author = {Casali, Adenauer G. and Gosseries, Olivia and Rosanova, Mario and Boly, Melanie and Sarasso, Simone and Casali, Karina R. and Casarotto, Silvia and Bruno, Marie-Aurélie and Laureys, Steven and Tononi, Giulio and Massimini, Marcello},
title = {A Theoretically Based Index of Consciousness Independent of Sensory Processing and Behavior},
journal = {Science Translational Medicine},
volume = {5},
number = {198},
pages = {198ra105},
year = {2013},
doi = {10.1126/scitranslmed.3006294}
}
@article{klimesch1999eeg,
author = {Klimesch, Wolfgang},
title = {{EEG} Alpha and Theta Oscillations Reflect Cognitive and Memory Performance: A Review and Analysis},
journal = {Brain Research Reviews},
volume = {29},
number = {2--3},
pages = {169--195},
year = {1999},
doi = {10.1016/s0165-0173(98)00056-3}
}
@article{donoghue2020parameterizing,
author = {Donoghue, Thomas and Haller, Matar and Peterson, Erik J. and Varma, Paroma and Sebastian, Priyadarshini and Gao, Richard and Noto, Torben and Lara, Antonio H. and Wallis, Jonathan D. and Knight, Robert T. and Bhatt, Parveen and Voytek, Bradley},
title = {Parameterizing Neural Power Spectra into Periodic and Aperiodic Components},
journal = {Nature Neuroscience},
volume = {23},
pages = {1655--1665},
year = {2020},
doi = {10.1038/s41593-020-00744-x}
}
@article{pope1995biocybernetic,
author = {Pope, Alan T. and Bogart, Edward H. and Bartolome, Debbie S.},
title = {Biocybernetic System Evaluates Indices of Operator Engagement in Automated Task},
journal = {Biological Psychology},
volume = {40},
number = {1--2},
pages = {187--195},
year = {1995},
doi = {10.1016/0301-0511(95)05116-3}
}
@article{bandt2002permutation,
author = {Bandt, Christoph and Pompe, Bernd},
title = {Permutation Entropy: A Natural Complexity Measure for Time Series},
journal = {Physical Review Letters},
volume = {88},
number = {17},
pages = {174102},
year = {2002},
doi = {10.1103/PhysRevLett.88.174102}
}
@article{tononi2004information,
author = {Tononi, Giulio},
title = {An Information Integration Theory of Consciousness},
journal = {BMC Neuroscience},
volume = {5},
pages = {42},
year = {2004},
doi = {10.1186/1471-2202-5-42}
}
GPLv3
37 commits
1 commits
TypeScript
99.3%