Skip to Content
Agent Integration

Agent Integration

Connect contract.dev to Claude Code, Codex, Cursor or another coding agent with the contract.dev CLI and agent skill.

Your agent investigates your protocol’s on-chain data and configures your workspace from requests in natural language, without you writing CLI commands.

The CLI and the agent skill

PartWhat it is
CLIThe @contract-dev/cli package. Connects your agent to your workspace, to read its data and create resources.
Agent skillInstructions that teach your coding agent how to use contract.dev through the CLI.

With both installed, your agent can:

  • Discover and investigate contracts, wallets and their on-chain activity.
  • Query your workspace’s data and answer questions.
  • Create and change metrics, tables, reports and alerts.
  • Set up an entire protocol from its source code and deployment files.

To install both, follow the Agent Quickstart.

Repository context

Run your agent from your protocol’s repository. Its deployment files, ABIs and source code let the agent identify your contracts and their roles, and define metrics in your protocol’s own terms.

Outside a repository, the agent works from a protocol name and chain, using public deployment information and verified contract data.

How it works

When you make a request, your agent:

  1. Reads your workspace — Its brief, its watched contracts and wallets, and the data available.
  2. Investigates — Queries contracts, events, transactions and recorded values with the CLI.
  3. Acts — Creates or changes resources, then says what it made, with links to the app.

A protocol setup is planned first: the agent presents the contracts, groups, metrics and tables it will create, and builds them once you approve.

The workspace brief

The brief is your workspace’s description of your protocol: what it is, each group’s role, its mechanism, its tokens and what its metrics mean. The agent writes it at the end of a setup, adds to it as it learns, and reads it at the start of every conversation. See workspace brief.

Data coverage

Every figure the agent reads comes with its window and how complete that window is. While history is still being read, the agent says how far it has got and when to ask again, rather than giving a partial figure as a total.

What you can ask

  • Ask questions — “Which markets had the largest liquidity outflows this week?”
  • Track metrics — “Chart our trading volume over the last 30 days.”
  • Build tables — “Create a table of our lending markets with supplied, borrowed and available liquidity.”
  • Set up notifications — “Send a daily report of fees and trading volume to #analytics.”

You can keep investigating and refining your workspace in the same conversation.

Last updated on