olkcli: Instructions file for Claude Code

CLAUDE.md

olkcli CLAUDE.md is an instructions file for Claude Code from rlrghb/olkcli. It costs 3,435 tokens per session, scanned A, original, MIT.

Repository instructions for olk, a command-line tool for Outlook and OneDrive through Microsoft Graph. It provides terminal access to email, calendars, contacts, tasks, and files.

In plain words
What is it for?
Building, testing, linting, and safely changing the Go-based Outlook and OneDrive command-line tool.
Why use it?
They explain the project’s commands, architecture, authentication, and a macOS Keychain prompt that requires human approval.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; built for openclaw.

This is rlrghb/olkcli's own configuration. It tells Claude Code how to work on olkcli 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 olkcli configures →

Reuse

Borrowing it

Nothing to install: this file belongs to rlrghb/olkcli. 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/rlrghb/olkcli/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/rlrghb/olkcli

Made for: Claude Code.

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 olkcli CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/rlrghb/olkcli/claude-md/github.svg)](https://agentmods.dev/instructions/rlrghb/olkcli/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/rlrghb/olkcli/claude-md"><img src="https://agentmods.dev/badge/instructions/rlrghb/olkcli/claude-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 olkcli CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/rlrghb/olkcli/claude-md"><img src="https://agentmods.dev/badge/instructions/rlrghb/olkcli/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,435 This file is loaded in full into every session.
When invoked 3,435 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.03435 $0.03435
Opus 5.5 $0.01374 $0.01374
Sonnet 5.5 $0.00687 $0.00687
Haiku 4.5 $0.00344 $0.00344

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

Security

Grade A, and why

olkcli 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 22d 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.

CLAUDE.md · 137 lines

How it starts

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

CLAUDE.md

This file provides context for Claude Code when working on the olk project.

What is this project?

olk is a CLI tool for Microsoft Outlook and OneDrive via the Microsoft Graph API. It provides terminal access to email, calendar, contacts, tasks, and OneDrive files for both personal Microsoft accounts and enterprise Azure AD/Entra ID accounts.

Quick Reference

make build          # Build ./bin/olk (olk-dev namespace: own config and keychain entries)
make test           # Run tests
make lint           # Lint with golangci-lint
go mod tidy         # After changing dependencies

Validating on macOS: running a freshly built ./bin/olk against a real account triggers a macOS Keychain access prompt (each build is a new identity). A human must click "Always Allow" — you (an agent) can't dismiss the dialog, so don't treat a first-run hang as a bug; ask the user to approve it.

Architecture

  • CLI framework: github.com/alecthomas/kong — commands are Go structs with Run(ctx *RunContext) error
  • Auth: Raw OAuth2 against login.microsoftonline.com — no MSAL. Two flows: device code (default) and authorization-code + PKCE via system browser with a loopback listener (--browser, in internal/msauth/authcode.go) for tenants whose Conditional Access requires a compliant device or blocks device code. Both use PKCE (RFC 7636). Scopes defined in internal/msauth/scopes.go. Enterprise-only scopes (MailboxSettings.ReadWrite, User.ReadBasic.All) are only requested with --enterprise flag — personal accounts cannot consent to them. Token refresh is serialized per-email via sync.Map of mutexes to prevent race conditions
  • API: Official msgraph-sdk-go wrapped in internal/graphapi/ for ergonomic access
  • Secrets: OS keyring via github.com/99designs/keyring (macOS Keychain, Linux Secret Service, Windows WinCred). File-backend password prompt writes to stderr (not stdout) to avoid corrupting piped output. Set OLK_KEYRING_PASSWORD for headless/non-interactive use
  • Output: JSON envelope (--json), aligned table (default), TSV (--plain)
  • Provider parity: calendar JSON supports opt-in --body-format text|html, stable/lifecycle metadata, structured attendee responses, and lossless recurrence details. Mail and contact list/get/delta results expose provider synchronization IDs and timestamps. Calendar writes support --transaction-id, --no-reminder, --location none, and --all-day/--timed with validation.
  • MCP server: olk mcp (in internal/cmd/mcp*.go) runs a stdio Model Context Protocol server exposing a curated allowlist of read-first tools (curatedTools in mcp_server.go) — NOT the whole command tree. Tool calls reparse a rebuilt argv and run in-process with stdout captured under a mutex (mcp_capture.go). Read-only by default; --allow-write <tool> exposes a named curated safe-write tool (per-tool opt-in). Local file saves (attachments, .eml) are confined to --download-dir and refused without it (save_scope.go; commands write via ctx.saveDir/ctx.saveFile). No HTTP transport
  • Capability guards: --no-write/--no-send are enforced once at the graphapi.Client layer (ensureWritable/ensureMaySend), so the guarantee holds across CLI, MCP, and scripts. --enable-commands[-exact]/--disable-commands gate dispatch via commandAllowed() (commands.go), checked in Execute() and reused to filter the MCP registry. --wrap-untrusted wraps untrusted:"true"-tagged struct fields in JSON/plain output (internal/outfmt/untrusted.go)
  • Timezone: Display-layer conversion via outfmt.ConvertTime(). Resolved once per command via RunContext.Timezone() (flag > env > config > Local). JSON output emits UTC timestamps as RFC3339 with a Z suffix (normalized via normalizeGraphUTC — Graph's DateTimeTimeZone.dateTime strings lack a zone); envelope includes timezone field. IANA db embedded via import _ "time/tzdata"

Read the full file on GitHub · 137 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. 22d ago Changed · +41 tokens per session ff27d7dc9c71
  2. 26d ago Changed · +9 tokens per session 6757eff5f3c4
  3. 1mo ago Changed · +2 tokens per session 3abacf524bf3
  4. 2mo ago First seen · 137 lines · 3,383 tokens per session scan A 4e3783581cf5

Subscribe to this mod's changes

olkcli CLAUDE.md is an instructions file published in the GitHub repository rlrghb/olkcli (23 stars, last pushed 13d ago), licensed MIT. It adds 3,435 tokens to every session, about $0.0137 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-08-30.

Related

olkcli CLAUDE.md compared with instructions from other repositories

olkcli CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
olkcli CLAUDE.mdrlrghb/olkcliInstructions file2313d agoMITA3,435Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode