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 claudeThis 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 removeWhat Claude Code can do with RDST
Once registered, Claude Code has tool access to the core RDST workflows:
| Tool | What Claude can do |
|---|---|
rdst_configure_list / rdst_configure_add | Inspect or add database targets |
rdst_test_connection | Verify a target is reachable |
rdst_top | Find the slowest queries (real-time or historical) |
rdst_query_list / rdst_query_add / rdst_query_delete | Manage saved queries |
rdst_analyze | Analyze a query by hash, name, or inline SQL |
rdst_schema | Inspect the semantic layer |
rdst_audit | Run a single-target audit |
rdst_audit_list / rdst_audit_show | Browse past audit snapshots |
rdst_fleet_list / rdst_fleet_status | List and check the fleet |
rdst_fleet_audit | Run a fleet-wide audit |
rdst_fleet_snapshots / rdst_fleet_diff | Browse and compare fleet snapshots |
rdst_cache_deploy / rdst_cache_add / rdst_cache_show / rdst_cache_delete | Deploy Readyset and manage caches |
rdst_scan | Scan a codebase for ORM queries |
rdst_agent_list / rdst_agent_create / rdst_agent_ask | Manage data agents |
rdst_help | Look 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/recentendpoint has gotten slow over the last week. Find the top queries on theprod-orderstarget, 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 auditonprod-ordersearlier. 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_show → rdst_analyze → rdst_cache_deploy →
rdst_cache_add, asking for confirmation before each deploy step.
Generate SQL from a product question
What does our
status = 3mean for orders? Check the semantic layer viardst_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
| Symptom | Likely cause | Fix |
|---|---|---|
| RDST tools don't appear | Claude Code was not restarted after rdst claude | Quit and relaunch Claude Code |
| Tools appear but do nothing | rdst binary on PATH differs between your shell and Claude Code | Re-run rdst claude from the same shell you launch Claude Code from |
Tools fail with Authentication failed | Password env var isn't set in Claude Code's shell | Set the env var in your shell profile, then relaunch Claude Code |
Tools fail with LLM timeout | ANTHROPIC_API_KEY missing in Claude Code's environment | Export the key in the shell you launch Claude Code from |
rdst claude reports success but tools still missing | Multiple Claude installations; config was written to the wrong one | Re-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