Magento 2 Automation with Claude AI
A free admin chat for Magento 2 that uses the Anthropic Claude API. Ask in plain English, for example "show me products with low stock", and it answers with 19 store tools. Dry run is on by default, and product, price, stock, config, CMS page and logo changes save a checkpoint you can restore.
- Free
composer require mage2kishan/magento2-claude-ai
- Package requirementsRead the source documentation
- Developer profileView Upwork profile
- Themes listedCheck the selected release
- PHP versions listedCheck the selected release
- Installation questionsDiscuss your store setup
What it does for your store
The main features, as listed in the module documentation.
-
Admin chat with 19 tools
Search products, customers and orders, run read-only queries, and, when allowed, change prices, stock, status, categories, CMS content and set config values.
-
Dry run on by default
Write tools only report what they would change until you set Dry Run Mode to No. Larger bulk changes need a one-time CONFIRM code from you.
-
Checkpoints for many writes
Product, price, status, stock, config, CMS page and logo changes save a before-state you can restore. Category, CMS block and order actions do not.
-
Per-tool and per-role control
Switch any tool off, and each tool runs only when the admin role has the matching Magento permission. No tool deletes products, categories, customers, orders or other records.
-
History and activity log
Conversations, tool calls, token counts and estimated cost are stored, with retention cleanup by a nightly cron job.
Installation
Example commands from the Magento root. Follow the package instructions and your staging and deployment process.
- 1Check the releaseMatch Magento, PHP, theme and dependency requirements.
- 2Install on stagingReview Composer changes and follow the package instructions.
- 3Configure and verifyUse the documented settings and test the affected features.
$ composer require mage2kishan/magento2-claude-ai $ bin/magento setup:upgrade $ bin/magento setup:di:compile $ bin/magento setup:static-content:deploy -f $ bin/magento cache:clean
Listed requirements
These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.
| Composer package | mage2kishan/magento2-claude-ai |
|---|
Documentation
Product details and setup guidance. Check the package repository for release-specific instructions.
Overview
Claude AI Automation (Panth_ClaudeAi) adds a chat assistant to the Magento 2 admin. Admin users type a request in plain English, and the assistant answers it by calling a fixed set of Magento tools through the Anthropic Claude API. You need your own Anthropic API key.
It is an admin tool that reads and changes store data. It adds nothing to the storefront. For AI help writing Page Builder content, see the PageBuilder AI module; for help with Claude Code as a developer tool, see the Claude Code pages on this site.
What it can do
- Read: search products, customers and orders, store insights such as order counts by status, low-stock products, store info, the installed modules list and a read-only database query tool (one SELECT, up to 100 rows, with sensitive tables and columns blocked).
- Write, when allowed: create, update and clone products; bulk price changes by fixed price or percentage; enable or disable products; stock quantities; categories and product assignment; CMS pages and blocks; hold, unhold, cancel and comment on orders; a fixed list of store config values; the store header logo; cache flush and reindex; and restoring checkpoints.
- No tool deletes products, categories, customers, orders or other records, and the assistant is told to offer disabling instead. The config tool can clear a whitelisted config value so it falls back to the inherited value.
Safety settings
- Dry Run Mode is on after installation, so write tools return a preview and save nothing until you turn it off.
- Require Confirmation Before Writes is on. Bulk price, status and stock changes above the Confirmation Threshold need you to reply with a one-time CONFIRM code, which the assistant cannot supply itself.
- Max Items per Bulk Action (500) and an hourly question limit per admin user (60).
- Every tool can be switched off, and a tool runs only when the admin role has the matching Magento permission. The database query tool needs full admin access.
- Checkpoints are saved before product, price, status, stock, config, CMS page and logo writes. Category, CMS block, order and cache or reindex actions do not create checkpoints, so they cannot be undone this way.
Data sent to Anthropic
Each model call sends the system prompt, the enabled tool definitions, the conversation and the results of the tools used to api.anthropic.com. Depending on the request, those results can include product data, customer names and email addresses, order data and rows from the database query tool. Attached images and PDFs, and the text of txt, csv, json, xml, log and md files (first 200,000 characters), are sent too; for other file types only the name, type and size. Messages, the activity log and uploads (files under var/panth/claudeai/) are deleted by a nightly cron job after Activity Retention (90 days), and un-restored checkpoints after 30. Training examples stay until you delete them, and var/log/panth_claudeai.log is not rotated by the module. Review this before you enable it.
Requirements
- Magento Open Source or Adobe Commerce 2.4.4 to 2.4.8.
- PHP 8.1, 8.2, 8.3 or 8.4 with cURL, and outbound HTTPS from the server to
api.anthropic.com. - An Anthropic API key and Magento cron. Panth Core is installed by Composer as a dependency.
The module is free and open source under the MIT License. Its calls use your own Anthropic API key.
Developer notes
- PHP namespace:
Panth\ClaudeAi. Admin route:claudeai. - Core classes:
Model\ClaudeClientcalls the Messages API with the version header2023-06-01.Model\Orchestratorbuilds the system prompt and runs the tool-use loop. - Adding a tool: implement
Model\Tool\ToolInterfaceand add it to thetoolsargument of the virtual typePanth\ClaudeAi\Model\ToolRegistry\Admininetc/di.xml.TOOL_ACLis a private constant ofModel\ToolRegistry, and a tool name that is not in it gets no extra role check, so any admin user withPanth_ClaudeAi::ai_chatcan run it. Gate a new tool inside itsexecute()or with a plugin onisAllowed. - Chat endpoints:
Chat\Send(JSON),Chat\Stream(server-sent events),Chat\Upload,Chat\FileandChat\Load. - Chat history sent to the provider is rebuilt on the server from the stored messages of the current admin user, and history in the request body is ignored. A conversation id that belongs to another admin user, or has no recorded owner, starts a new conversation. Attachments are read on the server from the stored file owned by the current admin user.
- Tables:
panth_claudeai_activity,panth_claudeai_message,panth_claudeai_checkpoint,panth_claudeai_attachmentandpanth_claudeai_training. - ACL resources, under
Panth_ClaudeAi::ai_root:Panth_ClaudeAi::ai_dashboard,::ai_chat,::ai_upload,::ai_training,::ai_conversations,::ai_activity,::ai_checkpoint,::ai_configand::config_section.
Tools are also checked against the admin role:
| Tools | Required ACL resource |
|---|---|
get_products, manage_products, update_product_price, update_product_status, update_inventory, get_low_stock_products | Magento_Catalog::products |
manage_categories | Magento_Catalog::categories |
customers | Magento_Customer::manage |
orders, store_insights | Magento_Sales::sales_order |
manage_cms_pages | Magento_Cms::page |
manage_cms_blocks | Magento_Cms::block |
store_info, update_config, set_store_logo | Magento_Config::config |
cache_reindex | Magento_Backend::cache |
database_query | Magento_Backend::all (roles with full access only) |
restore_checkpoint | Panth_ClaudeAi::ai_checkpoint |
get_modules | none beyond Panth_ClaudeAi::ai_chat |
Questions before you install?
Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.