Blog
Technical8 min read

Setting Up Claude Code for Shopify Development

DH
Dennis Hegstad
Founder, sonarID · April 30, 2026
Setting Up Claude Code for Shopify Development

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:

  • Write code in natural language (Claude writes it for you)
  • Debug code with AI assistance
  • Refactor and optimize existing code
  • Generate tests automatically
  • Set up boilerplate in seconds
  • ## 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:

  • Open VS Code
  • Go to Extensions (Ctrl+Shift+X)
  • Search "Claude Code"
  • Click Install
  • Restart VS Code
  • 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:

  • Displays customer VIP scores
  • Allows bulk tagging of influencers
  • Shows order history and LTV for each customer
  • Uses Node.js with Express backend
  • Include authentication with Shopify OAuth.

    ```

    Claude Code will generate:

  • Backend API routes
  • Frontend React components
  • Authentication middleware
  • Error handling
  • ### 2. Build a Liquid Theme Component

    ```

    Create a Liquid component for displaying influencer badges on the checkout page.

    The component should:

  • Show a "VIP Influencer" badge if the customer is tagged as influencer
  • Display their follower count if available
  • Have a subtle gradient background
  • Be mobile responsive
  • 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:

  • Triggers when a new order comes in
  • Checks if the customer is a known influencer
  • Sends a special gift if they are
  • Logs the event to our analytics
  • 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:

  • Happy path (influencer found, gift sent)
  • Edge case (influencer not found)
  • Error handling (API failure)
  • Retry logic
  • ```

    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:

  • "Add error handling"
  • "Make this more TypeScript strict"
  • "Optimize the database query"
  • ### 3. Review Generated Code

    Claude is excellent but not infallible. Always:

  • Review security implications (especially for OAuth)
  • Check API usage (respect Shopify rate limits)
  • Test with your Shopify dev store first
  • ### 4. Use for Boilerplate, not Complex Logic

    Claude excels at:

  • API route boilerplate
  • Component scaffolding
  • Test generation
  • Configuration files
  • Claude is less reliable for:

  • Complex business logic
  • Intricate database schemas
  • Performance-critical code (needs benchmarking)
  • ## Connecting Claude Code to SonarID

    At SonarID, we use Claude Code for:

  • Inngest functions: Write influencer detection workflows in seconds
  • Admin apps: Build dashboards to visualize VIP customers
  • Theme customization: Generate Liquid components for customer display
  • Automation: Write scripts for data export and analysis
  • 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?

    [Try Claude Code free] or [Start building with SonarID]

    Ready to know who is buying from you?

    Start identifying VIP customers, influencers, and notable figures in your order stream — automatically.

    Start detecting VIPs
    End
    DH
    Written by
    Dennis Hegstad
    Founder, sonarID