mage2kishan / magento2-claude-ai
Magento 2 Automation with Claude AI — natural-language store management. Update prices, query catalog, surface insights, all by asking in plain English. Powered by Anthropic's Claude API with tool use.
Package info
github.com/mage2sk/magento2-claude-ai
Type:magento2-module
pkg:composer/mage2kishan/magento2-claude-ai
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0
- mage2kishan/module-core: ^1.0
- magento/framework: ^103.0
- magento/module-backend: ^102.0
- magento/module-catalog: ^104.0
- magento/module-config: ^101.0
- magento/module-customer: ^103.0
- magento/module-sales: ^103.0
- magento/module-store: ^101.0
- magento/module-ui: ^101.0
README
Magento 2 Claude AI Automation: Manage Your Store in Plain English (Hyva + Luma)
Stop clicking through 12 admin screens. Just ask. Type what you want in plain English - the AI runs the right Magento operation, previews the change, and lets you undo it with one click.
Product page: kishansavaliya.com/magento-2-claude-ai.html
Quick Answer
What is Panth Claude AI Automation? It is a Magento 2 module that puts an AI chat interface inside the admin. You type a plain-English instruction and the AI runs the correct Magento operations - updating prices, managing products, querying orders, editing CMS content, and more.
What does it add to my store?
- An AI chat panel in the admin where you type plain-English commands.
- 19 tools covering products, inventory, prices, categories, CMS pages, CMS blocks, customers, orders, store config, store logo, modules, read-only SQL, cache, reindex, and undo.
- Dry-run mode (on by default) so new installs preview every change before touching data.
- One-click undo via checkpoints that snapshot state before every bulk write.
- A storefront Shop Assistant widget that lets shoppers ask product questions.
Which themes are supported? Both Hyva (Alpine.js) and Luma. The widget ships a template for each, and the admin chat is theme-independent.
What does it need? Magento 2.4.4 to 2.4.8, PHP 8.1 to 8.4, mage2kishan/module-core, and an Anthropic API key (free $5 credit on new accounts).
How much does it cost per question? With prompt caching, a typical question costs about $0.01 on Opus 4.7, $0.003 on Sonnet 4.6, or $0.0006 on Haiku 4.5.
Need Custom Magento 2 + AI Development?
Get a free quote for your project in 24 hours for Claude / OpenAI / Gemini integrations, custom modules, Hyva themes, performance work, M1 to M2 migrations, and Adobe Commerce Cloud.
Visit our website: kishansavaliya.com | Get a quote: kishansavaliya.com/get-quote
Table of Contents
- Who Is It For
- Key Features
- Screenshots
- Compatibility
- Installation
- Configuration
- How It Works
- Tool Catalog
- Safety and Undo
- Training Examples
- Conversation History
- Storefront Shop Assistant Widget
- FAQ
- Support
- About Panth Infotech
- Quick Links
Who Is It For
- Merchants who spend hours on repetitive admin tasks like bulk price changes, disabling out-of-stock items, or writing meta descriptions for dozens of products. Type it once, the AI handles the rest.
- Store owners who are not technical and find Magento's admin hard to navigate. Plain English replaces grid filters, mass actions, and config forms.
- Developers and agencies who want a fast way to query catalog data, inspect config, or run diagnostics without writing SQL by hand.
- Hyva storefronts that want a read-only shop assistant chatbot built with Alpine.js, with no jQuery added back in.
- Compliance-aware teams who need a full audit trail of every AI action, including which admin user ran what, when, and with what result.
Key Features
Plain-English Admin Chat
- Type what you want in plain English - the AI translates it into Magento operations.
- Multi-turn conversations that remember context across a session, so follow-up questions work naturally.
- File attachments in chat - images, PDFs, spreadsheets - all hardened with extension + MIME + magic-byte checks and a 10 MB cap.
- Admin Dashboard widget so you can run quick queries without leaving your home screen.
19 Tools, Full Magento Depth
- Products: search, create, update, bulk price changes, bulk status changes.
- Inventory: adjust stock quantities absolutely or by delta, set in-stock flags.
- Categories: create, update, show tree with product counts.
- CMS pages and CMS blocks: create, update, search-and-replace inside content.
- Customers: search by email or name, view spend totals and order counts.
- Orders: search, filter by status or date range, hold, cancel, add comment.
- Store config: update whitelisted config paths (store name, address, email senders, locale).
- Store logo: upload a chat-attached image and apply it as the store header logo.
- Insights: order KPIs, average order value, customer counts, sales comparisons.
- Modules: list installed third-party modules and their versions.
- Database queries: read-only SELECT / SHOW / EXPLAIN - write statements are rejected at parser level.
- Cache and reindex: flush specific cache types or run specific indexers.
- Undo: restore any prior bulk write by checkpoint ID.
Dry-Run and Safety Layers
- Dry-run mode is on by default for new installs. The AI shows what it would change without touching data.
- Confirmation gate requires an explicit "yes" before any write that touches more than your threshold (default 5 items).
- Bulk-write hard cap (default 500) stops accidental whole-catalog mutations even if confirmation is off.
- Auto-checkpoint before every destructive write so one-click or voice undo is always available.
- Per-tool toggles let you remove any tool from the AI's catalog entirely - a disabled tool is invisible to the model.
Checkpoints and Undo
- Every bulk write snapshots before-state into
panth_claudeai_checkpointbefore mutating. - Restore from the Checkpoints grid in admin, or just type "undo" in chat.
- Checkpoint retention is configurable and auto-pruned by nightly cron.
Training Examples
- Teach the AI your store's conventions with few-shot examples: your slang, pricing rules, refusal patterns.
- 11 starter examples seeded on install covering pricing, inventory, refusal patterns, sales insights, and category management.
- Injected as cached system content so examples never blow out your context window.
Conversation History and Activity Log
- Full transcript history with every turn, tool call, token count, and cost per conversation.
- Activity log captures every prompt, tool execution, and reply with microsecond timing.
- Export to CSV from the Conversations and Activity Log grids for compliance or cost reporting.
Storefront Shop Assistant Widget
- Read-only chatbot for shoppers - answers product and store questions in plain English.
- Drop in via layout XML or the CMS Widgets tool - works on any page.
- Wired to a read-only tool catalog via DI virtualType, so writes are unreachable from the storefront.
- Per-IP rate limited to prevent abuse.
Prompt Caching Cuts Costs
- System prompt + tool catalog + training examples are sent as a single cached block to Anthropic.
- Cache stays warm for 5 minutes - repeat questions in the same session cost about 10% of the first one.
- Token accounting in the Activity Log shows cache hits vs full-price requests.
Built to Last
- Clean, MEQP-style code with constructor dependency injection only, no ObjectManager.
- CLI commands:
panth_claudeai:statusandpanth_claudeai:test-api. - Nightly cron prunes old activity rows and expired checkpoints.
- No outbound traffic except to
api.anthropic.com- auditable in your egress firewall. - MIT licence - free for commercial use, full source on GitHub.
Screenshots
Admin sidebar - one menu, seven workflows
AI Dashboard - KPIs, quick actions, recent activity
Ask Claude - the chat surface
| Empty state | Live conversation | Category tree response | Product creation with checkpoint |
|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
How to Use - 6-step plain-English onboarding
Training Examples - teach Claude your store's conventions
| Examples grid | Edit form |
|---|---|
![]() |
![]() |
Conversations - full transcript history
| Conversations grid | Single conversation transcript |
|---|---|
![]() |
![]() |
Activity Log - every prompt, tool call, and reply
Checkpoints and Restore - one-click undo
Dashboard widget - Store Assistant on the admin landing page
Configuration - 5 groups, 25+ options
| API Credentials + General | Safety |
|---|---|
![]() |
![]() |
| Tool Capabilities (per-tool toggles) | Logging and Retention |
|---|---|
![]() |
![]() |
Compatibility
| Requirement | Versions Supported |
|---|---|
| Magento Open Source | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce | 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8 |
| Adobe Commerce Cloud | 2.4.4 to 2.4.8 |
| PHP | 8.1.x, 8.2.x, 8.3.x, 8.4.x |
| MySQL | 8.0+ |
| MariaDB | 10.4+ |
| Search Engine | Elasticsearch 7/8, OpenSearch 1/2 |
| Hyva Theme | 1.3+ |
| Luma Theme | Native support |
| Anthropic API | Claude Opus 4.7, Sonnet 4.6, Haiku 4.5 |
| Required Dependency | mage2kishan/module-core (free) |
Installation
Composer Installation (Recommended)
composer require mage2kishan/magento2-claude-ai bin/magento module:enable Panth_Core Panth_ClaudeAi bin/magento setup:upgrade bin/magento setup:di:compile bin/magento setup:static-content:deploy -f bin/magento cache:flush
Then open Stores -> Configuration -> Panth Extensions -> Claude AI -- Magento Automation and paste your Anthropic API key. Get one at console.anthropic.com - new accounts get $5 free credit.
Manual Installation via ZIP
- Download the latest release from Packagist or from the product page.
- Extract to
app/code/Panth/ClaudeAi/in your Magento install. - Make sure
Panth_Coreis installed too (required dependency). - Run the commands above starting from
bin/magento module:enable.
Verify Installation
bin/magento module:status Panth_ClaudeAi # Expected: Module is enabled bin/magento panth_claudeai:test-api # Expected: Round-trip OK - model=claude-opus-4-7 - cached=Y - latency=...
After install, open:
Admin -> Panth Infotech -> Claude AI Automation -> Ask Claude
Configuration
Go to Stores -> Configuration -> Panth Extensions -> Claude AI -- Magento Automation.
Group 1: API Credentials
| Setting | Default | Description |
|---|---|---|
| Anthropic API Key | (empty) | Required. Stored encrypted. Starts with sk-ant-api.... Get one at console.anthropic.com. |
Group 2: General Settings
| Setting | Default | Description |
|---|---|---|
| Enable Module (Master Switch) | Yes | Turns off everything - admin chat, launcher, and tools. |
| Claude Model | Opus 4.7 | Opus 4.7 = most capable. Sonnet 4.6 = faster and cheaper. Haiku 4.5 = fastest. |
| Effort Level | High | How hard the AI thinks before replying. High is recommended. |
| Max Output Tokens per Reply | 15000 | Maximum tokens the AI can produce in one reply. |
| Max Tool Calls per Question | 8 | How many chained actions the AI may run per question before stopping. |
| API Timeout (seconds) | 120 | Raise to 180 if you see timeouts on long Opus 4.7 responses. |
Group 3: Safety
| Setting | Default | Description |
|---|---|---|
| Dry Run Mode | Yes | When on, the AI shows what it would change without touching data. Turn off when ready. |
| Max Items per Bulk Action | 500 | Hard cap. The AI refuses a write that would touch more items than this. |
| Admin Rate Limit (questions/hour) | 60 | Stops accidental loops from burning API credit. |
| Require Confirmation Before Writes | Yes | The AI previews count + sample names and waits for "yes" before running a bulk write. |
| Confirmation Threshold | 5 | Writes affecting fewer items than this run without the confirmation pause. |
Group 4: Tool Capabilities
Each of the 19 tools has its own toggle. A disabled tool is removed from the API catalog at request time - the AI cannot call something it cannot see.
| Tool Toggle | What it controls |
|---|---|
| Search products | get_products - find by SKU, name, price range, type, status |
| Create / update / clone products | manage_products - full product writes |
| Update product prices | update_product_price - bulk price changes (fixed or percent) |
| Enable / disable products | update_product_status - bulk status changes |
| Adjust stock quantities | update_inventory - set qty, in-stock flag |
| Customer search and lookup | customers - read-only, never returns passwords |
| Order management | orders - search, hold, cancel, comment |
| Manage categories | manage_categories - create, update, tree, assign products |
| Manage CMS pages | manage_cms_pages - list, get, create, update |
| Manage CMS blocks | manage_cms_blocks - list, get, create, update |
| Read-only database query | database_query - SELECT / SHOW / EXPLAIN only, writes rejected |
| Customer and order insights | store_insights - aggregated KPIs |
| List installed modules | get_modules - read-only |
| Find low-stock products | low_stock - products at or below a threshold |
| Read store info | store_info - currency, country, base URL, versions |
| Write store config | update_config - allowlisted paths only (name, address, email senders, locale) |
| Set storefront header logo | set_store_logo - applies a chat-attached image as the store logo |
| Flush caches and reindex | cache_reindex - specific cache types or indexers |
| Undo / restore checkpoints | restore_checkpoint - revert any prior bulk write |
Group 6: Logging and Retention
| Setting | Default | Description |
|---|---|---|
| Enable Activity Log | Yes | Records every prompt, tool call, and reply with token counts and cost. |
| Activity Retention (days) | 90 | Older activity rows are auto-pruned by daily cron. |
| Checkpoint Retention (days) | 30 | Older un-restored checkpoints are auto-pruned. |
| Write to var/log/panth_claudeai.log | Yes | Useful for ops and grep-friendly diagnostics. |
How It Works
Admin types: "Make all t-shirts $24.99"
|
[ Send AJAX -> /panth_claudeai/chat/send ]
|
Orchestrator (manual tool-use loop)
|- Inject system prompt + training examples + tool catalog
| (flagged cache_control = ephemeral for Anthropic prompt caching)
|- Send to Anthropic /v1/messages
|- stop_reason == tool_use ?
| yes -> execute tool locally (snapshot before-state if write)
| append tool_result, repeat (max N iterations, configurable)
| no -> final text reply
+- Log every step into panth_claudeai_activity (tokens, ms, cost)
|
Admin sees: "Updated 42 t-shirts to $24.99. Reply 'undo' to revert."
The orchestrator is a manual tool-use loop, not a wrapper around Anthropic's auto-handler. This gives per-step logging, dry-run interception, confirmation gating, and graceful degradation when a tool throws.
Every write tool snapshots minimum before-state (e.g. old price per SKU) into panth_claudeai_checkpoint before mutating. Cleanup cron auto-prunes old checkpoints based on your retention setting.
Tool Catalog
Each tool can be enabled or disabled individually in Configuration -> Tool Capabilities. A disabled tool is removed from the API catalog at request time - the model cannot call it.
| # | Tool | Scope | What it does |
|---|---|---|---|
| 1 | get_products |
Read | Search by SKU pattern, name, price range, type, status, visibility |
| 2 | update_product_price |
Write | Bulk update prices (fixed or percent), with checkpoint |
| 3 | update_product_status |
Write | Enable / disable products in bulk, with checkpoint |
| 4 | update_inventory |
Write | Set stock qty (absolute or delta) + in-stock flag, with checkpoint |
| 5 | manage_products |
Write | Create / update / delete simple, configurable, virtual, downloadable products |
| 6 | low_stock |
Read | Find products at or below a stock threshold |
| 7 | manage_categories |
Write | Create / update categories; show tree with depth + product counts |
| 8 | manage_cms_pages |
Write | Create / update CMS pages; search-and-replace inside content |
| 9 | manage_cms_blocks |
Write | Create / update CMS static blocks |
| 10 | customers |
Read | Search by email/name, spend totals, order counts, address summaries |
| 11 | orders |
Read/Write | Search orders by status, date, customer email; hold, cancel, comment |
| 12 | store_insights |
Read | Customer count, order count by status, average order value, KPIs |
| 13 | store_info |
Read | Currency, country, base URL, Magento + module versions |
| 14 | get_modules |
Read | Lists installed third-party modules, versions, enabled state |
| 15 | database_query |
Read | Read-only SELECT / SHOW / EXPLAIN. Write SQL blocked at parser level. |
| 16 | cache_reindex |
Write | Flush specific cache types, run specific indexers |
| 17 | update_config |
Write | Update core_config_data (allowlisted paths only) - checkpointed |
| 18 | set_store_logo |
Write | Upload + apply store logo from chat-attached file - checkpointed |
| 19 | restore_checkpoint |
Write | Undo any prior bulk write by checkpoint ID |
Safety and Undo
The module uses six layers of protection. Even if one layer is turned off, the next one catches it.
Layer 1 - Dry-Run mode (default ON). Every write tool shows what would change (count + sample) without touching data. New installs ship with this on.
Layer 2 - Confirmation gate. Any write affecting more than your threshold (default 5 items) makes the AI pause and ask for explicit "yes" / "go ahead" before proceeding.
Layer 3 - Bulk-write hard cap. Every write tool checks Max Items per Bulk Action (default 500) before running. If the query would touch more, the tool refuses.
Layer 4 - Auto-checkpoint. Even when layers 1-3 are bypassed, every write tool snapshots the affected rows' before-state into panth_claudeai_checkpoint before mutating. One-click restore from the Checkpoints grid, or just type "undo" in chat.
Layer 5 - Per-tool master switch. Disable any tool in Tool Capabilities and it vanishes from the API catalog. The AI cannot call something it cannot see.
Layer 6 - Read-only storefront catalog. The storefront widget is wired to a separate DI virtualType that only registers get_products + store_info. Writes are unreachable from the storefront.
Training Examples
Go to Panth Infotech -> Claude AI Automation -> Training Examples to teach Claude your store's conventions.
You can add examples like:
- Store slang - "sweats" means hoodies and sweatpants in our catalog.
- Refusal patterns - "never delete products, always disable instead."
- Pricing conventions - "Black Friday discount = 30% off applied to RRP, not current price."
- Inventory rules - "low stock means qty < 5, not the Magento default of 1."
Each example has a Title, "Merchant says" field, "Expected outcome" field, Category, Sort Order, and Status. Active examples are injected as cached system content before every conversation - they participate in prompt caching and cost very little after the first request.
The module ships 11 starter examples seeded by Setup/Patch/Data/SeedTrainingExamples.php, covering pricing, inventory, refusal patterns, sales insights, and category management.
Conversation History
Open Panth Infotech -> Claude AI Automation -> Conversations to see every chat thread.
The grid shows Started / Last activity, First prompt, Turn count, File attachment count, Total tokens (input + output), Total cost in USD, and Surface (admin or storefront).
Click any row to open the full transcript with every user turn, assistant reply, and tool call expanded - useful for compliance reviews ("who changed prices on Tuesday?") and cost reporting.
Storefront Shop Assistant Widget
A read-only chatbot for your shoppers. It answers product and store questions in plain English. Writes are unreachable - the widget's tool catalog is restricted to get_products + store_info via a DI virtualType.
Add via layout XML:
<block class="Panth\ClaudeAi\Block\Widget\ShopAssistant" name="shop.assistant" before="-"> <arguments> <argument name="title" xsi:type="string">Need help finding something?</argument> <argument name="position" xsi:type="string">floating</argument> <argument name="primary_color" xsi:type="string">#5B5BD6</argument> <argument name="welcome" xsi:type="string">Hi! I can help you find products, check stock, or compare options.</argument> </arguments> </block>
Or add it as a CMS Widget via Content -> Widgets -> New. The same block also renders in the admin Dashboard for quick queries without leaving the home screen.
FAQ
Is this safe to run on a production store?
Yes - that is the whole point of the safety stack. Dry-run is on by default, every write is checkpointed and reversible in one click, bulk writes are hard-capped at 500, and confirmation is required for anything above your threshold. Running in dry-run mode for the first week on production before switching it off is a sensible practice.
Which Claude model should I pick?
- Opus 4.7 - most capable, best for complex multi-step tasks ("find slow movers in Sale category that haven't been discounted, then bulk-apply 20% off"). About $0.01/question with caching.
- Sonnet 4.6 - nearly as capable at about a third of the price. A good default for most stores. About $0.003/question.
- Haiku 4.5 - fastest and cheapest. Good for simple lookups and the storefront widget. About $0.0006/question.
You can change the model in Configuration without restarting. The next request uses the new model.
Does it work on Hyva themes?
Yes. The admin chat is theme-independent. The storefront widget ships both a Luma (Knockout) template and a Hyva (Alpine.js + Tailwind) template, picked automatically based on the active frontend theme.
Does it support multi-store setups?
Yes. Tools that write scoped data (update_config, manage_cms_pages, manage_cms_blocks, set_store_logo) accept a scope and scope_id parameter the AI fills in from your prompt. "Set the page title suffix for store view es-mx to ' | Acme Mexico'" works.
Can I prevent the AI from editing prices?
Yes, three ways. (1) Disable update_product_price in Tool Capabilities. (2) Remove the Panth_ClaudeAi::price ACL resource from the relevant admin role. (3) Add a refusal training example: "never change prices without explicit confirmation."
Does it call anything except api.anthropic.com?
No. Single egress endpoint. Allowlist api.anthropic.com:443 in your firewall and you are done.
How does prompt caching work?
The system prompt + tool catalog + active training examples are sent as a single block flagged with cache_control: { type: "ephemeral" }. Anthropic stores it server-side for 5 minutes. Any request within that window gets about 90% off the cached portion. The Activity Log shows cache_read_tokens so you can verify cache hits.
Can I export conversations for compliance?
Yes. The Conversations grid and Activity Log grid both have Export to CSV. For programmatic access, query panth_claudeai_activity and panth_claudeai_message directly - both have created_at indexes.
What happens if Anthropic is down?
The chat returns a clear error, the activity row is logged with status=error, and the orchestrator does not retry indefinitely. Default timeout is 120 seconds. Your store is unaffected - the module is purely additive.
Support
| Channel | Contact |
|---|---|
| Product Page | kishansavaliya.com/magento-2-claude-ai.html |
| kishansavaliyakb@gmail.com | |
| Website | kishansavaliya.com |
| +91 84012 70422 | |
| GitHub Issues | github.com/mage2sk/magento2-claude-ai/issues |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
Response time: 1-2 business days.
Need Custom Magento Development?
Looking for custom Claude / OpenAI integration, Hyva theme work, store migrations, or performance tuning? Get a free quote in 24 hours:
About Panth Infotech
Built and maintained by Kishan Savaliya (kishansavaliya.com), a Top Rated Plus Magento developer on Upwork with 10+ years of eCommerce experience.
Panth Infotech is a Magento 2 development agency that builds high quality, security focused extensions and themes for both Hyva and Luma storefronts. The extension suite covers SEO, performance, checkout, product presentation, customer engagement, store management, and AI automation - with each module built to MEQP standards and tested across Magento 2.4.4 to 2.4.8.
Browse the full extension catalog on our Magento extensions page or on Packagist.
Quick Links
| Resource | Link |
|---|---|
| Product Page | magento-2-claude-ai.html |
| Packagist | mage2kishan/magento2-claude-ai |
| GitHub | mage2sk/magento2-claude-ai |
| Website | kishansavaliya.com |
| Free Quote | kishansavaliya.com/get-quote |
| Upwork (Top Rated Plus) | Hire Kishan Savaliya |
| Upwork Agency | Panth Infotech |
| kishansavaliyakb@gmail.com | |
| +91 84012 70422 |
Ready to manage your Magento store in plain English?
SEO Keywords: magento 2 claude ai, magento 2 anthropic api, magento 2 ai automation, magento 2 ai assistant, magento 2 natural language admin, magento 2 conversational commerce, magento 2 ai chatbot, magento 2 ai shop assistant, magento 2 ai widget, magento 2 ai bulk update, magento 2 ai pricing, magento 2 ai inventory, magento 2 ai cms, magento 2 ai orders, magento 2 ai customers, magento 2 ai dashboard, magento 2 ai sales insights, magento 2 ai extension, magento 2 ai module, magento 2 ai integration, hyva claude ai, luma claude ai, magento 2 ai checkpoint undo, magento 2 ai dry run, magento 2 ai content generation, magento 2 ai meta description, magento 2 chatgpt alternative, magento 2 store manager ai, claude opus 4.7 magento, claude sonnet 4.6 magento, claude haiku 4.5 magento, anthropic api magento, prompt caching magento, tool use magento, magento 2 ai backend, magento 2 ai admin, magento 2 ai bulk product update, magento 2.4.8 ai module, php 8.4 magento ai, panth claude ai, panth infotech, mage2kishan, kishan savaliya, top rated plus upwork magento, hire magento ai developer, custom ai magento development, magento 2 hyva development, adobe commerce cloud ai, ai ecommerce magento, panth extensions

















