agentleFS
AnthropicKnown publisheranthropics/claude-quickstarts/managed-agents/chat-sdk/CLAUDE.md

claude-quickstarts / chat-sdk

CLAUDE.md18k starsChanged 2 months agoMITView on GitHub

Long-running Node server (Hono): browser chat with a sessions sidebar (useChat → /api/chat) → Chat SDK web adapter onDirectMessage → one Managed Agents session per conversation, where the conversation ID is the session ID (no mapping, no database; the sidebar is sessions.list, transcript replay is sessions.events.list) → a held session event stream (opened with event_deltas token previews, always on) feeds each fragment back onto the same HTTP response while /api/activity streams the tool calls and thinking the page shows as…

Trending

More talk lately.about the whole repository

Dec 2025: 3 mentionsJan 2026: 4 mentionsFeb 2026: 2 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 1 mentionSep 2026: 7 mentionsOct 2026: 3 mentionsNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the anthropics/claude-quickstarts repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about anthropics/claude-quickstarts

The biggest 5 of 23 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 23

Talked about on GitHub and Bluesky (23 times).

On GitHub · 22

17 more on GitHub

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    After the base bot works, offer extensions: Ask the user which (if any) they want, then edit setup/agent-config.ts, setup/create-agent.ts, …

    line 25
  2. Very specific:

    Re-enable bash: only with an approval surface.

    line 32
  3. Very specific:

    Run the server with npm run dev and open http://localhost:3000.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Chat SDK × Claude Managed Agents analyst

Long-running Node server (Hono): browser chat with a sessions sidebar (useChat → /api/chat) → Chat SDK web adapter onDirectMessage → one Managed Agents session per conversation, where the conversation ID is the session ID (no mapping, no database; the sidebar is sessions.list, transcript replay is sessions.events.list) → a held session event stream (opened with event_deltas token previews, always on) feeds each fragment back onto the same HTTP response while /api/activity streams the tool calls and thinking the page shows as a live feed. Each research turn closes with a kept tool-call trace (a fenced ```tools message the page renders as a collapsible list, re-derived from the event log on replay -- toolsFence in src/brief.ts) and a Chat SDK JSX card ("Brief ready", src/card.tsx) whose web fallback the page renders as a styled card.

sidebar ──▶ GET/POST /api/sessions ─────▶ /v1/sessions (list, create)
        ──▶ GET /api/history ───────────▶ /v1/sessions/{id}/events (replay)

browser (useChat) ──▶ POST /api/chat ──▶ onDirectMessage
                                              │ conversation ID
                                              │ = session ID          ┌───────────────────┐
   held HTTP response ◀── thread.post() ◀─────┴──▶ session ──────────▶│ analyst (opus)    │
   (the reply types itself out,               │                       │ web search, fetch │
    then the "brief ready" card)              │                       └───────────────────┘
   /api/activity (SSE) ◀── TurnHooks.activity ┘    event_start / event_delta,
   (web_search: ..., thinking)                     agent.message, tool_use

Needs @anthropic-ai/sdk ≥ 0.109.0 (the first release with event_deltas and accumulateManagedAgentsEvent); streaming is gated per org while the 2026-07-01 update rolls out (skill.md, "Token previews are gated per org").

When the user asks to set this up, get it working, or debug it

  1. Invoke /claude-api first. That skill loads the full Managed Agents API reference (agents, sessions, environments, events, webhooks, outcomes, multiagent, vaults, memory stores). Use it as the source of truth for any SDK call you write or edit. Don't guess field names.
  2. Read ./skill.md and walk the user through it step by step. It has the ordered checklist, every gotcha (the awaited handler and why fire-and-forget breaks here, preview reconciliation, sessions-as-state and the ownedSession check on browser-supplied conversation IDs, getUser as the single auth boundary for all four API routes, the never-stored card and its strict client-side validation, the streaming org gate, proxies reaping the held response), and the debugging table.
  3. After the base bot works, offer extensions. Ask the user which (if any) they want, then edit setup/agent-config.ts, setup/create-agent.ts, and/or src/managed-agents.ts accordingly:

    • Multiagent red-team pass: a second toolless reviewer agent on the analyst's roster (multiagent: {type: "coordinator", agents: [...]}) that critiques every draft brief in a session thread; the handoff events (session.thread_created, agent.thread_message_sent/received) arrive on the same stream the bridge already reads, so they can feed the activity feed
    • Memory store: the analyst remembers the user's interests and past briefs across sessions (resources: [{type: "memory_store", ...}] on sessions.create)
    • Outcomes: rubric-grade each brief before it sends (user.define_outcome event instead of user.message)
    • GitHub repo mount: research an open-source repo from the inside (resources: [{type: "github_repository", ...}])
    • MCP tools: wire an external data MCP server (mcp_servers + mcp_toolset on the agent, credentials via a vault, vault_ids on the session)
    • Another surface: add the Slack, Teams, Discord, Telegram, or WhatsApp adapter next to the web one in src/bot.ts. The bridge doesn't change (the JSX card starts rendering natively, though the fenced tool-call trace stays raw text -- filter or restyle it per surface), but those are webhook surfaces: the handler must ack in seconds and post later, so dispatch their turns fire-and-forget instead of awaiting, and the handler must create a session per new platform thread and keep the mapping -- the web shortcut of conversation-ID-as-session-ID doesn't travel (see skill.md, "Two held streams")
    • Re-enable bash: only with an approval surface. It's disabled because the agent reads untrusted web pages (see skill.md, "Why bash is off")

    Pull exact shapes from the /claude-api skill's shared/managed-agents-*.md docs.

Run the server with npm run dev and open http://localhost:3000. One-time agent provisioning is npm run setup.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.