kmcclosk

Claude Agent — Development skill for Claude Code

Development community

A comprehensive collection of examples demonstrating the Claude Agent SDK capabilities, from basic usage to advanced control mechanisms.

How to install Claude Agent

This entry records only its repository, not the path inside it, so there is no exact command to give. Open kmcclosk/claude-agent and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Agent does

A comprehensive collection of examples demonstrating the Claude Agent SDK capabilities, from basic usage to advanced control mechanisms.

Alternatives in Development

  • Dive — Dive is an open-source MCP Host Desktop Application that seamlessly integrates with any LLMs supporting functi 1.8k ★
  • Claude Engineer — A version of command line interface(CLI) that leverages the power of Claude Opus(3-4.7) 954 ★
  • WP Abilities API — WordPress capabilities and permissions API 902 ★

README

Claude Agent SDK Examples

A comprehensive collection of examples demonstrating the Claude Agent SDK capabilities, from basic usage to advanced control mechanisms.

📦 Installation

npm install
npm run build  # Compile TypeScript

📚 Documentation

🎯 Examples

1. Simple Example (`src/simple-example.ts`)

A beginner-friendly introduction to the Claude Agent SDK.

**Features:**

  • Basic agent initialization
  • Message handling
  • Cost tracking
  • Token usage monitoring

**Usage:**

npm run simple
# or
npx tsx src/simple-example.ts

**What it does:** Creates a TODO list application demonstrating basic agent capabilities with limited tools (FileWrite, FileRead).


2. Interactive Agent (`src/interactive-agent.ts`)

Advanced example showing how to steer and intervene in agent execution.

**Features:**

  • Bidirectional streaming communication - Send messages during execution
  • Real-time control methods - interrupt(), changeModel(), setPermissionMode()
  • Dynamic permissions - Runtime permission management
  • Hook system - Intervention points for monitoring and control
  • AbortController - External cancellation
  • Interactive CLI - Command-line interface for control

**Usage:**

# Run automated demonstration
npm run interactive:demo
# or
npx tsx src/interactive-agent.ts demo

# Run interactive CLI
npm run interactive:cli
# or
npx tsx src/interactive-agent.ts cli

**CLI Commands:**

  • /msg - Send message to agent
  • /model - Change model (opus/sonnet/haiku)
  • /perm - Toggle permission (writes/reads/commands)
  • /interrupt - Interrupt current execution
  • /pause - Pause execution
  • /resume - Resume execution
  • /history - Show execution history
  • /stop - Stop and exit

3. Example Agent (`src/example-a