Optimize Gas
Optimize gas fees with timing and routing strategies
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- 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
- 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.
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.
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:
- Current Gas Analysis:
- Current base fee (gwei)
- Priority fee recommendations
- Max fee calculations
- Total transaction cost estimate
- Historical Context:
- Compare to 24h average
- Compare to 7-day average
- Identify typical low-fee periods
- Current network congestion level
- Timing Optimization:
- Best time windows for transactions
- Expected gas price patterns
- Congestion forecasts
- Urgency vs savings trade-off
- Alternative Solutions:
- Layer 2 options (Arbitrum, Optimism, Base, zkSync)
- Sidechains (Polygon, Gnosis Chain)
- Batch transaction opportunities
- Alternative routes with cost comparison
- 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 UnitsTypical 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
- Vertex Campaign Generate complete multimodal marketing campaigns using Vertex AI - video, Slash Command · jeremylongshore/tons-of-skills-marketplace
- Vibe Explainer User-facing progress translator that reads .vibe/status.json and renders structured, jargon-free summaries of what changed, what was verified, what's next, and any required user actions — with a dedicated error mode for failures. Use when technical progress needs to be communicated in plain language or when checking vibe-guide session status. Trigger with \"vibe status\", \"/vibe-guide:status\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Vibe Guide Non-technical progress summaries for Claude Code work (hides diffs/log noise). Plugin · jeremylongshore/tons-of-skills-marketplace
- Vertex Engine Inspector Inspects and validates Vertex AI Agent Engine deployments — runtime config, code-execution sandbox, memory bank, A2A protocol compliance, security posture, and production readiness. Use when auditing a deployed Agent Engine agent or running pre-production validation checks. Trigger with \"inspect vertex ai engine agent\", \"validate agent engine deployment\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Optimize Query Analyze and optimize SQL queries for performance Slash Command · jeremylongshore/tons-of-skills-marketplace
- Optimize Cache Optimize caching strategies and implementation Slash Command · jeremylongshore/tons-of-skills-marketplace
- Optimize Staking Analyze and optimize staking rewards across protocols Slash Command · jeremylongshore/tons-of-skills-marketplace
- Optimize Get performance optimization recommendations Slash Command · jeremylongshore/tons-of-skills-marketplace