AI Agent Integration

rdc-cli is designed from the ground up for AI agent consumption — not just human users. Every command outputs machine-parseable TSV or JSON, and the VFS path system lets agents explore captures without memorizing command arguments.

Claude Code Skill

rdc-cli ships with a built-in Claude Code skill. After installing, Claude Code auto-discovers rdc-cli commands and can open, inspect, and debug GPU captures on your behalf.

rdc install-skill

This copies skill definition files to ~/.claude/skills/rdc-cli/. Once installed, Claude Code recognizes trigger phrases like:

  • "open capture", ".rdc", "renderdoc"
  • "shader debug", "pixel trace"
  • "GPU state", "draw calls", "pipeline"

Why Skill, Not MCP?

rdc-cli deliberately uses a Claude Code skill (a prompt file that teaches the agent CLI usage) rather than an MCP server. Here's why:

  • Not universal -- MCP is tied to specific AI clients that implement the protocol. A CLI skill works with any agent that can execute shell commands.
  • Cannot run in CI -- MCP requires a persistent server process and a compatible client. CI pipelines need plain CLI commands, not RPC connections.
  • Context window bloat -- MCP returns full tool schemas and large structured payloads that fill the agent's context window. CLI output is compact text -- pipe through grep or jq to extract only what matters.
  • No Unix pipe composability -- MCP is an RPC protocol; results don't flow through stdout. You cannot rdc draws | grep Triangle | wc -l with MCP. The entire Unix tool ecosystem is lost.
  • Skill = thin CLI wrapper -- A skill is just a prompt that teaches the agent to use the CLI. Zero infrastructure, zero dependencies, full pipe composability, works in CI, works with any AI that has shell access.

Agent-Friendly Design

VFS Path Navigation

The virtual filesystem lets agents explore capture structure iteratively. Start broad with rdc ls / and drill down into specific draws, shaders, and state — no need to know the exact command for each query.

Machine-Parseable Output

TSV output works with standard Unix tools. --json output works with jq and any JSON parser. Metadata goes to stderr so stdout is always clean data.

Stable Paths

Every piece of data has a deterministic path like /draws/142/shader/ps. Paths are stable across sessions, so agents can build reliable scripts.

A typical agent session follows this pattern:

# Open the capture
rdc open capture.rdc

# Discover structure
rdc ls /

# Find draw calls
rdc draws

# Explore a specific draw
rdc ls /draws/142/

# Read shader source
rdc cat /draws/142/shader/ps

# Check constant buffer values
rdc shader 142 ps --constants

# Done
rdc close

System Prompt Snippet

If you are building a custom AI agent that uses rdc-cli, include this context in your system prompt:

You have access to rdc-cli, a Unix CLI for RenderDoc .rdc captures.

Key commands:
- rdc open <file.rdc>   Open a capture (starts daemon)
- rdc ls [PATH]          Browse capture via VFS paths
- rdc cat <PATH>         Read VFS leaf content
- rdc draws              List draw calls
- rdc pipeline <EID>     Show GPU pipeline state
- rdc shader <EID> <STAGE> --source   Read shader code
- rdc debug pixel <EID> <X> <Y>      Debug pixel shader
- rdc close              Close session

All commands support --json for structured output.
VFS root: / (explore with ls, drill down with cat)
Paths: /draws/<EID>/, /resources/<ID>/, /passes/<N>/

Tips for Agent Developers

  • Always use --json when parsing output programmatically
  • Use rdc count draws to get counts without parsing lists
  • Check rdc status before commands to verify a session is open
  • Use rdc doctor to verify the environment is configured correctly
  • The rdc script command runs arbitrary Python inside the daemon for advanced queries