Agent Integration
Your coding agent works with contract.dev through the contract.dev CLI and agent skill. Ask in plain words: it answers questions about your protocol from your workspace’s data, and sets up and changes the workspace for you.
The skill works with Claude Code, Codex, Cursor, Gemini CLI and GitHub Copilot. To install it, follow the Agent Quickstart.
What your agent can do
- Answer questions — About your contracts, wallets, users and their on-chain activity, each figure with the window it covers.
- Watch contracts and wallets — Find your deployed contracts, watch them, and put them in groups.
- Build your data — Make and change metrics, tables and groups of users.
- Set up alerts and reports — Make and change alerts and reports, and where they send.
- Fill the Overview — Pin metrics, tables and groups of users to the Overview.
- Set up a protocol — Plan and build a whole workspace from your repository or a protocol’s name.
The CLI and the agent skill
| Part | What it is |
|---|---|
| CLI | The @contract-dev/cli package. Reads your workspace’s data and makes changes in it, as your account. |
| Agent skill | Instructions that teach your coding agent which command answers which question, and how to set up a protocol. |
The skill installs into ~/.claude/skills and ~/.agents/skills, which every supported agent reads.
contract-dev skill install # install it, or bring it up to this CLI's version
contract-dev skill install --project # into this repository, to commit for your team
contract-dev skill status # where it is installed, and which version
contract-dev skill uninstall # remove it (run this before npm uninstall)--project uses .claude/skills and .agents/skills at the repository’s root. --force replaces a contract-dev skill the CLI did not install. Agents load the skill when their next session starts. After a CLI upgrade, the next command updates the installed copies, and once a day they pick up new guidance from contract.dev.
Repository context
Run your agent from your protocol’s repository. Its deployment files, ABIs and source code let the agent find your contracts, read their roles, and define metrics in your protocol’s own terms.
Outside a repository, the agent works from a protocol’s name and chain, using public deployment information and verified source code.
How it works
When you make a request, your agent:
- Reads your workspace — Its brief, its watched contracts and wallets, and what it already holds.
- Investigates — Reads contracts, events, transactions and recorded values with the CLI.
- Acts — Does what you asked at once, then says what it made, with links to the app.
A protocol setup is the exception: the agent shows a plan first and builds it once you approve. See Review and approve the plan.
The workspace brief
The brief describes your protocol in plain words: what it is, each group’s role, its mechanism, its tokens and what its metrics mean. A setup writes it, ending with Definitions: one line per term your team uses, such as volume, fees or traders, with how it is worked out. After that, your agent adds what it learns and rewrites the brief only when you ask.
Your coding agent and the Slack/Telegram assistant read the brief before they answer, and use its definitions. Read or write it with workspace brief.
Data coverage
Every figure your agent reads comes with its window and how complete that window is:
| Coverage | What the agent tells you |
|---|---|
| Complete | The figure and its window. |
| Partial | The figure over the shorter window it covers, and what is missing. |
| Indexing | No figure yet: how far history has been read, and when to ask again. |
| Unavailable | No figure: it cannot be read just now. |
A partial figure is never given as the total.
Call tools directly
contract-dev tool runs the platform’s tools by name, with JSON in and out: the operations behind the CLI’s commands and the Slack/Telegram assistant. Use it in scripts.
contract-dev tool list # every tool: name, scope, title
contract-dev tool show describe_contract # what it does, and its input schema
contract-dev tool run find --input '{"query":"pools"}' # run it; the result prints as JSON
contract-dev tool run create_alert --input @alert.json # the input from a fileA refusal prints the server’s message and exits with code 1.
What you can ask
Which markets had the largest liquidity outflows this week?Chart our trading volume over the last 30 days.Create a table of our lending markets with supplied, borrowed and available liquidity.Send a daily report of fees and trading volume to #analytics.Slack and Telegram
The contract.dev assistant answers questions and makes changes in Slack and Telegram, as your coding agent does. It reads the same brief and follows the same rules.
To connect it, open Settings → Message destinations and choose Connect Slack workspace, or for Telegram Direct message or Connect Telegram group. The same connection can receive alerts and reports.
| Where | How to ask |
|---|---|
| Slack channel | Mention @contract.dev, or reply in a thread it is answering in. |
| Slack direct message | Send any message. |
| Anywhere in Slack | /contractdev <question> |
| Telegram direct message | Send any message. |
| Telegram group | Mention the bot, or reply to one of its messages. |
Changes are made at once. Ask to review first, and the assistant posts a draft with Confirm and Cancel. An alert or report asked for in a Slack channel or a Telegram chat sends there, unless you name another destination.
In Slack, making changes needs your Slack account linked to your contract.dev account: press Link account when the assistant shows it to you. Viewers can ask questions but not make changes. In Telegram, anyone in a connected chat can ask and make changes.