Internal Google Apps Script tools submit prompts to a shared Sheet. A laptop worker picks them up with claude -p and writes the answers back. No public endpoints. No API keys in the cloud.
GAS (or the CLI) appends a row: uuid, prompt, status pending.
Worker polls, sets processing, stamps claimed_by.
Spawns claude -p. Optional tools stream progress live.
Status becomes done or error. Caller polls and reads the response.
The day job is a pile of Google Apps Script web apps. They needed Claude-quality text without putting Anthropic keys in every project or standing up a server.
Summaries, rewrites, classification, structured extraction, draft emails, ticket text. Latency of 5–15s is fine. Quality matters more than tokens-per-second.
Interactive chat, streaming typeahead, high-volume production APIs, or anything that cannot wait on a laptop that might sleep.
Singleton-locked poll loop. Claims rows, runs plain or tool-using prompts, writes response or error, streams progress for tool mode.
Drop-in helper: submit, status, poll, ask. Sheet ID from Script Properties only.
Enqueue a prompt from the terminal and wait for the worker to finish. Useful when wiring a new machine.
Parses Claude stream-json events so column K can show live tool progress to polling clients.
Copy the library into any Apps Script project, set one Script Property, then call:
// Sync (short prompts; watch the 6-minute GAS cap) const result = ClaudeQueue.ask("summarize this: " + text); if (result.status === 'done') return result.response; // Async for web apps: submit, return id, client polls const id = ClaudeQueue.submit(prompt, { model: 'claude-sonnet-4-6', tools: 'Bash(gws sheets values get:*)' }); // later: ClaudeQueue.status(id) → { status, response, progress }
MIT licensed. Clone it, create your own queue spreadsheet, set SHEET_ID, run the worker.