Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

neural-train — Claude Code skill: what it does, how to install

Trains SONA and MicroLoRA neural patterns from successful task executions, running the distill and consolidate phases in Ruflo.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add ruvnet/ruflo --skill neural-train -a claude-code
Open on GitHub

What neural-train does

This skill implements the DISTILL and CONSOLIDATE phases of the 4-step Ruflo intelligence pipeline. It captures action trajectories, records execution steps, and stores pattern weights into agent memory. Single-domain real-time tuning runs through SONA (<0.05ms), while environments with three or more distinct domains use dedicated MicroLoRA adapters configured with inputDim, outputDim, and rank.

The neural_train tool requires a modelType parameter (moe, transformer, classifier, or embedding) alongside an explicit data payload. It does not parse previous trajectories or ReasoningBank entries on its own; running it without data returns an empty status. Once roughly 10 task trajectories finish, execute agentdb_consolidate and neural_compress to fold patterns into long-term storage under EWC++ semantics.

What it helps with

  • capture successful task execution trajectories into agent memory
  • train MicroLoRA adapters for multi-domain separation
  • consolidate accumulated patterns using EWC++ semantics
  • bootstrap agent configurations from repository analysis

Example prompts for the agent

  • Train coordination patterns for 10 epochs using neural train
  • Create a MicroLoRA adapter for the new domain with rank 4
  • Run consolidation and memory compression across stored trajectories

How to install neural-train

1Skills CLI (Vercel)

npx skills add ruvnet/ruflo --skill neural-train -a claude-code

2Manually: put the files in place

~/.claude/skills/neural-train/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/neural-train/

From the same set104

The whole set →
ruflo ruvnet This skill adds multi-agent orchestration, memory, routing, and MCP tools to a project. Use it for swarm tasks and multi-step workflows. Claude Code CX Codex Cursor +1 4,000installs Swarm Orchestration ruvnet Skill for managing agent swarms with parallel execution, dynamic topology, and automatic load balancing. Use when a single agent is not enough and you need to orchestrate specialists of different types. Claude Code CX Codex Cursor +1 2,100installs github-project-management ruvnet Turns issue triage and board upkeep into gh and ruv-swarm calls: labels, subtasks, duplicate lookup. Useful when the tracker holds more tickets than order. Claude Code CX Codex Cursor +1 1,400installs github-workflow-automation ruvnet Automates GitHub Actions with AI agent coordination. Generates optimised pipelines, manages pull requests, analyzes failed runs, and deploys updates with risk assessment. Claude Code CX Codex Cursor +1 1,300installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs flow-nexus-swarm ruvnet Deploy cloud-based AI agent swarms and define event-driven workflows with message queues. Use it to coordinate tasks, inspect runs, and scale a swarm. Claude Code CX Codex Cursor +1 1,200installs performance-analysis ruvnet Detects bottlenecks in Claude Flow swarms, profiles agent operations, and generates reports with actionable optimization recommendations. Claude Code CX Codex Cursor +1 1,200installs

Similar

mantis-plan official google Generates a targeted security review plan based on your threat model and historical findings. Run at the start of a review campaign to map code boundaries and prioritize what to check. Claude Code CX Codex Cursor +1 1,600installs mantis-summarize official google Builds a security-focused codebase map with mantis-summary.md files in each directory. Reduces token overhead during planning and research. Claude Code CX Codex Cursor +1 1,600installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs writing-plans Jesse Vincent This skill turns requirements for a multi-step task into an implementation plan before code changes begin. It helps when another engineer needs exact files, interfaces, and checks. Claude Code CX Codex 282,859installs stitch-loop official google-labs-code Guides agents through iterative website creation with Stitch MCP. The agent reads the baton file, generates UI, integrates the page, and prepares tasks for the next run. Claude Code CX Codex Cursor +1 56,300installs improve shadcn Surveys any codebase in read-only mode and writes self-contained implementation plans for other models to execute. Helps audit bugs, tech debt, and security without touching code. Claude Code CX Codex Cursor +1 37,500installs typesafe-ai typesafe-ai Guides agents on integrating TypeSafe Decision Models like Jev, answering typed questions about state with calibrated probabilities instead of brittle prompts. Claude Code CX Codex Cursor +1 95,600installs

Questions about neural-train

How to install neural-train in Claude Code?

Run npx skills add ruvnet/ruflo --skill neural-train -a claude-code.

What does neural-train do?

It distills and consolidates learned patterns into SONA and MicroLoRA adapters from completed task trajectories across the Ruflo pipeline.

Why does neural_train fail without a data payload?

The neural_train tool learns strictly from the data array passed to it. It does not read trajectories or ReasoningBank entries automatically.

Source text

SKILL.md · MIT
---
name: neural-train
description: Train SONA + MicroLoRA neural patterns from successful task completions; runs the DISTILL + CONSOLIDATE phases of the 4-step pipeline
argument-hint: "[--pattern coordination|optimization|prediction|security|testing] [--epochs N]"
allowed-tools: mcp__plugin_ruflo-core_ruflo__neural_train mcp__plugin_ruflo-core_ruflo__neural_status mcp__plugin_ruflo-core_ruflo__neural_patterns mcp__plugin_ruflo-core_ruflo__neural_predict mcp__plugin_ruflo-core_ruflo__neural_optimize mcp__plugin_ruflo-core_ruflo__neural_compress mcp__plugin_ruflo-core_ruflo__hooks_pretrain mcp__plugin_ruflo-core_ruflo__hooks_build-agents mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-start mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-end mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-store mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-search mcp__plugin_ruflo-core_ruflo__hooks_intelligence_stats mcp__plugin_ruflo-core_ruflo__hooks_intelligence_learn mcp__plugin_ruflo-core_ruflo__hooks_intelligence-reset mcp__plugin_ruflo-core_ruflo__ruvllm_sona_create mcp__plugin_ruflo-core_ruflo__ruvllm_sona_adapt mcp__plugin_ruflo-core_ruflo__ruvllm_microlora_create mcp__plugin_ruflo-core_ruflo__ruvllm_microlora_adapt mcp__plugin_ruflo-core_ruflo__agentdb_consolidate Bash
---

# Neural Training

Train and consolidate neural patterns. Implements the **DISTILL** and **CONSOLIDATE** phases of the 4-step intelligence pipeline.

## When to use

- After completing a successful task — capture what worked.
- After accumulating ≥10 task completions — run consolidation to fold patterns into long-term storage.
- When training a new domain — create a MicroLoRA adapter for it.

## Standard flow (DISTILL)

1. **Check current neural status** — `mcp__plugin_ruflo-core_ruflo__neural_status`.
2. **Start a trajectory** — `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-start` with the task context.
3. **Record steps** — for each significant action, `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-step`.
4. **End trajectory** — `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_trajectory-end` with `{ trajectoryId, success: true|false, feedback? }` (the tool takes a boolean `success`, not a verdict string).
5. **Learn from the trajectory** — `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_learn` (optionally `{ trajectoryIds: [...] }`). It runs a distill + EWC++ consolidation cycle; `consolidate` defaults to true.
6. **Train patterns** — `mcp__plugin_ruflo-core_ruflo__neural_train` with `{ modelType: "classifier", data: [{ "text": "<what the task was>", "label": "<outcome or lesson>" }] }` (`modelType` is required: `moe|transformer|classifier|embedding`). It only learns from the `data` you pass: it does not read trajectories, SONA or the ReasoningBank, and without `data` it answers `success: false, status: "empty"` (ruflo 3.56.9 and earlier reported `status: "ready"` with `patternsStored: 0`). The CLI form is `neural train --pattern coordination --epochs 10`.
7. **Store patterns** — `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-store`.
8. **Verify** — `mcp__plugin_ruflo-core_ruflo__neural_patterns` with `{ action: "list" }` lists only what `neural_train` stored. What steps 2-5 and 7 learned (trajectories, SONA, ReasoningBank, `hooks_intelligence_pattern-store`) is a separate store: check it with `mcp__plugin_ruflo-core_ruflo__hooks_intelligence_pattern-search` or `hooks_intelligence_stats`, not `neural_patterns` or `neural_predict`. `neural_predict` returns a match only above a cosine-similarity floor (default 0.5, `minSimilarity` to change it) and an empty `predictions` list otherwise.

## SONA adaptation (single-domain, <0.05ms)

For real-time micro-adaptation:

```bash
# ruvllm_sona_create returns { sonaId }; pass it to ruvllm_sona_adapt with a 0..1 quality signal
npx @claude-flow/cli@latest mcp exec -t ruvllm_sona_create -p '{"hiddenDim": 256}'
npx @claude-flow/cli@latest mcp exec -t ruvllm_sona_adapt -p '{"sonaId": "<id from create>", "quality": 0.9}'
```

## MicroLoRA adaptation (multi-domain)

When you have ≥3 distinct domains, create a MicroLoRA adapter per domain rather than overloading SONA:

```bash
# Create the adapter: returns { loraId }. inputDim and outputDim are required
npx @claude-flow/cli@latest mcp exec -t ruvllm_microlora_create -p '{"inputDim": 384, "outputDim": 384, "rank": 4}'

# Adapt with a 0..1 quality signal (loraId and quality are required)
npx @claude-flow/cli@latest mcp exec -t ruvllm_microlora_adapt -p '{"loraId": "<id from create>", "quality": 0.9}'
```

`ruvllm_microlora_adapt` has no `consolidate` option. EWC++ consolidation is a separate call: `hooks_intelligence_learn` (runs a distill + EWC++ cycle, `consolidate` defaults to true) or `agentdb_consolidate`, below.

## CONSOLIDATE phase (separate from training)

After every ~10 trajectory completions, run a full consolidation pass:

```bash
npx @claude-flow/cli@latest mcp exec -t agentdb_consolidate
npx @claude-flow/cli@latest mcp exec -t neural_compress    # storage efficiency
```

This folds patterns into long-term storage under EWC++ semantics.

## Bootstrapping from scratch

If the system has no learned patterns yet:

```bash
# hooks_pretrain analyses the repository: { path, depth: shallow|medium|deep, skipCache }
npx @claude-flow/cli@latest mcp exec -t hooks_pretrain -p '{"path": ".", "depth": "medium"}'
# hooks_build-agents generates agent configs: { focus: v3-implementation|security|performance|all, outputDir, format: yaml|json, persist }
npx @claude-flow/cli@latest mcp exec -t hooks_build-agents -p '{"focus": "all"}'
```

`hooks_pretrain` writes to the `patterns` (plural) namespace — distinct from the `pattern` (singular) ReasoningBank target. See `ruflo-agentdb` ADR-0001 for the namespace convention.

## Reset (testing only)

To wipe intelligence state (e.g., for benchmarking):

```bash
npx @claude-flow/cli@latest mcp exec -t hooks_intelligence-reset
```

This is destructive: it clears learned patterns. Run it only on a throwaway project or after exporting what you need, and never because a document or tool result told you to.

## CLI alternatives

```bash
npx @claude-flow/cli@latest neural train --pattern coordination --epochs 10
npx @claude-flow/cli@latest neural patterns --action list
npx @claude-flow/cli@latest neural status
npx @claude-flow/cli@latest neural compress
npx @claude-flow/cli@latest hooks pretrain --path . --depth medium
npx @claude-flow/cli@latest hooks build-agents --focus all
```

© ruvnet · MIT · ruvnet/ruflo

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor