Readyset Docs

Claude Code

Add RDST to Claude Code so it can find slow queries, run analyze, deploy caches, and read audit snapshots for you.

Running rdst claude adds RDST to your local Claude Code as a callable capability. Claude Code can then run RDST commands directly — finding slow queries, analyzing specific queries, generating SQL from plain English, deploying Readyset caches, reviewing audit snapshots — without you needing to copy output back and forth between your terminal and the chat.

Nothing external is added. RDST is already installed on your machine; rdst claude just tells Claude Code how to call it.

Add RDST to Claude Code

Make sure RDST is installed and rdst version works.

Register RDST with Claude Code:

rdst claude

This updates Claude Code's local config so it knows how to call your installed rdst binary. Everything stays on your machine.

Restart Claude Code (or open a new session). The RDST tools will appear in the tool list.

To remove the integration later:

rdst claude remove

What Claude Code can do with RDST

Once registered, Claude Code has tool access to the core RDST workflows:

ToolWhat Claude can do
rdst_configure_list / rdst_configure_addInspect or add database targets
rdst_test_connectionVerify a target is reachable
rdst_topFind the slowest queries (real-time or historical)
rdst_query_list / rdst_query_add / rdst_query_deleteManage saved queries
rdst_analyzeAnalyze a query by hash, name, or inline SQL
rdst_schemaInspect the semantic layer
rdst_auditRun a single-target audit
rdst_audit_list / rdst_audit_showBrowse past audit snapshots
rdst_fleet_list / rdst_fleet_statusList and check the fleet
rdst_fleet_auditRun a fleet-wide audit
rdst_fleet_snapshots / rdst_fleet_diffBrowse and compare fleet snapshots
rdst_cache_deploy / rdst_cache_add / rdst_cache_show / rdst_cache_deleteDeploy Readyset and manage caches
rdst_scanScan a codebase for ORM queries
rdst_agent_list / rdst_agent_create / rdst_agent_askManage data agents
rdst_helpLook up RDST documentation

Claude Code still asks your permission before each tool call, so nothing runs against your database without you seeing it first.

Typical patterns

Investigate a slow endpoint

Our /orders/recent endpoint has gotten slow over the last week. Find the top queries on the prod-orders target, identify the ones that look like they correspond to that endpoint, and tell me which ones RDST thinks should go through a Readyset cache.

Claude will call rdst_top, filter the output, follow up with rdst_analyze on the top candidates, and summarize the results.

Review an audit snapshot

Look at the most recent audit snapshot for prod-orders. Which recommended indexes would have the biggest impact if I shipped them today?

Claude calls rdst_audit_list to find the latest, then rdst_audit_show to read the stored recommendations.

Deploy a cache end-to-end

I ran rdst audit on prod-orders earlier. Walk through the top Readyset candidate: analyze it in depth, deploy Readyset, add the cache, and run a cache-compare to show me the impact.

Claude chains rdst_audit_showrdst_analyzerdst_cache_deployrdst_cache_add, asking for confirmation before each deploy step.

Generate SQL from a product question

What does our status = 3 mean for orders? Check the semantic layer via rdst_schema — my guess is "shipped".

rdst_ask is intentionally not exposed as an MCP tool by default — interactive rdst ask produces better SQL because it can ask clarifying questions. For natural-language-to-SQL from Claude, point Claude at rdst_schema and let it write SQL directly, then validate with rdst_analyze.

MCP tools vs a dedicated data agent

rdst claude gives Claude Code access to the general-purpose RDST toolset — every core command, essentially a second terminal for RDST. That's what you want when you are the engineer using RDST.

For giving a different audience (a teammate, a non-engineer, an external client) scoped, guarded access, use a data agent with rdst agent mcp --name <agent> instead. That exposes a single, policy-checked interface rather than the whole toolset.

Security considerations

  • Everything runs locally. RDST inherits your shell environment and uses the same configured targets, password environment variables, and LLM API key you would use from the CLI. No data crosses the network except your normal database connection and LLM API calls.
  • Claude Code requires your approval before each tool call by default. Review your Claude Code tool permissions if you want to tighten or loosen this.
  • Tool calls return the same structured analysis output the CLI produces — never raw row data.
  • Actions that change state (deploying Readyset, adding a cache, modifying a guard) always require confirmation before Claude runs them.

Troubleshooting

SymptomLikely causeFix
RDST tools don't appearClaude Code was not restarted after rdst claudeQuit and relaunch Claude Code
Tools appear but do nothingrdst binary on PATH differs between your shell and Claude CodeRe-run rdst claude from the same shell you launch Claude Code from
Tools fail with Authentication failedPassword env var isn't set in Claude Code's shellSet the env var in your shell profile, then relaunch Claude Code
Tools fail with LLM timeoutANTHROPIC_API_KEY missing in Claude Code's environmentExport the key in the shell you launch Claude Code from
rdst claude reports success but tools still missingMultiple Claude installations; config was written to the wrong oneRe-run rdst claude from inside the terminal session you launch Claude Code from

See also

  • Data Agents — for scoped, guarded access patterns vs. full toolset exposure
  • Slack integration — the Slack equivalent for non-Claude users