davila7/claude-code-templates/neuropixels-analysis
Claude Code and agent skill by davila7/claude-code-templates
- community
Checking that the SKILL.md file is still in the repository.
Neuropixels neural recording analysis. Load SpikeGLX/OpenEphys data, preprocess, motion correction, Kilosort4 spike sorting, quality metrics, Allen/IBL curation, AI-assisted visual analysis, for Neuropixels 1.0/2.0 extracellular electrophysiology. Use when working with neural recordings, spike sorting, extracellular electrophysiology, or when the user mentions Neuropixels, SpikeGLX, Open Ephys, Kilosort, quality metrics, or unit curation.
Install
npx vskill@latest install davila7/claude-code-templates/neuropixels-analysisSKILL.md
Neuropixels Data Analysis
Overview
Comprehensive toolkit for analyzing Neuropixels high-density neural recordings using current best practices from SpikeInterface, Allen Institute, and International Brain Laboratory (IBL). Supports the full workflow from raw data to publication-ready curated units.
When to Use This Skill
This skill should be used when:
- Working with Neuropixels recordings (.ap.bin, .lf.bin, .meta files)
- Loading data from SpikeGLX, Open Ephys, or NWB formats
- Preprocessing neural recordings (filtering, CAR, bad channel detection)
- Detecting and correcting motion/drift in recordings
- Running spike sorting (Kilosort4, SpykingCircus2, Mountainsort5)
- Computing quality metrics (SNR, ISI violations, presence ratio)
- Curating units using Allen/IBL criteria
- Creating visualizations of neural data
- Exporting results to Phy or NWB
Supported Hardware & Formats
| Probe | Electrodes | Channels | Notes | |
|---|---|---|---|---|
| Neuropixels 1.0 | 960 | 384 | Requires phase_shift correction | |
| Neuropixels 2.0 (single) | 1280 | 384 | Denser geometry | |
| Neuropixels 2.0 (4-shank) | 5120 | 384 | Multi-region recording |
| Format | Extension | Reader | |
|---|---|---|---|
| SpikeGLX | .ap.bin, .lf.bin, .meta | si.read_spikeglx() | |
| Open Ephys | .continuous, .oebin | si.read_openephys() | |
| NWB | .nwb | si.read_nwb() |
Quick Start
Basic Import and Setup
Loading Data
Complete Pipeline (One Command)
Standard Analysis Workflow
1. Preprocessing
2. Check and Correct Drift
3. Spike Sorting
4. Postprocessing
5. Curation
6. AI-Assisted Curation (For Uncertain Units)
When using this skill with Claude Code, Claude can directly analyze waveform plots and provide expert curation decisions. For programmatic API access:
Claude Code Integration: When running within Claude Code, ask Claude to examine waveform/correlogram plots directly - no API setup required.
7. Generate Analysis Report
8. Export Results
Common Pitfalls and Best Practices
- Always check drift before spike sorting - drift > 10μm significantly impacts quality
- Use phase_shift for Neuropixels 1.0 probes (not needed for 2.0)
- Save preprocessed data to avoid recomputing - use
rec.save(folder='preprocessed/') - Use GPU for Kilosort4 - it's 10-50x faster than CPU alternatives
- Review uncertain units manually - automated curation is a starting point
- Combine metrics with AI - use metrics for clear cases, AI for borderline units
- Document your thresholds - different analyses may need different criteria
- Export to Phy for critical experiments - human oversight is valuable
Key Parameters to Adjust
Preprocessing
freq_min: Highpass cutoff (300-400 Hz typical)detect_threshold: Bad channel detection sensitivity
Motion Correction
preset: 'kilosort_like' (fast) or 'nonrigid_accurate' (better for severe drift)
Spike Sorting (Kilosort4)
batch_size: Samples per batch (30000 default)nblocks: Number of drift blocks (increase for long recordings)Th_learned: Detection threshold (lower = more spikes)
Quality Metrics
snr_threshold: Signal-to-noise cutoff (3-5 typical)isi_violations_ratio: Refractory violations (0.01-0.5)presence_ratio: Recording coverage (0.5-0.95)
Bundled Resources
scripts/preprocess_recording.py
Automated preprocessing script:
scripts/run_sorting.py
Run spike sorting:
scripts/compute_metrics.py
Compute quality metrics and apply curation:
scripts/export_to_phy.py
Export to Phy for manual curation:
assets/analysis_template.py
Complete analysis template. Copy and customize:
reference/standard_workflow.md
Detailed step-by-step workflow with explanations for each stage.
reference/api_reference.md
Quick function reference organized by module.
reference/plotting_guide.md
Comprehensive visualization guide for publication-quality figures.
Detailed Reference Guides
| Topic | Reference | |
|---|---|---|
| Full workflow | reference/standard_workflow.md | |
| API reference | reference/api_reference.md | |
| Plotting guide | reference/plotting_guide.md | |
| Preprocessing | PREPROCESSING.md | |
| Spike sorting | SPIKE_SORTING.md | |
| Motion correction | MOTION_CORRECTION.md | |
| Quality metrics | QUALITY_METRICS.md | |
| Automated curation | AUTOMATED_CURATION.md | |
| AI-assisted curation | AI_CURATION.md | |
| Waveform analysis | ANALYSIS.md |
Installation
Project Structure
Additional Resources
- SpikeInterface Docs: https://spikeinterface.readthedocs.io/
- Neuropixels Tutorial: https://spikeinterface.readthedocs.io/en/stable/how_to/analyze_neuropixels.html
- Kilosort4 GitHub: https://github.com/MouseLand/Kilosort
- IBL Neuropixel Tools: https://github.com/int-brain-lab/ibl-neuropixel
- Allen Institute ecephys: https://github.com/AllenInstitute/ecephys_spike_sorting
- Bombcell (Automated QC): https://github.com/Julie-Fabre/bombcell
- SpikeAgent (AI Curation): https://github.com/SpikeAgent/SpikeAgent
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcli-tool/components/skills/scientific/neuropixels-analysis/SKILL.md
Popularity
- Repository stars
- 24,137
- Repository forks
- 2,373
- Repository npm downloads, 7 days
- 6,579
- 7-day trend score
- 71
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 5 Apr 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davila7/claude-code-templates/neuropixels-analysis)