/cookbook:streaming-chat-with-citationsfrom cookbook
Use the modern Platform Chat API to send a permission-aware question, continue the conversation, and read server-sent events with the official TypeScript API client's `createStream` `EventStream`.
Ships in cookbook. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
npx and npm. Install Node from https://nodejs.org if needed.chat scope through DCRBuild "Stream a cited Chat response" following https://developers.glean.com/cookbook/streaming-chat-with-citations
Use nonsecret inputs the user already supplied. Ask only for missing information needed by the selected recipe path, resolving dependent choices before continuing. Do not request credential values in conversation; use the recipe's documented secure sign-in or secret-entry path. Required questions for this recipe are:
Follow the selected authentication path. If OAuth is selected, run the recipe's shipped login command with its declared scopes. If the documented token path is selected, skip OAuth login and use that path's declared secure configuration. Keep sign-in and secret entry user-controlled. Do not implement or alter OAuth while setting up the recipe, and do not silently substitute a path when the documented one fails.
Run the step commands in one shell session, starting in the directory where the project should be
created. A cd in one step still applies to later steps, so do not repeat it. If your tool starts
each command in a fresh process, run each later command from the directory the earlier cd entered.
A step marked (new terminal) runs while an earlier step keeps running: start it in a new shell in
the starting directory, and run the steps after it in that shell.
Scaffold the project
Copies the runnable TypeScript Chat CLI and fixture tests into a new directory. OAuth login and secure token storage come from the pinned @gleanwork/auth package.
npx -y [email protected] gleanwork/glean-cookbook/recipes/streaming-chat-with-citations streaming-chat-with-citations
Install dependencies
cd streaming-chat-with-citations && npm install
Run the fixture tests
Runs Vitest with MSW-backed fixtures, without credentials or live network access, covering typed createStream events, exact-once delta composition, conversation_id propagation, citation separation, and typed SDK error formatting.
npm test
Sign in with OAuth
Discovers your Glean backend from work email and completes Authorization Code with PKCE for Chat and offline_access. Use --server-url for an explicit backend. If DCR is restricted, set GLEAN_OAUTH_CLIENT_ID for an administrator-provisioned public client. If OAuth is not available, set GLEAN_API_TOKEN later as a user-scoped fallback.
npm run login -- --email "<work-email>"
Run one streamed Chat turn
Sends a question through createStream and prints grounded citation data against your own instance. Pipes receive each raw Markdown delta as it arrives. Interactive terminals buffer one complete answer and render it once.
npm run verify -- --email "<work-email>" --prompt "<chat-question>"
Stream a follow-up
Starts a stored conversation, consumes createStream events for each answer, and sends a follow-up using the returned conversation_id. Raw output streams incrementally; terminal-rendered output is buffered per turn.
npm start -- --email "<work-email>" --prompt "<chat-question>" --follow-up "<follow-up-question>"
Run the command in this chat and report its concise result rather than reproducing routine install or debug output. Do not invent a browser URL. Then give the first verification action.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub gleanwork/glean-cookbook --plugin cookbook19 skills in this plugin
/batch-retrieve-documentsRetrieve up to 100 indexed documents you can open in Glean, mixing document IDs and URLs. Documents Glean does not return are listed under warnings./browse-cookbookUse when the user asks what Glean cookbook recipes exist, wants to browse or pick a recipe to build, or asks "what can I build with Glean" — lists the available recipes and points to the matching /cookbook:{recipe-id} command./cookbook-conventionsShared setup, authentication, browser handoff, documentation lookup, Web SDK sizing, and visual conventions for Glean cookbook recipes.