Skip to content

Claude Code Integration

Launch Claude Code with Treasure Data's AI Foundry 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
  • 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

EXPERIMENTAL FEATURE

This integration is experimental. Known limitations:

  • No extended thinking/reasoning support
  • No sub-agent support
  • Tool calls may occasionally fail
  • Context may be lost in long-running sessions

Usage

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

Options

OptionDescriptionDefault
--model <name>Model to use (haiku, sonnet)sonnet
-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

bash
# Launch Claude Code with default model (sonnet)
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.

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

Other Requirements

  • Valid TD API key with LLM access
  • An LLM project configured in Treasure Data

Subcommands

usage

Show AI Suite credit consumption statistics by profile.

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

Example:

bash
# 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.

bash
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:

bash
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: