Skip to main content
subagent CX Codex

sona-learning-optimizer — Claude Code subagent: what it does

sona-learning-optimizer — a subagent that logs every task as a trajectory and nudges quality up by reusing similar past patterns and LoRA fine-tuning.

no license ★ 850 updated 2026-10-26

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/sona-learning-optimizer.md
Open on GitHub

What sona-learning-optimizer does

Learning sits inside every run. Before the task, a hook looks up a few similar patterns, opens a trajectory in npx claude-flow sona and tags it with the agent name. After the task, a second hook scores the output, writes activation and attention vectors, closes the trajectory and starts a learning cycle when there is enough data. The agent description claims up to +55% quality.

Both hooks are shell scripts kept in the agent's frontmatter. They call npx claude-flow sona pattern find and trajectory begin/step/end, build vectors with python3 and parse JSON with jq. Those vectors are stand-ins: embeddings and activations come from a random generator seeded by a hash of the task or the output.

The hooks need npx claude-flow, jq and python3 on PATH; miss one and the learning step is skipped without an error. Quality is scored from answer length plus the number of code fences, so a long answer full of code scores high whether or not it is any good.

What it helps with

  • log each task as a trajectory you can inspect later
  • pull up similar past solutions before starting a new task
  • score answer quality from measurable signals
  • route requests to a model with quality in mind
  • keep learned patterns without retraining the whole model

Example prompts for the agent

  • Run sona-learning-optimizer on the failing test and list the similar patterns it found.
  • Hand the schema migration to sona-learning-optimizer and finish with npx claude-flow sona stats.
  • Use sona-learning-optimizer to fix the build and keep the trajectory so the pattern stays in the library.

How to install sona-learning-optimizer

Manually: put the files in place

.claude/agents/sona-learning-optimizer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about sona-learning-optimizer

How do I install sona-learning-optimizer in Claude Code?

Put the agent file at .claude/agents/sona-learning-optimizer.md. Claude picks it up from there as a subagent.

What does sona-learning-optimizer do?

It tracks each task as a trajectory: finds similar patterns beforehand, scores the result afterwards and, when the data allows, runs a learning cycle with LoRA and EWC++.

What has to be installed for the learning to work?

npx claude-flow, jq and python3 on PATH. If no trajectory was created, the post-task hook skips learning.

Similar subagents

All subagents for Agent setup: memory, context, orchestration →
continual-learning microsoft continual-learning — a skill that teaches AI agents to remember mistakes, tool patterns, and project conventions between sessions. Without it, each run starts fresh; with it, agents compound their knowledge and work more accurately. CX Codex +1 79installs skillopt-sleep Alireza Rezvani skillopt-sleep runs offline self-evolution cycles for Claude Code: mines past sessions, replays tasks, and stages validated CLAUDE.md and SKILL.md updates for manual review. ★ 30,251repo stars explore-code lllllllama explore-code — a skill for cautious code experiments in deep learning repositories: it transplants modules and adapts architectures on an isolated branch, with rollback-aware records. CX Codex +1 362,900installs swarm-advanced ruvnet swarm-advanced — a skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that brings multi-agent swarm patterns to your workflow. Coordinates parallel research, development, and testing across specialized agents. CX Codex +1 1,200installs V3 Deep Integration ruvnet The V3 Deep Integration skill turns claude-flow into a specialized extension of agentic-flow@alpha per ADR-001. It drops duplicate modules and wires in SONA, Flash Attention and AgentDB. CX Codex +1 1,100installs p-image 101-skills A skill for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode that connects four Pruna P-Image models through the belt CLI. Covers text-to-image, image editing, LoRA style presets, and multi-image compositing. CX Codex +1 14,500installs

From the same set76

The whole set →
pr-manager pr-manager coordinates pull request reviews, tests, and merge work through GitHub tools and a swarm of agents. It can also reuse patterns saved from earlier PR tasks. CX Codex ★ 850repo stars reviewer A reviewer persona for Claude that reads a change like a senior engineer: behaviour, security holes, slow paths, standards, docs. You get a summary with critical issues. CX Codex ★ 850repo stars refinement SPARC refinement phase agent for iterative code polish. Drives test-driven development: creates failing tests, satisfies them, and cleans up structure. CX Codex ★ 850repo stars release-swarm release-swarm coordinates release work from change analysis and changelog preparation to builds, tests, and deployment across configured targets. CX Codex ★ 850repo stars tester tester is a Claude Code subagent that creates tests and checks code, recording past failures in claude-flow. CX Codex ★ 850repo stars code-goal-planner The code-goal-planner subagent turns software goals into milestones with dependencies and success criteria. Use it to plan a feature, bug fix, or refactor. CX Codex ★ 850repo stars swarm-issue swarm-issue turns a GitHub issue into work for a swarm: splits it into subtasks, assigns agents and reports progress back inside the issue. CX Codex ★ 850repo stars performance-optimizer The performance-optimizer subagent finds system bottlenecks and helps tune resource distribution, load balancing, and computational performance. CX Codex ★ 850repo stars

Project sponsors

Companies that keep this analytics open