← Back to Skills Marketplace
ryx2

Code Cache

by ryx2 · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
756
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install code-cache
Description
Semantic code caching for AI agents. Cache, retrieve, and reuse code from prior agent executions.
README (SKILL.md)

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 \x3Ctask 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 \x3Ctask 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 \x3Ctask> --files \x3Cpath> [\x3Cpath>...] [--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 \x3Ccode_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

  1. Cache Hit: When you ask for code similar to something previously executed, Code Cache returns the cached version instantly
  2. Cache Miss: When no match exists, your agent generates code normally, then Code Cache stores it for future use
  3. Verdict Scoring: Code that works gets 👍, code that fails gets 👎—retrieval improves over time

API Reference

The skill wraps these Raysurfer API methods:

Method Description
search(task, top_k, min_verdict_score) Unified search for cached code snippets
get_code_files(task, top_k, cache_dir) Get code files ready for sandbox execution
upload_new_code_snips(task, files_written, succeeded, auto_vote) Store new code after execution
vote_code_snip(task, code_block_id, code_block_name, code_block_description, succeeded) Vote on snippet usefulness

Why Code Caching?

LLM agents repeat the same patterns constantly. Instead of regenerating code every time:

  • 30x faster: Retrieve proven code instead of waiting for generation
  • Lower costs: Reduce token usage by reusing cached solutions
  • Higher quality: Cached code has been validated and voted on
  • Consistent output: Same task = same proven solution

Learn more at raysurfer.com or read the documentation.

Usage Guidance
This skill appears coherent: it talks to the Raysurfer API using the single RAYSURFER_API_KEY you provide and implements search/fetch/upload/vote for code snippets. Before installing, consider: 1) Trust the third party (Raysurfer): uploaded code and metadata will be transmitted to their service. 2) Sensitive data risk: any secrets or credentials embedded in code you upload could be leaked — audit or sanitize files before upload. 3) Execution risk: the skill writes retrieved code to disk so your agent or sandbox may execute it — run in an isolated sandbox and review code before execution. 4) Key management: store the API key with least privilege and be prepared to revoke it if needed. If these tradeoffs are acceptable, the skill is internally consistent with its stated purpose.
Capability Analysis
Type: OpenClaw Skill Name: code-cache Version: 1.0.0 The skill is classified as suspicious due to its inherent high-risk capabilities, which, while aligned with its stated purpose, present a significant attack surface for misuse. The `code_cache.py` script allows reading arbitrary local files (via `cmd_upload`) and writing arbitrary code received from the Raysurfer API to local files (via `cmd_files`). These operations, coupled with network communication to a third-party API (raysurfer.com), could be exploited through prompt injection against the AI agent to exfiltrate sensitive local files, perform arbitrary file writes, or execute untrusted code. There is no clear evidence of intentional malicious behavior by the skill developer, but the broad permissions and powerful file system interactions warrant a 'suspicious' classification.
Capability Assessment
Purpose & Capability
Name/description, SKILL.md, README, and code all describe a Raysurfer-backed semantic code cache. The only required environment variable is RAYSURFER_API_KEY which directly matches the documented remote API usage.
Instruction Scope
Instructions and CLI operations are scoped to searching, downloading, writing code files to a cache directory, uploading code snippets, and voting — all expected for a caching service. Note: uploads will transmit user code to the external Raysurfer service (explicitly documented). Retrieved snippets are written to disk for execution by the agent/runner, which is expected but is a privacy/safety consideration (see guidance).
Install Mechanism
No install spec is present (instruction-only from the registry point of view) and the repo contains Python CLI code. There are no remote downloads or opaque installers referenced in SKILL.md/README; the code expects a standard 'raysurfer' Python package if used locally.
Credentials
Only one credential is requested (RAYSURFER_API_KEY) which is proportionate to the described remote API usage. However, that key grants the skill network access to the external Raysurfer service and will be used to upload user code — any secrets inside code files could be transmitted.
Persistence & Privilege
always is false and the skill does not request persistent/system-wide privileges or modify other skills' configs. It writes cached files to a user-specified directory (default .code_cache), which is expected behavior.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install code-cache
  3. After installation, invoke the skill by name or use /code-cache
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: semantic code caching for AI agents via Raysurfer API
Metadata
Slug code-cache
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Code Cache?

Semantic code caching for AI agents. Cache, retrieve, and reuse code from prior agent executions. It is an AI Agent Skill for Claude Code / OpenClaw, with 756 downloads so far.

How do I install Code Cache?

Run "/install code-cache" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Code Cache free?

Yes, Code Cache is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Code Cache support?

Code Cache is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Code Cache?

It is built and maintained by ryx2 (@ryx2); the current version is v1.0.0.

💬 Comments