anth-local-dev-loop

Featured

Configure a local development workflow for Anthropic Claude API projects. Use when setting up dev environment, configuring hot reload, or establishing a fast iteration cycle with the Messages API. Trigger with phrases like "anthropic local dev", "claude dev setup", "anthropic development workflow", "test claude locally".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Local Dev Loop ## Overview Set up a fast local development cycle for Claude API projects with environment management, request logging, cost tracking, and hot-reload. ## Prerequisites - Completed `anth-install-auth` setup - Node.js 18+ or Python 3.8+ - `.env` file with `ANTHROPIC_API_KEY` ## Instructions ### Step 1: Project Structure ``` my-claude-app/ ├── .env # ANTHROPIC_API_KEY=sk-ant-... ├── .env.example # ANTHROPIC_API_KEY=your-key-here ├── .gitignore # Include .env ├── src/ │ ├── client.ts # Singleton client │ ├── prompts/ # System prompts as files │ └── tools/ # Tool definitions ├── tests/ │ └── mock-responses/ # Saved API responses for testing └── scripts/ └── dev.ts # Dev runner with logging ``` ### Step 2: Singleton Client with Request Logging ```typescript // src/client.ts import Anthropic from '@anthropic-ai/sdk'; let client: Anthropic | null = null; export function getClient(): Anthropic { if (!client) { client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY, maxRetries: 2, timeout: 30_000, }); } return client; } // Development logger — tracks cost per request export function logUsage(messageId: string, usage: { input_tokens: number; output_tokens: number }, model: string) { const pricing: Record<string, { input: number; output: number }> = { 'claude-sonnet-4-20250514': { input: 3.0, output: 15.0 }, 'cl...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category