Open source · Apps Script · Claude Code

A spreadsheet as
an LLM job queue.

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.

View on GitHub How it works
Architecture
Claude Queue architecture Apps Script callers append jobs to a Google Sheet queue. A local Node worker polls pending rows, runs claude -p, and writes responses back. Callers poll status until done. append row poll status claim pending write response spawn GAS callers Web apps, triggers, bound scripts Queue sheet id · prompt · status response · tools · progress Google Sheets Worker Node on your machine poll every 3s · gws Claude Code CLI claude -p [ --allowed-tools … ] Auth stays local Worker uses gws OAuth on the laptop. GAS uses SpreadsheetApp. No tunnel, no webhook URL, no cloud API key in Script Properties.
Caller
Queue
Worker
Claude CLI
request
response / poll
01

Submit

GAS (or the CLI) appends a row: uuid, prompt, status pending.

02

Claim

Worker polls, sets processing, stamps claimed_by.

03

Run

Spawns claude -p. Optional tools stream progress live.

04

Write back

Status becomes done or error. Caller polls and reads the response.

Built for internal tools, not chat UIs

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.

Good fit

When it shines

Summaries, rewrites, classification, structured extraction, draft emails, ticket text. Latency of 5–15s is fine. Quality matters more than tokens-per-second.

Wrong tool

When to skip it

Interactive chat, streaming typeahead, high-volume production APIs, or anything that cannot wait on a laptop that might sleep.

What ships in the repo

worker.js
Node · gws · claude -p

Singleton-locked poll loop. Claims rows, runs plain or tool-using prompts, writes response or error, streams progress for tool mode.

ClaudeQueue.gs
Apps Script library

Drop-in helper: submit, status, poll, ask. Sheet ID from Script Properties only.

submit.js
CLI smoke test

Enqueue a prompt from the terminal and wait for the worker to finish. Useful when wiring a new machine.

streamParser.js
Tool-use progress

Parses Claude stream-json events so column K can show live tool progress to polling clients.

pending submitted processing claimed done response ready error error_message set

Caller surface

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 }

Point your tools at a sheet.
Leave Claude on the laptop.

MIT licensed. Clone it, create your own queue spreadsheet, set SHEET_ID, run the worker.

github.com/sammersheikh/claude-queue
Google Sheets Apps Script Node.js Claude Code CLI gws