Skip to content
Last updated

Claude Code Integration

Launch Claude Code with Treasure Data's TD LLM Proxy as the backend.

Treasure Data customers can use Claude Code with their existing AI Suite credits — no separate Claude subscription required.

Features

  • Use Your Own TD Subscription - Run Claude Code using AI Suite credits
  • Full Claude Code Features - Extended thinking, plan mode, subagents, and Opus model support
  • TD Documentation Search - AI-powered search across Treasure Data documentation
  • TD Skills Integration - Enhanced with td-skills for writing SQL queries, workflows, and building user segments on CDP

Architecture

Treasure Data

tdx claude

/v1/messages

Anthropic API

Claude Code
• td-skills • td-docs MCP

Local Proxy

TD LLM Proxy

When you run tdx claude:

  1. Starts a local pass-through proxy for TD LLM Proxy
  2. Launches Claude Code with td-skills and td-docs MCP pre-configured
  3. The proxy forwards Claude Code API requests (/v1/messages) to TD's LLM Proxy, which provides Anthropic-compatible API access to Claude models

Usage

tdx claude [options] [-- claude-options]

Options

OptionDescription
-c, --continueContinue most recent conversation
-r, --resumeResume a conversation (shows selector)
--no-proxyUse your own Claude Code account (Anthropic/AWS Bedrock/Vertex AI, etc.)

Examples

# Launch Claude Code with TD LLM Proxy
tdx claude

# Continue most recent conversation
tdx claude -c

# Resume a conversation (shows selector)
tdx claude -r

# Start with an initial prompt
tdx claude -- "Explain this code"

# Use your own Claude Code account with TD skills
tdx claude --no-proxy

Example Conversations

Once inside Claude Code, you can ask questions like:

> How to set up data ingestion to TD from Snowflake?

> How to add web access log collector in my web page?

> Analyze mydb.user_events data

> Write a workflow to periodically import data from S3

> Create a SQL query to find top customers by revenue

> Build a user segment for customers who purchased in the last 30 days

Requirements

Install Claude Code

See the Claude Code Quick Start for installation instructions.

curl -fsSL https://claude.ai/install.sh | bash
Minimum Version

Claude Code 2.0.20 or later is required for td-skills support. Update with:

claude update

Other Requirements

  • Valid TD API key with LLM access

Subcommands

usage

Show AI Suite credit consumption statistics by profile.

tdx claude usage [options]
OptionDescription
--jsonOutput as JSON
--jsonlOutput as JSON Lines

Example:

# Display credit usage by profile
tdx claude usage

# JSON output for programmatic access
tdx claude usage --json

Output:

AI Suite Credit Usage Summary
──────────────────────────────────────────────────
  Today:   0.24 credits
  Month:   2.15 credits
  Total:   10.45 credits

Usage by Profile
────────────────────────────────────────────────────────────
  Profile          Credits    Requests  Last Used
  (default)           8.23         245  today 10:30 AM
  production          2.22          30  yesterday

Note: Credit values are estimates based on token usage.

statusline

Output credit usage for Claude Code's status bar. This is automatically configured when running tdx claude. See Claude Code Statusline Documentation for more details.

tdx claude statusline

Reads session info from stdin (JSON with session_id and model) and outputs a formatted statusline.

When using --profile, the statusline shows profile-specific today/month credits:

tdx --profile myprofile claude

Output:

🤖 tdx - Sonnet 4.5 | 🪙 credit: 0.12 session / 1.23 today / 10.45 month | 🧠 22,396 (11%)

The statusline shows:

  • Current model name
  • Session / Today / Month credits (estimates, filtered by profile when specified)
  • Context memory usage

Learn More

For generic Claude Code usage, refer to the official documentation: