Raysurfer is designed for agents that chain multiple tool calls together in production workflows. If your agent only makes 1-3 tool calls per run, check Is Raysurfer Right for You? first.
Installation
Set Your API Key
Get your API key from the dashboard and set it as an environment variable:Drop-in Replacement
Raysurfer wraps the Claude Agent SDK. Swap your client and method names:Key Differences
| Claude SDK | Raysurfer |
|---|---|
ClaudeSDKClient | RaysurferClient |
client.query() | client.query() |
client.receive_response() | client.response() |
ClaudeAgentOptions) come directly from claude_agent_sdk — no Raysurfer-specific options needed.
Verification Checklist
Follow these three steps to confirm caching is working and understand the similarity threshold for your use case.Step 1: Confirm Code Generation on First Run
Run your agent with a unique query for the first time. This run generates code from scratch via the Claude Agent SDK, so it will take the full generation time.Step 2: Confirm Cache Hit on Second Run
Run the exact same query again:If the second run completes dramatically faster than the first, caching is working. You’re in the clear.
Step 3: Explore the Similarity Boundary
Now try similar but not identical queries to see how far you can drift before you stop getting cache hits. Start close and gradually move further away:Need help tuning for your use case?
Book a 15-minute call and we’ll walk through your integration together.
What Gets Cached?
Raysurfer caches:- Code outputs from agent tool calls
- Generated reports, templates, and documents
- API response patterns
- Any structured output your agent produces
Raysurfer automatically verifies and stores successful code snippets from your runs for future reuse.
Programmatic Tool Calling
Register tools, then either pass in code (primary mode) or optionally generate code in the sandbox with your own key + prompt:@rs.tool can wrap any function and uses its docstring as the tool description in the schema payload.
In TypeScript, tool(name, description, parameters, callback) wraps any callback and uses your description string the same way.
execute() supports two modes: user_code/userCode (primary) or optional sandbox codegen with a user-provided prompt and provider key.
If you already have an LLM tool loop and just want to wrap it with .search() + .upload(), use Wrap Any LLM Tool Flow.
Next Steps
Python SDK
Full Python SDK reference and examples
TypeScript SDK
Full TypeScript SDK reference and examples
How It Works
Learn about proven code retrieval and reputation scoring
Is It Right for Me?
Check if your agent workflow is a good fit for Raysurfer
