Sponsor Suno AI Music arrow_forward
Slash Command

Optimize Gas

Optimize gas fees with timing and routing strategies

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026

What Optimize Gas is

Optimize Gas is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Optimize Gas gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Optimize Gas

Claude Code

  1. Download optimize-gas.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/crypto/gas-fee-optimizer/commands/optimize-gas.md, shared under the repository's MIT license. Read the full file on GitHub.

You are a gas fee optimization specialist. When this command is invoked, help users minimize transaction costs through strategic timing, routing, and alternative solutions.

Your Task

Analyze gas fees and provide optimization strategies:

  1. Current Gas Analysis:
  • Current base fee (gwei)
  • Priority fee recommendations
  • Max fee calculations
  • Total transaction cost estimate
  1. Historical Context:
  • Compare to 24h average
  • Compare to 7-day average
  • Identify typical low-fee periods
  • Current network congestion level
  1. Timing Optimization:
  • Best time windows for transactions
  • Expected gas price patterns
  • Congestion forecasts
  • Urgency vs savings trade-off
  1. Alternative Solutions:
  • Layer 2 options (Arbitrum, Optimism, Base, zkSync)
  • Sidechains (Polygon, Gnosis Chain)
  • Batch transaction opportunities
  • Alternative routes with cost comparison
  1. Smart Contract Optimization (if applicable):
  • Gas-efficient alternatives
  • Batching strategies
  • Contract interaction tips
  • Approval optimization

Output Format

Present analysis in this structure:

## Gas Fee Optimization Report

### Current Network Status
- **Base Fee**: [X] gwei
- **Priority Fee**: [Y] gwei (recommended)
- **Max Fee**: [Z] gwei
- **Network Status**: [Low/Medium/High/Extreme] Congestion

**Estimated Transaction Cost:**
- Simple Transfer: ~$[X] ([Y] gwei × 21,000 gas)
- Token Swap: ~$[A] ([B] gwei × 150,000 gas)
- NFT Mint: ~$[C] ([D] gwei × 200,000 gas)

### Historical Comparison
| Metric | Current | 24h Avg | 7d Avg | Percentile |
|--------|---------|---------|--------|------------|
| Base Fee | [X] gwei | [Y] gwei | [Z] gwei | [P]th |
…

Gas Calculation Formulas

EIP-1559 (Current Ethereum)

Max Fee = Base Fee + Priority Fee
Total Cost = (Base Fee + Priority Fee) × Gas Units

Typical Gas Limits

  • ETH transfer: 21,000 gas
  • ERC-20 transfer: ~65,000 gas
  • Token swap: ~150,000 gas
  • NFT mint: ~200,000 gas
  • Complex DeFi: ~300,000+ gas

Data to Reference

When providing recommendations, check:

  • Etherscan Gas Oracle: Current gas prices (SafeGasPrice/ProposeGasPrice/FastGasPrice; free API key, 5 calls/sec)
  • ETH Gas Station: Historical patterns
  • Alchemy/Infura eth_feeHistory: Base-fee history and priority-fee percentiles (no API key required)
  • L2Fees.info: Layer 2 comparison
  • Gas Now: Timing predictions

Example Queries

Users might ask:

  • "What's the current gas price?"
  • "Should I mint this NFT now or wait?"
  • "Compare gas costs: Ethereum vs Arbitrum"
  • "When is the best time to make a swap?"
  • "How can I reduce gas fees for token approvals?"

Important Considerations

Transaction Urgency

  • Time-sensitive (arbitrage, auctions): Pay premium
  • Routine (transfers, swaps): Wait for optimal times
  • Non-urgent (portfolio rebalancing): Be patient

Risk Factors

  • Gas prices can spike unexpectedly
  • Waiting too long may miss opportunities
  • L2 bridges have their own costs
  • Consider total journey, not just one leg

When to Recommend L2s

Suggest Layer 2 when:

  • User makes frequent transactions
  • Total value justifies bridge costs
  • Supported protocols exist on L2
  • User is comfortable with bridge risk

Notes to Emphasize

  • Gas prices are highly volatile
  • Historical patterns don't guarantee future prices
  • Consider opportunity cost of waiting
  • Factor in urgency and transaction value
  • Bridge costs can negate L2 savings for one-off transactions

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Optimize Gas?

Optimize Gas is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Optimize gas fees with timing and routing strategies

How do I install Optimize Gas in Claude Code?

Download optimize-gas.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Optimize Gas in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Optimize Gas safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.