Agent skill

Kapso

by Leeroo-AI in Leeroo-AI/kapso

Optimize code using KAPSO (Knowledge-Grounded Optimization).

MITAuto-check passedAgent Workflows

Install Kapso

skills CLI
$ npx skills add Leeroo-AI/kapso --skill kapso -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Leeroo-AI/kapso kapso --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Leeroo-AI/kapso.git skills-src && mkdir -p .claude/skills && cp -r skills-src/moltbook_bot/openclaw_skill .claude/skills/kapso && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kapso
GitHub stars
121
Token cost
~642 tokens
SKILL.md length
99 words
Files
2
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

Optimize code using KAPSO (Knowledge-Grounded Optimization).

  • Works in 3 steps: Submit Optimization Request → Check Job Status → Health Check
  • You need to write
  • SKILL.md covers When to Use, How to Use, Example: Optimize O(n²) to O(n) and Response Format for Moltbook, plus 2 more sections
  • Calls curl and python

What it does

Kapso is an agent skill from Leeroo-AI/kapso. Optimize code using KAPSO (Knowledge-Grounded Optimization). Use when you need to write, optimize, or fix code. Connects to a local KAPSO server that iteratively improves solutions through experimentation.

Its SKILL.md is about 640 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `HEARTBEAT.md`).

It sits in Agent Workflows, covering Autonomous loops and A/B testing. The repository describes itself as: Kapso by Leeroo: Long-running agents that optimize AI and Data systems, and learn from every experience. 1 open-source on MLE-Bench; ALE-Bench; RelBench. The licence is MIT.

When your agent uses it

  • You need to write
  • Tasks that involve Autonomous loops
  • Tasks that involve A/B testing

Example prompts

  • “/kapso”

Requirements

  • Python 3

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Submit Optimization Request
  2. Check Job Status
  3. Health Check

What it can do on your machine

Read from SKILL.md and the folder at commit 3b5140a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Kapso loads about 642 tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 99 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~642

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Leeroo-AI/kapso at commit 3b5140a, republished under its MIT licence (© Leeroo-AI). 99 words, ~642 tokens.

Download SKILL.mdSave it as .claude/skills/kapso/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
kapso
description
Optimize code using KAPSO (Knowledge-Grounded Optimization). Use when you need to write, optimize, or fix code. Connects to a local KAPSO server that iteratively improves solutions through experimentation.

KAPSO Bridge Skill

KAPSO is a knowledge-grounded optimization framework that iteratively improves code through experimentation.

When to Use

Use this skill when you need to:

  • Optimize inefficient code (e.g., O(n²) → O(n))
  • Fix bugs with verification
  • Improve algorithm performance
  • Generate optimized solutions

How to Use

1. Submit Optimization Request
bash
curl -X POST http://${KAPSO_URL:-localhost:8000}/optimize \
  -H "Content-Type: application/json" \
  -d '{
    "goal": "Describe what needs to be optimized",
    "code": "def your_code(): pass",
    "context": "Optional additional context"
  }'

Response:

json
{
  "job_id": "abc123",
  "status": "running",
  "thought_process": "Optimization started..."
}
2. Check Job Status
bash
curl http://${KAPSO_URL:-localhost:8000}/status/{job_id}

Response when complete:

json
{
  "job_id": "abc123",
  "status": "completed",
  "code": "def optimized_code(): ...",
  "cost": "$0.042",
  "thought_process": "KAPSO Optimization Complete..."
}
3. Health Check
bash
curl http://${KAPSO_URL:-localhost:8000}/health

Example: Optimize O(n²) to O(n)

Input:

python
def find_duplicates(arr):
    duplicates = []
    for i in range(len(arr)):
        for j in range(i + 1, len(arr)):
            if arr[i] == arr[j] and arr[i] not in duplicates:
                duplicates.append(arr[i])
    return duplicates

After KAPSO optimization:

python
def find_duplicates(arr):
    seen = set()
    duplicates = set()
    for item in arr:
        if item in seen:
            duplicates.add(item)
        seen.add(item)
    return list(duplicates)

Response Format for Moltbook

When posting optimized code to Moltbook, use this format:

markdown
**KAPSO Optimization Report**

Original complexity: O(n²)
Optimized complexity: O(n)
Cost: $0.042

\`\`\`python
# Optimized code here
\`\`\`

*Optimized by [KAPSO](https://github.com/Leeroo-AI/kapso) - Knowledge-Grounded Optimization*

Environment Variables

  • KAPSO_URL: URL of the KAPSO server (default: http://localhost:8000)

Server Requirements

The KAPSO server must be running:

bash
cd /home/ubuntu/kapso && python kapso_server.py

© Leeroo-AI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in moltbook_bot/openclaw_skill of Leeroo-AI/kapso.

  • SKILL.md
  • HEARTBEAT.md

Open the folder on GitHubat commit 3b5140a

Compare with similar skills

Kapso next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kapso compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kapso this skillLeeroo-AI/kapso121—~642Automated safety check: PassMIT
Autoresearchgrandamenium/cortextos101—~1.9kAutomated safety check: PassMIT
Autoresearchericosiu/ai-marketing-skills3.6k2 repos~2.2kAutomated safety check: PassMIT
Autoresearchgithub/awesome-copilot40k1 repos~2.8kAutomated safety check: PassMIT
Edt MCP Tool DescriptionsDitriXNew/EDT-MCP295—~3kAutomated safety check: PassAGPL-3.0
Evo MemoryEvoScientist/EvoSkills4763 repos~4.8kAutomated safety check: PassApache-2.0

Similar skills

  • Autoresearch

    grandamenium/cortextos

    The analyst has assigned you a research cycle, or you have identified a metric you want to improve through systematic experimentation.

    101 GitHub stars~1.9k tokensUpdated 17 days ago
    Agent WorkflowsAuto-check passed
  • Autoresearch

    ericosiu/ai-marketing-skills

    Run Karpathy-style autoresearch optimization on any content.

    3.6k GitHub starsUsed in 2 repos~2.2k tokens
    Marketing & SEOAuto-check passed
  • Autoresearch

    github/awesome-copilot

    Official

    Autonomous iterative experimentation loop for any programming task.

    40k GitHub starsUsed in 1 repo~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Edt MCP Tool Descriptions

    DitriXNew/EDT-MCP

    How to size, write and A/B-test the text of a tool — its description and its inputSchema parameter prose — so that cutting it does not cost call quality, and so that a tool that IS getting called…

    295 GitHub stars~3k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed
  • Evo Memory

    EvoScientist/EvoSkills

    Manages persistent research memory across ideation and experimentation cycles.

    476 GitHub starsUsed in 3 repos~4.8k tokens
    Agent WorkflowsAuto-check passed
  • Spec Optimize

    leo-kuang-ai/spec-first

    Run metric-driven iterative optimization loops. An agent skill from leo-kuang-ai/spec-first.

    107 GitHub stars~13k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from Leeroo-AI/kapso

  • Kapso

    Leeroo-AI/kapso

    Operate Kapso (PyPI leeroo-kapso), the long-running agents that optimize AI and Data systems, from a coding session — verify the install with kapso doctor, launch and follow an evolve campaign…

    121 GitHub stars~3.6k tokensUpdated yesterday
    Auto-check: notes

Questions about Kapso

What does Kapso do?

Optimize code using KAPSO (Knowledge-Grounded Optimization). Kapso is an agent skill from Leeroo-AI/kapso. Optimize code using KAPSO (Knowledge-Grounded Optimization).

When should I use Kapso?

Kapso fits situations like: you need to write; tasks that involve Autonomous loops; tasks that involve A/B testing.

How do I install Kapso in Claude Code?

Run `npx skills add Leeroo-AI/kapso --skill kapso -a claude-code`. Or copy the skill folder (moltbook_bot/openclaw_skill in Leeroo-AI/kapso) into .claude/skills/kapso in your project. Claude Code loads it when a task matches its description.

How do I install Kapso in Codex?

Run `npx skills add Leeroo-AI/kapso --skill kapso -a codex`. Or copy the skill folder (moltbook_bot/openclaw_skill in Leeroo-AI/kapso) into .agents/skills/kapso in your project. Codex loads it when a task matches its description.

Can I use Kapso in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Leeroo-AI/kapso --skill kapso -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kapso, .gemini/skills/kapso, .github/skills/kapso and .opencode/skills/kapso in your project.

What does Kapso need to run?

Going by SKILL.md and its folder, Kapso needs the command-line tools its instructions call (curl and python). Our summary lists: Python 3.

Does Kapso access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Kapso safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kapso use?

Kapso is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kapso use?

About 642 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kapso?

Skills that share tags, products or a category with Kapso: Autoresearch (grandamenium/cortextos, 101 stars), Autoresearch (ericosiu/ai-marketing-skills, 3.6k stars), Autoresearch (github/awesome-copilot, 40k stars) and Edt MCP Tool Descriptions (DitriXNew/EDT-MCP, 295 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kapso?

Leeroo-AI (a GitHub organization) maintains it in Leeroo-AI/kapso, which has 121 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 8, 2026.

Source: Leeroo-AI/kapso on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.