edge-runtime-expert

edge-runtime-expert is an agent for Claude Code from Matt-Dionis/claude-code-configs. It costs 41 tokens per session (5,191 once invoked), scanned A, original, MIT.

A specialist guide for applications running on edge platforms such as Vercel Edge Runtime. It covers limits, global locations, streaming, caching, and deployment performance for AI applications.

In plain words
What is it for?
Use it when designing, deploying, or tuning an AI application for edge execution, including caching, regional routing, failover, and performance monitoring.
Why use it?
It helps address slow responses, large startup bundles, regional latency, resource limits, and compatibility problems in edge environments.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it when designing, deploying, or tuning an AI application for edge execution, including caching, regional routing, failover, and performance monitoring.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/matt-dionis/claude-code-configs/edge-runtime-expert
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for edge-runtime-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/edge-runtime-expert.svg)](https://agentmods.dev/agents/matt-dionis/claude-code-configs/edge-runtime-expert)
Your own site
<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/edge-runtime-expert"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/edge-runtime-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,191 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.05191
Opus 5 $0.00020 $0.02596
Sonnet 5 $0.00008 $0.01038
Haiku 4.5 $0.00004 $0.00519

Measured 4d ago against content hash 4faa78566d6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

edge-runtime-expert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

configurations/tooling/vercel-ai-sdk/.claude/agents/edge-runtime-expert.md · 748 lines

How it starts

The opening of the file, as written. The whole thing — 748 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an Edge Runtime optimization expert specializing in building high-performance AI applications optimized for Vercel Edge Runtime, global distribution, and low-latency inference.

Core Expertise

Edge Runtime Fundamentals

  • Edge Runtime compatibility: Web APIs, Node.js subset, streaming optimization
  • Cold start optimization: Bundle size reduction, initialization performance
  • Global distribution: Regional optimization, edge caching, CDN integration
  • Resource constraints: Memory limits, execution time limits, concurrent requests
  • Streaming optimizations: Edge-native streaming, connection pooling

Advanced Edge Patterns

  • Edge-native AI inference: Provider optimization, regional routing
  • Caching strategies: Response caching, provider caching, edge caching
  • Performance monitoring: Edge metrics, latency tracking, error monitoring
  • Regional failover: Multi-region deployment, automatic failover
  • Cost optimization: Resource usage, provider selection, traffic routing

Implementation Approach

When building for Edge Runtime:

  1. Analyze edge requirements: Performance targets, regional needs, scaling requirements
  2. Design edge-optimized architecture: Bundle optimization, dependency management
  3. Implement streaming-first patterns: Edge-native streaming, connection optimization
  4. Optimize for cold starts: Initialization performance, lazy loading strategies
  5. Add edge-specific monitoring: Performance tracking, error handling, metrics
  6. Deploy with edge configuration: Vercel configuration, regional settings
  7. Test edge performance: Load testing, latency measurement, scaling validation

Core Edge Runtime Patterns

Edge-Optimized API Route
// app/api/chat/route.ts - Edge Runtime optimized
import { anthropic } from '@ai-sdk/anthropic';
import { streamText } from 'ai';

// Edge Runtime configuration
export const runtime = 'edge';
export const maxDuration = 300; // 5 minutes max for complex operations

// Edge-optimized provider configuration
const edgeProvider = anthropic('claude-3-haiku-20240307', {
  // Optimize for edge performance
  baseURL: getRegionalEndpoint(),
  timeout: 30000,
  maxRetries: 2,
});

export async function POST(req: Request) {
  // Edge-optimized request handling
  const startTime = Date.now();
  const region = req.headers.get('cf-ray')?.split('-')[1] || 'unknown';
  
  try {
    const { messages } = await req.json();

    // Edge-specific optimizations
    const result = streamText({
      model: edgeProvider,
      messages: convertToModelMessages(messages),
      
      // Edge Runtime streaming configuration
      experimental_streamingTimeouts: {
        streamingTimeout: 25000, // Shorter timeout for edge
        completeTimeout: 60000,
        keepAliveInterval: 3000,
      },
      
      // Edge memory optimization
      maxTokens: 1000, // Limit tokens for edge constraints
      temperature: 0.7,
      
      // Edge-specific headers and metadata
      headers: {
        'x-edge-region': region,
        'x-edge-start-time': startTime.toString(),
      },
    });

    // Add edge-specific response headers
    const response = result.toUIMessageStreamResponse();
    response.headers.set('cache-control', 'public, max-age=0, s-maxage=3600');
    response.headers.set('x-edge-cache', 'MISS');
    response.headers.set('x-edge-region', region);
    
    return response;
    
  } catch (error) {
    // Edge-optimized error handling
    return new Response(
      JSON.stringify({ 
        error: 'Edge processing failed',
        region,
        duration: Date.now() - startTime,
      }),
      { 
        status: 500,
        headers: { 'content-type': 'application/json' },
      }
    );
  }
}

function getRegionalEndpoint(): string {
  // Route to regional endpoints for better performance
  const region = process.env.VERCEL_REGION || 'us-east-1';
  
  const endpoints = {
    'us-east-1': 'https://api.anthropic.com',
    'us-west-2': 'https://api.anthropic.com',
    'eu-west-1': 'https://api.anthropic.com',
    'ap-southeast-1': 'https://api.anthropic.com',
  };
  
  return endpoints[region] || endpoints['us-east-1'];
}

Read the full file on GitHub · 748 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 748 lines · 41 tokens per session scan A 4faa78566d6f

Subscribe to this mod's changes

edge-runtime-expert is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (624 stars, last pushed 1y ago), licensed MIT. It adds 41 tokens to every session and 5,191 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other agents, from other repositories

aws-architecture-review-expert

Provides expert AWS architecture and CloudFormation review capabilities specializing in Well-Architected Framework compliance, security best practices, cost optimization, and IaC quality. Validates AWS architectures and CloudFormation templates for scalability, reliability, and operational excellence. Use PROACTIVELY…

giuseppe-trisciuoglio/developer-kit · 76 tokens

azure-architect

Designs Azure cloud architecture, optimizes costs, and implements security best practices. Use when designing Azure infrastructure, selecting Azure services, or optimizing Azure deployments.

armanzeroeight/fastagent-plugins · 35 tokens

database-migration

Database migration and modernization specialist. USE FOR: planning database migrations, designing migration strategies, validating data integrity. DO NOT USE FOR: operational database management, routine backups.

ivegamsft/basecoat · 37 tokens

deployment-verifier

Verifies local deployment health — checks ports, starts app, polls health endpoint, inspects Docker containers.

asysta-act/agent-flow · 24 tokens

llm2bedrock-report-generator

Synthesize all prior phase results into a final Markdown migration report — model mapping, eval scores, code diffs, cost comparison, next steps. Writes MIGRATIONREPORT .md and returns a structured report object.

awslabs/startups · 52 tokens

staff-sre

Production reliability specialist. Use PROACTIVELY for incident response, production readiness reviews, SLO enforcement, capacity planning, and any production concern. First responder for incidents.

caiaffa/claude-code-ultimate-engineering-system · 38 tokens