ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

code-cache

Semantic code caching for AI agents. Cache, retrieve, and reuse code from prior agent executions.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ryx2/code-reputation
Or

Code Cache - Semantic Code Caching for AI Agents

This skill enables semantic code caching via the Raysurfer API.

What It Does

When your agent generates and executes code, Code Cache stores it. When a similar task comes up later, the agent can retrieve and run the cached code instead of regenerating it—saving time and tokens.

Setup

Get your API key from the Raysurfer dashboard and configure it:

# Via environment variable
export RAYSURFER_API_KEY=your_api_key_here

# Or via OpenClaw config
openclaw config set skills.entries.code-cache.apiKey "your_api_key_here"

Available Commands

Search for cached code

/code-cache search <task description> [--top-k N] [--min-score FLOAT] [--show-code]

Search for cached code snippets that match a natural language task description.

Options:

  • --top-k N — Maximum number of results (default: 5)
  • --min-score FLOAT — Minimum verdict score filter (default: 0.3)
  • --show-code — Display the source code of the top match

Example:

/code-cache search "Generate a quarterly revenue report"
/code-cache search "Fetch GitHub trending repos" --top-k 3 --show-code

Get code files for a task

/code-cache files <task description> [--top-k N] [--cache-dir DIR]

Retrieve code files ready for execution, with a pre-formatted prompt addition for your LLM.

Options:

  • --top-k N — Maximum number of files (default: 5)
  • --cache-dir DIR — Output directory (default: .code_cache)

Example:

/code-cache files "Fetch GitHub trending repos"
/code-cache files "Build a chart" --cache-dir ./cached_code

Upload code to cache

/code-cache upload <task> --files <path> [<path>...] [--failed] [--no-auto-vote]

Upload code from an execution to the cache for future reuse.

Options:

  • --files, -f — Files to upload (required, can specify multiple)
  • --failed — Mark the execution as failed (default: succeeded)
  • --no-auto-vote — Disable automatic voting on stored code blocks

Example:

/code-cache upload "Build a chart" --files chart.py
/code-cache upload "Data pipeline" -f extract.py transform.py load.py
/code-cache upload "Failed attempt" --files broken.py --failed

Vote on cached code

/code-cache vote <code_block_id> [--up|--down] [--task TEXT] [--name TEXT] [--description TEXT]

Vote on whether cached code was useful. This improves retrieval quality over time.

Options:

  • --up — Upvote / thumbs up (default)
  • --down — Downvote / thumbs down
  • --task — Original task description (optional)
  • --name — Code block name (optional)
  • --description — Code block description (optional)

Example:

/code-cache vote abc123 --up
/code-cache vote xyz789 --down --task "Generate report"

How It Works

Metadata

Author@ryx2
Stars1133
Views1
Updated2026-02-18
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ryx2-code-reputation": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.