Claude Code Trading: Connect Claude Code and Codex to Trigr

Claude Code trading setup: connect Claude Code and Codex to Trigr's MCP server, authorize in your browser, and backtest crypto strategies from the terminal.

Trigr Research6 min read
On this page
  1. Why use a coding agent for trading research?
  2. What do you need before you start?
  3. How do you connect Claude Code to Trigr?
  4. How do you connect Codex to Trigr?
  5. Should you choose manual or autonomous mode?
  6. What does a first session look like?
  7. How do you troubleshoot the connection?
  8. Next steps

TL;DR: To use Claude Code for trading research, add Trigr's remote MCP server with claude mcp add --transport http --scope user trigr https://trigr.xyz/mcp, then authenticate from /mcp. For Codex, run codex mcp add trigr --url https://trigr.xyz/mcp followed by codex mcp login trigr. Both flows sign you in through the browser, create a revocable credential, and give the agent point-in-time backtests and strategy drafting, never live trading or withdrawals.

Why use a coding agent for trading research?

Claude Code and Codex are built for long, multi-step work: they plan, call tools, read the output and iterate. That shape fits strategy research well. A typical session involves looking up which data exists, drafting a rule, backtesting it, reading the trade log, adjusting one thing and testing again.

Terminal agents also sit next to your notes and code. You can keep a research log in a repository, ask the agent to record each hypothesis before it tests it, and diff your conclusions over time. That discipline is harder to maintain in a chat window.

What a coding agent does not have on its own is market data or a backtest engine it can trust. Connecting it to Trigr's MCP server supplies both, along with your account context and a set of hard limits. The overview of Trigr's trading MCP server covers the full tool list; this guide focuses on setup and a first session.

What do you need before you start?

  • A Trigr account. MCP access is available on every plan, including Free, which includes 3,000 one-time trial credits and 10 saved strategies.
  • Claude Code or the Codex CLI installed and signed in to your AI provider.
  • A browser on the same machine, for the one-time authorization.

You do not need to create or paste an API key. The browser flow creates a revocable MCP credential automatically. Manual API-key Bearer authentication is still supported for scripted setups; API keys come with the Trader and Pro plans and are covered in the API authentication docs.

How do you connect Claude Code to Trigr?

Add the server at user scope, so it is available in every project on your machine:

claude mcp add --transport http --scope user trigr https://trigr.xyz/mcp
claude
# Inside Claude Code: /mcp → Trigr → Authenticate

When you select Authenticate, Claude Code opens Trigr in your browser. Sign in, review the permissions and approve the connection. The HTTP transport and the /mcp authentication menu are standard Claude Code features, documented in Anthropic's guide to connecting Claude Code to MCP servers.

Once connected, the server's reusable prompts appear as slash commands:

  • /mcp__trigr__build_strategy designs a new strategy from the supported catalog.
  • /mcp__trigr__improve_strategy reviews one of your saved strategies and proposes a focused change.
  • /mcp__trigr__research_marketplace compares marketplace candidates with pre-registered criteria.

Slash commands are how MCP prompts are meant to surface: the MCP prompts specification describes them as user-controlled templates that clients typically expose as commands.

How do you connect Codex to Trigr?

Codex uses a similar two-step flow:

codex mcp add trigr --url https://trigr.xyz/mcp
codex mcp login trigr
codex mcp get trigr --json

The login command opens Trigr in your browser for the same sign-in and approval. The last command prints the stored server entry so you can confirm it was saved. OpenAI documents MCP configuration and codex mcp login for OAuth servers in its Codex MCP guide.

Codex does not use the Claude Code slash-command names. Ask naturally instead, for example: "Use Trigr to build a strategy. First check my account context, existing strategies and agents, then ask what I want to build."

Should you choose manual or autonomous mode?

During browser authorization you choose how much the connection may do without asking. You can change this later, separately for each connected client.

Manual mode Autonomous mode
Consequential actions Browser confirmation before each one May continue without a prompt
Authorization Ten-minute, single-use, bound to exact arguments Same
Credits, quotas, ownership checks Enforced Enforced
Live trading, withdrawals, credential edits Not available Not available
Good for First sessions, anything that spends meaningful credits Long research loops with a set budget

