ghub: Instructions file for Codex

AGENTS.md

ghub AGENTS.md is an instructions file for Codex, OpenCode from tszaks/ghub. It costs 653 tokens per session, scanned A, original, MIT.

A repository-specific instruction guide for coding agents working on ghub, a TypeScript server and command-line tool for Google services. It records the project map, build and test commands, conventions, and restrictions.

In plain words
What is it for?
Use it when changing ghub to find the right code, install and build commands, type-check and test procedures, and rules for keeping compiled output in sync.
Why use it?
It prevents an agent from guessing how the project works or skipping required generated files and checks. It also documents safe test configuration and which source files handle each responsibility.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md.

This is tszaks/ghub's own configuration. It tells Codex and OpenCode how to work on ghub itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ghub configures →

View source ↗ tszaks/ghub
Reuse

Borrowing it

Nothing to install: this file belongs to tszaks/ghub. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/tszaks/ghub/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/tszaks/ghub

Made for: Codex, OpenCode.

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 ghub AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tszaks/ghub/agents-md/github.svg)](https://agentmods.dev/instructions/tszaks/ghub/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/tszaks/ghub/agents-md"><img src="https://agentmods.dev/badge/instructions/tszaks/ghub/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ghub AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tszaks/ghub/agents-md"><img src="https://agentmods.dev/badge/instructions/tszaks/ghub/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 653 This file is loaded in full into every session.
When invoked 653 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00653 $0.00653
Opus 5.5 $0.00261 $0.00261
Sonnet 5.5 $0.00131 $0.00131
Haiku 4.5 $0.00065 $0.00065

Measured 13d ago against content hash 25f5a8b88ff8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

ghub AGENTS.md 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 13d ago.

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.

AGENTS.md · 35 lines

How it starts

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

AGENTS.md

ghub is a TypeScript (Node 20+, ESM) MCP server and JSON CLI for Gmail, Drive, Sheets, Docs, and Calendar across several Google accounts. This file is for AI agents that work on the code. To use ghub as a tool, read docs/agent-cli.md.

Build and test

  • Install: npm install (the postinstall step compiles an OCR helper only if swiftc exists). In CI-like runs use npm ci --ignore-scripts.
  • Build: npm run build. Typecheck: npm run typecheck.
  • Test: GMAILMCPCONFIG_DIR=$(mktemp -d) npm test. Tests are mocked and never call Google. Always point GMAILMCPCONFIG_DIR at an empty folder.
  • List tools without any account: node dist/index.js tools. Schema of one tool: node dist/index.js schema TOOL.
  • dist/ is committed on purpose. After any change in src/, run npm run build and commit the result. CI fails on drift.

Code map

  • src/index.ts: entrypoint. No args or mcp starts the MCP server, anything else runs the CLI.
  • src/mcp.ts: stdio or SSE transport selection (MCP_TRANSPORT, PORT, HOST).
  • src/app.ts: the tool registry, MCP request handlers, and tool implementations.
  • src/cli.ts, src/cli-contract.ts, src/cli-schema.ts: the CLI, its JSON envelope, and schema output.
  • src/gmail-client.ts: Google API clients, OAuth scopes, Gmail, Drive, Sheets, Docs, Calendar calls.
  • src/accounts.ts, src/account-session.ts, src/config.ts: account store and config directory.
  • src/attachments.ts, vendor/ocr/: attachment extraction and the macOS OCR helper.
  • src/outgoing-email.ts: message building (encoding, threading, attachments).
  • test/: node --test suites. docs/: CLI guide and spec, release process, API reference.

Conventions

  • Match the surrounding code: naming, comment density, idiom.
  • Keep the tool count and docs honest: README.md and docs/agent-cli.md state the number of tools. Update both when you add or remove one.
  • Every tool has a kind (read, write, auth). Write tools require an explicit account.
  • CLI stdout is exactly one JSON object. Do not print diagnostics to stdout.
  • Never log or return tokens, secrets, authorization codes, or raw Google errors.

Read the full file on GitHub · 35 lines

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. 13d ago First seen · 35 lines · 653 tokens per session scan A 25f5a8b88ff8

Subscribe to this mod's changes

ghub AGENTS.md is an instructions file published in the GitHub repository tszaks/ghub (4 stars, last pushed 14d ago), licensed MIT. It adds 653 tokens to every session, about $0.0026 per session on Opus 5.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-10-25.

Related

ghub AGENTS.md compared with instructions from other repositories

ghub AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ghub AGENTS.mdtszaks/ghubInstructions file414d agoMITA653Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k3d agoMITA4,313Codex, OpenCode