google-workspace

google-workspace is a skill for Claude Code, Codex from mitsuhiko/agent-stuff. It costs 40 tokens per session (904 once invoked), scanned A, original, Apache-2.0.

A collection of local helper scripts for Google Workspace services, including Drive, Docs, Calendar, Gmail, Sheets, Slides, Chat, and People. It uses OAuth sign-in and separate profiles identified by email address.

In plain words
What is it for?
Listing or editing Workspace data through scripted API calls, such as finding Drive files, reading documents, working with calendars, or accessing Gmail for a chosen account.
Why use it?
It lets an agent call Workspace APIs without manually handling each service’s authentication and request details. Requiring an email profile helps select the intended signed-in account.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/mitsuhiko/agent-stuff/google-workspace
Any agent
npx skills add mitsuhiko/agent-stuff --skill google-workspace
Clone the repo
git clone --depth 1 https://github.com/mitsuhiko/agent-stuff

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for google-workspace

README.md
[![agentmods](https://agentmods.dev/badge/skills/mitsuhiko/agent-stuff/google-workspace.svg)](https://agentmods.dev/skills/mitsuhiko/agent-stuff/google-workspace)
Your own site
<a href="https://agentmods.dev/skills/mitsuhiko/agent-stuff/google-workspace"><img src="https://agentmods.dev/badge/skills/mitsuhiko/agent-stuff/google-workspace.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.00904
Opus 5 $0.00020 $0.00452
Sonnet 5 $0.00008 $0.00181
Haiku 4.5 $0.00004 $0.00090

Measured 4d ago against content hash 35c23e0802a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

google-workspace scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/auth.js, scripts/common.js, scripts/workspace.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/google-workspace/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Google Workspace

Use this skill for Google Workspace tasks (Gmail, Drive, Calendar, Docs, Sheets, etc.).

Files

  • scripts/auth.js — OAuth login/status/clear + account enumeration
  • scripts/workspace.js — JavaScript execution based API runner

Account model (multi-account)

This skill is profile-based by email address.

  • There is no default account.
  • Every API call must specify --email <[email protected]>.
  • Tokens are stored per-email under ~/.pi/google-workspace/tokens/.

Before running API calls, discover available signed-in accounts:

node scripts/auth.js accounts

Usage

Always use exec and always provide --email.

node scripts/workspace.js exec --email [email protected] <<'JS'
const me = await workspace.whoAmI();
const files = await workspace.call('drive', 'files.list', {
  pageSize: 5,
  fields: 'files(id,name,mimeType)',
});
return { me, files: files.files };
JS

Available inside exec scripts:

  • auth (authorized OAuth client)
  • google (googleapis root)
  • workspace.accountEmail (selected profile email)
  • workspace.call(service, methodPath, params, {version})
  • workspace.service(service, {version})
  • workspace.whoAmI()

Optional flags:

  • --timeout <ms> (default 30000, max 300000)
  • --scopes s1,s2
  • --script 'return 42'

Agent guidance

  1. Prefer one exec script per user request.
  2. Keep payloads small (fields, maxResults, minimal props).
  3. Use Promise.all for independent requests.
  4. Never print token contents.
  5. If the user did not specify an account, run node scripts/auth.js accounts and choose/confirm an explicit email.
  6. If auth fails, first run node scripts/auth.js accounts to see known profiles.
  7. If account mismatch is possible, run workspace.whoAmI() in the selected profile.
  8. On 401/403/unauthorized errors, switch account (--email ...) or re-login that specific profile.

Unauthorized/account-switch playbook

If a request fails with unauthorized/forbidden/insufficient permissions:

Read the full file on GitHub · 138 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 138 lines · 40 tokens per session scan A 35c23e0802a3

Subscribe to this mod's changes

google-workspace is a skill published in the GitHub repository mitsuhiko/agent-stuff (3,044 stars, last pushed 2d ago), licensed Apache-2.0. It adds 40 tokens to every session and 904 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.