Claude Code brings AI-assisted development to Shopify projects. Build themes, apps, and automations faster by having Claude write, review, and optimize your code in real-time.
## What is Claude Code?
Claude Code is Anthropic's CLI tool for VS Code that lets you:
## Installation: Get Claude Code Running
### Step 1: Install Claude Code CLI
```bash
npm install -g @claude-ai/claude-code
```
Or via Homebrew:
```bash
brew install claude-code
```
### Step 2: Authenticate with Claude
```bash
claude-code login
```
This opens your browser to authenticate. You'll need a Claude.ai account with API access.
### Step 3: Set Up VS Code Integration
Install the Claude Code extension from VS Code marketplace:
You're now ready to use Claude Code!
## Setting Up for Shopify Development
### Initialize Your Shopify Project
```bash
shopify app create node
# or for themes:
shopify theme init my-theme
cd my-theme
```
### Add Claude Code to Your Project
```bash
claude-code init
```
This creates a `.claude` directory with settings for your project.
### Configure for Shopify
Edit `.claude/settings.json`:
```json
{
"model": "claude-opus",
"temperature": 0.7,
"context": [
"shopify-api",
"liquid-templating",
"node-express"
],
"ignore_patterns": [
"node_modules/**",
".shopify-app/",
"dist/**"
]
}
```
## Common Shopify Tasks with Claude Code
### 1. Generate a Custom Admin App
Open the command palette (Cmd+Shift+P) and type "Claude Code":
```
Create a Shopify admin app that:
Include authentication with Shopify OAuth.
```
Claude Code will generate:
### 2. Build a Liquid Theme Component
```
Create a Liquid component for displaying influencer badges on the checkout page.
The component should:
Include CSS styling and any required JavaScript.
```
Claude Code generates the theme component ready to drop into your theme.
### 3. Write an Inngest Workflow
```
Create an Inngest function that:
Use TypeScript and include error handling.
```
Claude Code writes your function with proper Inngest patterns.
### 4. Generate Test Files
```
Create Jest tests for this function: [paste your function]
Test should cover:
```
Claude Code generates full test suite.
## Using Claude Code with Your Terminal
### Ask Claude to Write Scripts
```bash
claude-code generate "Write a script that exports all orders from Shopify with customer influencer tags to a CSV file"
```
Claude Code generates a working Node.js script.
### Debug Code with Claude
```bash
claude-code debug src/api/routes.ts
```
This analyzes your code and suggests improvements.
### Refactor for Performance
```bash
claude-code refactor src/services/influencer-detection.ts --goal "optimize for speed"
```
Claude Code refactors with performance in mind.
## Best Practices for Claude Code + Shopify
### 1. Provide Context
Always include relevant Shopify API docs or example code when asking Claude to generate something.
### 2. Iterate, Don't Perfect First Try
Ask Claude to generate first, then ask for improvements:
### 3. Review Generated Code
Claude is excellent but not infallible. Always:
### 4. Use for Boilerplate, not Complex Logic
Claude excels at:
Claude is less reliable for:
## Connecting Claude Code to SonarID
At SonarID, we use Claude Code for:
Example workflow:
```
Claude Code generates an Inngest function → We test it in dev → Deploy to production → SonarID monitors performance
```
## Troubleshooting
### "Claude API key not set"
```bash
claude-code login
```
### "Function not recognized in Shopify CLI"
Update your Shopify CLI:
```bash
shopify upgrade
```
### "Generated code has issues"
Ask Claude Code to fix it:
```bash
claude-code debug [file] --fix
```
## Next Steps
1. Install Claude Code and authenticate
2. Start with simple tasks: Generate a test file, create a component
3. Work up to complex features: Admin apps, Inngest workflows
4. Integrate into your workflow: Use Claude Code as your development assistant
Claude Code won't replace developers, but it will make you 2-3x faster at writing boilerplate and scaffolding new features.
---
## Building smarter with Claude Code
At SonarID, we use Claude Code to build influencer detection and customer intelligence features faster. The combination of Claude's code generation + Shopify's API is powerful.
Ready to build your next Shopify feature?