Claude Agent Sdk Demo banner
bkdev98 bkdev98

Claude Agent Sdk Demo

Testing community

Description

Claude Agent SDK experiment for testing usage with Max Subscription.

Installation

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

README

agent-sdk-demo

A small chat playground built on top of the [Claude Agent SDK for Python](https://github.com/anthropics/claude-agent-sdk-python). Streams responses from a locally-spawned `claude` CLI, exposes them through SSE to a Next.js + [prompt-kit](https://www.prompt-kit.com) UI, and lets you drive tools, system prompts and permissions via slash commands.

![agent-sdk-demo chat with the slash-command menu open](docs/hero.png)

┌────────────┐     SSE      ┌────────────┐     spawn     ┌──────────┐
│  Next.js   │ ───────────▶ │  FastAPI   │ ────────────▶ │ claude   │
│  (web/)    │   /api/chat  │  (server/) │  Agent SDK    │   CLI    │
└────────────┘              └────────────┘               └──────────┘

Why this exists

  • Verify the Python Agent SDK end-to-end with a real UI.
  • Authenticate only with the local CLI's stored login (claude /login); the backend strips token env vars before spawning.
  • Show off prompt-kit components in a polished chat layout.

Quick start

# 1. Backend
uv sync
uv run uvicorn server.main:app --host 127.0.0.1 --port 8000

# 2. Frontend (in another shell)
cd web
npm install
npm run dev
# open http://localhost:3000

You need an existing `claude` CLI login on this machine. If you don't have one, run `claude /login` once.

Smoke-test with no UI:

uv run python demo.py

Slash commands

Type `/` in the composer to open a typeahead.

Command Effect
/help List all commands
/clear Reset conversation + session
/cost Last turn's cost / latency
/ping Quick PONG round-trip
/joke Ask Claude for a programming joke
/system Override the system prompt for next turns
/model Pin a model (e.g. claude-sonnet-4-6)
/tools Enable tools. demo exposes the in-process SDK MCP tools (roll_dice, flip_coin, now) defined in server/sdk_tools.py
/deny D