Install the plugin in Claude
The Cloud ex Machina plugin lets you ask your coding agent about your cloud directly from your terminal. After a one-time browser sign-in, it answers with live data from your Cloud ex Machina organization: cost drivers, savings opportunities, commitment coverage, workload context, and the cost of a change before you apply it.
This guide covers Claude Code. Support for other coding agents is on the way.
The plugin is an early preview. It installs from its source repository, so you need access to the
cxmlabs organization on GitHub. Once it is published, the public command will be
npx @cloudexmachina/cxm — until then use the commands below.
Requirements
- Claude Code installed and working in your terminal.
- Node.js 22 or later (this provides
npmandnpx). Check withnode --version. - Access to the
cxmlabsGitHub organization, sonpmcan fetch the plugin (your normalgit/GitHub credentials are enough). - A Cloud ex Machina account with access to at least one organization.
- Your Cloud ex Machina URL —
https://app.cloudexmachina.iofor production. Your contact will tell you if you should use a different one.
Step 1 — Install the CLI
Install the cxm command from the source repository:
npm install -g github:cxmlabs/cxm-plugin
This gives you a cxm command. Prefer not to install anything globally? Run each command through
npx github:cxmlabs/cxm-plugin … instead (for example, npx github:cxmlabs/cxm-plugin init).
Step 2 — Install the skills
Run this from the root of the repository where you want to use the plugin (for example, your infrastructure or application repo):
cxm init
init adds a set of skills to your agent and records your Cloud ex Machina URL. If your account is
on a different URL, pass it explicitly:
cxm init --url https://app.cloudexmachina.io
It also adds two helpful hooks: one that prices infrastructure-as-code changes as you edit Terraform
or CloudFormation, and one that adds cost context when you run aws commands.
Step 3 — Sign in
cxm login
login opens your browser to the Cloud ex Machina sign-in page. Sign in as you normally would, then
choose the organization you want the agent to use. When you approve, a short-lived access token is
stored on your machine at ~/.config/cxm/credentials.json, readable only by you.
When the session expires, run cxm login again.
Step 4 — Ask your agent
Start Claude Code in the same repository and ask, in plain language:
- "What are my biggest cloud cost drivers this month?"
- "Where am I wasting money? Show me the opportunities with estimated savings."
- "What is my Reserved Instance and Savings Plan coverage?"
- "I'm about to add three large instances — what will that cost per month at our rate?"
- "Is there a cheaper equivalent for this instance type?"
The matching skill fires automatically and answers with your live data.
You can also edit a Terraform or CloudFormation file, or run an aws create command, and the plugin
will prompt the agent to price and enrich the change before you apply it.
Run commands directly
The same tool works as a plain command if you prefer:
cxm whoami # confirm which organization you are connected to
cxm price --service ec2 --instance-type r6i.2xlarge --region eu-west-1
Switch organization or sign out
To connect to a different organization, run cxm login again and pick the new one. To sign out,
delete the credentials file:
rm ~/.config/cxm/credentials.json
Troubleshooting
- "Not logged in" or "Session expired" — run
cxm loginagain. - The browser did not open — the command prints a sign-in link; open it manually.
- Wrong organization — run
cxm loginand select the correct organization on the consent screen. npm installcannot find the repository — confirm your GitHub account has access to thecxmlabsorganization.