Documentation/Specialized/Claude Agent Sdk
šŸ”¬

Claude Agent Sdk

v1.4.0Apache 2.0

Validation and quality enforcement for Claude Agent SDK projects with TypeScript type checking and structure validation.

Installation

Install han binary (required for hooks to work):

curl -fsSL https://han.guru/install.sh | bash

Then install this plugin:

han plugin install claude-agent-sdk

Overview

Validation and quality enforcement for Claude Agent SDK projects.

What This Plugin Provides

Validation Hooks

  • TypeScript Type Checking: Validates types in SDK projects with tsc --noEmit
  • Structure Validation: Ensures correct .claude/ directory structure
    • Agents must be .md files in .claude/agents/
    • Skills must be SKILL.md in .claude/skills/{skill-name}/
    • Skills must be SKILL.md in .claude/skills/{skill-name}/

Skills

This plugin provides the following skills:

  • agent-creation: Agent initialization, configuration, and setup patterns
  • tool-integration: Working with tools, permissions, and MCP servers
  • context-management: Managing agent memory and context

Installation

Install via the Han marketplace:

bash
han plugin install claude-agent-sdk

Or install manually:

bash
claude plugin marketplace add thebushidocollective/han
claude plugin install claude-agent-sdk@han

Usage

Once installed, this plugin automatically validates your Claude Agent SDK projects:

  • When you finish a conversation with Claude Code
  • Before commits (when combined with git hooks)
  • Validates TypeScript types and SDK structure

What Gets Validated

TypeScript Validation

Runs tsc --noEmit to check:

  • Type correctness in agent configurations
  • Tool permission types
  • Setting source definitions
  • API authentication types

Structure Validation

Checks .claude/ directory compliance:

  • Agent files are Markdown (.md)
  • Skill files follow SKILL.md naming
  • Proper directory structure

Requirements

  • Node.js 18+
  • TypeScript 5.0+
  • @anthropic-ai/claude-agent-sdk package

Example Project Structure

my-agent-project/
ā”œā”€ā”€ .claude/
│   ā”œā”€ā”€ CLAUDE.md
│   ā”œā”€ā”€ agents/
│   │   └── specialist.md
│   └── skills/
│       └── my-skill/
│           └── SKILL.md
ā”œā”€ā”€ src/
│   └── index.ts
ā”œā”€ā”€ package.json
└── tsconfig.json

Skills

Hooks

āš ļø

Token Usage Notice

Hooks run automatically during Claude Code sessions and their output is sent to the model for processing. This may increase token usage and associated costs. Consider disabling hooks you don't need via han-config.yml.

šŸ›‘

Stop

Runs when the main Claude Code agent has finished responding. Can verify task completion, check quality gates, or ensure documentation requirements are met before the session ends.

npx -y --package typescript tsc