Skip to main content
rule CX Codex

forge — Claude Code rule: what it does, how to install

The forge rule configures Foundry workflows for Abstract and tells Claude Code to use the ZKsync mode for Solidity projects.

no license ★ 1,064 updated 2026-01-21

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/forge.md
Open on GitHub

What forge does

The rule targets *.sol files and foundry.toml. It sets a working convention for Abstract Chain: use foundry-zksync and add --zksync to Foundry commands for builds, tests, scripts, and contract deployment.

Its configuration covers RPC endpoints for Abstract Mainnet and Abstract Testnet, chain IDs, verification URLs, and etherscan entries. Deployment uses forge script with --broadcast; verification uses forge verify-contract. The explorer key is read from ABSCAN_API_KEY. Without --zksync, a Foundry command is in the wrong mode for this ZKsync-based chain.

Place the rule at .claude/rules/forge.md in a Claude Code project. It only matches Solidity files and foundry.toml, so unrelated project files are outside its scope.

What it helps with

  • build Solidity code with the ZKsync Foundry mode
  • run tests against the required command setup
  • deploy a script to Abstract Testnet or Mainnet
  • verify a deployed contract through Abstract’s explorer
  • keep Abstract RPC and verifier settings in foundry.toml

Example prompts for the agent

  • Build the contracts with forge build --zksync.
  • Run the test suite using forge test --zksync.
  • Deploy script/Deploy.s.sol to Abstract Testnet, then verify the contract.

How to install forge

Manually: put the files in place

.claude/rules/forge.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about forge

How do I install forge in Claude Code?

Add the rule file at .claude/rules/forge.md inside your Claude Code project.

What does forge do?

It tells Claude Code to use ZKsync-aware Foundry commands for Solidity files and foundry.toml, with Abstract network and verification settings.

What is required to verify an Abstract contract?

Set ABSCAN_API_KEY and use forge verify-contract with --zksync, the matching verifier URL, and the network chain ID.

Similar IDE rules

IDE rules catalog →

From the same set20

The whole set →
bundle-dynamic-imports bundle-dynamic-imports guides Claude Code to lazy-load heavy components using next/dynamic with SSR disabled. Keeps your initial client bundle lean to protect TTI and LCP metrics. CX Codex +1 ★ 1,064repo stars rendering-content-visibility The rendering-content-visibility rule applies content-visibility: auto to long lists so off-screen items can wait before rendering. It fits message feeds and other scrollable collections. CX Codex +1 ★ 1,064repo stars rerender-dependencies rerender-dependencies — a Claude rule that keeps useEffect dependency arrays on primitives like user.id rather than whole objects, so an effect stops firing on every field change. CX Codex +1 ★ 1,064repo stars testing The testing rule sets conventions for TypeScript test files and the __tests__ directory. Use it to guide checks for success cases, failures, and edge conditions. CX Codex +1 ★ 1,064repo stars js-batch-dom-css js-batch-dom-css — a Claude rule that keeps the agent from writing styles one property at a time and pushes it toward a class or a single cssText string. CX Codex +1 ★ 1,064repo stars codebase-search codebase-search finds where a feature lives in your repo and hands back absolute paths plus a short explanation of the flow. CX Codex ★ 1,064repo stars media-interpreter media-interpreter — a subagent for working with PDFs, images, diagrams, and other binary formats. Extracts text, tabular data, and descriptions of visual content when standard file reading isn't an option. CX Codex ★ 1,064repo stars tech-docs-writer tech-docs-writer explores unfamiliar codebases to generate and maintain technical documentation, README files, and API guides with verified code samples. CX Codex ★ 1,064repo stars

Project sponsors

Companies that keep this analytics open