For a first session, manual mode is the sensible default. Each backtest request shows up in your browser before it runs, with a summary of the market, timeframe, request id and cost settings (for example "slippage 5 bp per side, real historical funding" or "no slippage, no funding"). The design choices behind this are explained in what an AI assistant can and can't do on Trigr.

What does a first session look like?

A productive first run in Claude Code might go like this:

  1. Start the build prompt. Run /mcp__trigr__build_strategy and give an objective, for example "a 4H ETH trend strategy that stays out when funding is extreme."
  2. Let it read context. The workflow checks your plan, credits, strategy quota, saved strategies and agents, then searches the capability catalog for the exact indicator and data-source ids it needs.
  3. Check coverage. Ask it to confirm point-in-time data coverage for ETH and the funding source before spending credits.
  4. Save one draft. It validates and saves the graph. The draft appears immediately in Trigr Studio.
  5. Run a gross backtest, then a net one. Fees and the builder fee are always applied. Slippage and funding are opt-in, so ask for a second run with a flat slippage per side and historical funding. A standard backtest costs 50 credits, where 1,000 credits equal $1.
  6. Read the evidence. Ask for the Deflated Sharpe Ratio, drawdown, trade count, and a page of the trade log. Reading stored runs and trade logs is free. Trade prices in the log are bar reference prices before slippage, and P&L is in units of an account that starts at 100, not dollars.
  7. Write it down. Have the agent append the hypothesis, settings and results to a research file in your repository.

If the idea survives, the next honest step is a paused paper agent that you start from the Trigr app, so it can forward-test on data that did not exist when you picked the strategy. The prompt recipes for AI strategy work include wording for each of these steps.

Backtests are not guarantees; perps are leveraged and can lose more than expected.

How do you troubleshoot the connection?

Symptom Likely cause What to try
Trigr shows as needing authentication The browser flow was not completed Open /mcp in Claude Code, or rerun codex mcp login trigr
Slash commands do not appear The server was added but not authenticated, or Claude Code was not restarted Authenticate, then restart the session
A backtest is rejected after approval The graph or cost settings changed after the authorization was issued Request a new approval with the exact arguments
An edit fails with a hash mismatch The strategy changed in Studio since the agent last read it Have the agent list strategies again to get the current recipe hash
A save fails on quota The account has reached its saved-strategy cap Delete an old draft or change plans; existing strategies are never deleted automatically

The last two are safety features rather than bugs. The recipe hash stops a stale edit from overwriting your newer work, and quotas apply across Studio, REST and MCP alike.

If you connected both Claude Code and Codex, each client has its own credential and its own approval mode. Revoking one connection, or switching it back to manual mode, does not affect the other, which makes it easy to keep a trusted terminal setup in autonomous mode while a newer client stays in manual mode. Revoking a connection also cancels any authorizations it had not used yet, and switching to manual mode cancels its approved-but-unused ones.

Two more details help when you reconnect. When a client re-authorizes under the same OAuth registration, Trigr replaces that registration's previous credential instead of adding a second one. And an account can hold up to five active MCP connections; if you hit that limit, revoke an old one in Trigr's agent-access settings and try again.

Next steps

Open the guided setup at connect your AI assistant to copy the commands for your client, then check the AI agents and MCP docs for the full list of tools and the recommended research loop.

Frequently asked questions

How do I add Trigr to Claude Code?

Run `claude mcp add --transport http --scope user trigr https://trigr.xyz/mcp`, start `claude`, then open `/mcp`, select Trigr and choose Authenticate. Claude Code opens a browser window where you sign in and approve the connection.

How do I add Trigr to Codex?

Run `codex mcp add trigr --url https://trigr.xyz/mcp`, then `codex mcp login trigr` to open the browser authorization. `codex mcp get trigr --json` shows the stored server entry.

Can Claude Code trade live on my Hyperliquid account through Trigr?

No. Trigr's MCP server cannot start execution, place live trades, withdraw funds or edit credentials. Claude Code can research, backtest, save drafts and create a paused paper agent, and you decide in the Trigr app what goes live.

Which Trigr slash commands does Claude Code show?

Claude Code exposes the server's prompts as `/mcp__trigr__build_strategy`, `/mcp__trigr__improve_strategy` and `/mcp__trigr__research_marketplace`.

Put the idea to an honest test.

Describe a strategy in plain English or from your own AI assistant, backtest it on point-in-time data, and forward-test it on paper before any real money is involved.