Files
WrenAI/docs/core/guides/use-with-agents/claude-code.md
T
Pin Hsu Chen e0977fb131 docs(core): restructure OSS docs around context-layer narrative (#2285)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-15 17:51:56 +08:00

2.0 KiB

Use with Claude Code

Wren AI is designed to work as Claude Code's grounding layer for any database it needs to query. With the Wren skills installed, Claude Code stops guessing about your schema — it discovers tables, looks up canonical models, recalls similar past queries, and generates SQL through the semantic layer.

Prerequisites

Install the Wren skills

npx skills add Canner/WrenAI --skill '*'

Or via the install script:

curl -fsSL https://raw.githubusercontent.com/Canner/WrenAI/main/skills/install.sh | bash

The CLI auto-detects Claude Code. If you have multiple agents installed and want to target Claude Code specifically:

npx skills add Canner/WrenAI --skill '*' --agent claude-code

What each skill does

Skill When to use
wren-generate-mdl One-time setup — explore a new database and write the initial MDL project.
wren-usage Day-to-day querying — fetch context, recall similar queries, write and execute SQL, store the result for future recall.
wren-onboarding First-time install — set up the environment, scaffold a project, run a first query.
wren-dlt-connector Connect a SaaS data source via dlt and scaffold a Wren project from the loaded data.

Typical workflow

  1. Open Claude Code in your Wren project directorycd ~/my-wren-project && claude

  2. Ask a question in natural language:

    How many customers placed more than one order this month?
    
  3. Claude Code uses wren-usage to fetch context, recall examples, write SQL, execute via wren --sql "...", and store the result.

Tips

  • Re-run wren memory index after editing instructions.md or model descriptions so the new content is searchable.
  • If Claude Code picks the wrong table, add a ## Canonical tables section to instructions.md and rebuild.