oauth-callback CLAUDE.md

Project instructions for the oauth-callback TypeScript package, which handles OAuth sign-in callbacks and related token storage. OAuth is a standard way for an application to obtain permission to use another service on a user's behalf.

In plain words
What is it for?
Use it when working on browser-based authentication, HTTP callback handling, token expiry, in-memory or file-based token storage, and integrations with the Model Context Protocol SDK.
Why use it?
It gives contributors the project's documented structure, modules, exports, design decisions, and specifications so changes follow the existing codebase.

Instructions file

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 instructions/kriasoft/oauth-callback/claude-md
Clone the repo
git clone --depth 1 https://github.com/kriasoft/oauth-callback
Per session 739 This file is loaded in full into every session.
When invoked 739 The same file — it is already loaded in full.
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.00739 $0.00739
Opus 5 $0.00369 $0.00369
Sonnet 5 $0.00148 $0.00148
Haiku 4.5 $0.00074 $0.00074

Measured yesterday against content hash 1c759d511072, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

oauth-callback CLAUDE.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 yesterday.

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.

CLAUDE.md · 71 lines

How it starts

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

OAuth Callback Project Guide

Documentation

ADRs (docs/adr/NNN-slug.md): Architectural decisions (reference as ADR-NNN)
SPECs (docs/specs/slug.md): Design specifications (reference as SPEC-slug)

Project Structure

oauth-callback/
├── src/                     # Source code
│   ├── index.ts             # Main entry - exports getAuthCode(), OAuthError, mcp namespace
│   ├── mcp.ts               # MCP SDK exports - browserAuth(), storage, types
│   ├── server.ts            # HTTP server for OAuth callbacks
│   ├── errors.ts            # OAuthError class and error handling
│   ├── mcp-types.ts         # TypeScript interfaces for MCP integration
│   ├── auth/                # Authentication providers
│   │   ├── browser-auth.ts  # MCP SDK-compatible OAuth provider
│   │   └── browser-auth.test.ts
│   ├── storage/             # Token storage implementations
│   │   ├── memory.ts        # In-memory token store
│   │   └── file.ts          # Persistent file-based token store
│   └── utils/               # Utility functions
│       └── token.ts         # Token expiry calculations
│
├── templates/               # HTML templates for callback pages
│   ├── success.html         # Success page with animated checkmark
│   ├── error.html           # Error page for OAuth failures
│   └── build.ts             # Template compiler (bundles HTML into TypeScript)
│
├── examples/                # Usage examples
│   ├── demo.ts              # Interactive demo with mock OAuth server
│   ├── github.ts            # GitHub OAuth integration example
│   └── notion.ts            # Notion MCP with Dynamic Client Registration
│
├── dist/                    # Build output (generated)
│   ├── index.js             # Main bundle
│   ├── index.d.ts           # Main TypeScript declarations
│   ├── mcp.js               # MCP-specific bundle
│   ├── mcp.d.ts            # MCP TypeScript declarations
│   └── ...
│
├── package.json             # Project metadata and dependencies
├── tsconfig.json            # TypeScript configuration
├── README.md                # User documentation
└── CLAUDE.md                # This file - AI assistant context

Read the full file on GitHub · 71 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. yesterday First seen · 71 lines · 739 tokens per session scan A 1c759d511072

Subscribe to this mod's changes

oauth-callback CLAUDE.md is an instructions file published in the GitHub repository kriasoft/oauth-callback (11 stars, last pushed 7mo ago), licensed MIT. It adds 739 tokens to every session, about $0.0037 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.