Usage4Claude: Instructions file for Claude Code

CLAUDE.md

Usage4Claude CLAUDE.md is an instructions file for Claude Code from f-is-h/Usage4Claude. It costs 957 tokens per session, scanned A, original, MIT.

A project guide for Usage4Claude, a macOS menu bar app that tracks Claude and Codex subscription usage. It documents the app’s code layout, build and test commands, conventions, and known problems.

In plain words
What is it for?
Use it when working on this Swift and SwiftUI app, especially when building, running tests, checking translations, or locating services, models, and authentication code.
Why use it?
It gives coding agents the project context needed to make changes without guessing how the app is organised or built.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions Codex.

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/f-is-h/usage4claude/claude-md"><img src="https://agentmods.dev/badge/instructions/f-is-h/usage4claude/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 957 This file is loaded in full into every session.
When invoked 957 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.00957 $0.00957
Opus 5.5 $0.00383 $0.00383
Sonnet 5.5 $0.00191 $0.00191
Haiku 4.5 $0.00096 $0.00096

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

Security

Grade A, and why

Usage4Claude 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 28d 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 · 48 lines

How it starts

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

Usage4Claude — Project Overview

A macOS menu bar app that monitors Claude / Codex subscription usage. Swift + SwiftUI + AppKit, targeting macOS 13+.

Build & Test

  • Unit tests: swift test (SwiftPM only tests pure functions, runs in seconds; Package.swift uses a sources allowlist — newly extracted pure-function files must be added manually before they're testable)
  • Full build: ./scripts/build.sh --config Debug (.xcodeproj is the authoritative build; SwiftPM exists only for testing)
  • Localization consistency: python3 scripts/check_l10n.py (checks key sync across 7 languages; enforced in CI)
  • Website: python3 website/build.py regenerates the 7 homepages from website/src (template + strings); generated files are committed, --check runs in CI. Never hand-edit the generated index.html files — see website/README.md

Architecture Map

  • App/: entry point, MenuBarManager (coordinates UI and data), icon rendering (MenuBarIconRenderer/ShapeIconRenderer)
  • Services/: ClaudeAPIService (cookie and OAuth dual paths), CodexAPIService (two-step auth), OAuthTokenCache (actor: token caching + refresh single-flight), KeychainManager (uses UserDefaults in DEBUG!), *OAuth/ (PKCE + local callback server)
  • Models/: UserSettings is the settings facade; accounts/refresh policy/launch-at-login/appearance have been split out into AccountStore/SmartRefreshPolicy/LaunchAtLoginManager/AppearanceManager
  • Helpers/DataRefreshManager.swift: scheduled refresh, Codex's three-tier token refresh chain, reset verification
  • Localization: L.xxx accessors (Helpers/LocalizationHelper.swift) → Resources/*.lproj/Localizable.strings; new keys must be synced across all 7 languages (de/en/fr/ja/ko/zh-Hans/zh-Hant)
  • Tests/: SwiftPM test target, only covers pure-function files listed in Package.swift's sources
  • .agents/skills/: ready-made skills exist for release and screenshot capture (capture-usage4claude-screenshots)

Key Conventions

Read the full file on GitHub · 48 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. 28d ago Changed · +5 lines · +154 tokens per session 21df00ce5936
  2. 1mo ago Changed · +2 lines · +50 tokens per session edf4e60bcb33
  3. 1mo ago First seen · 41 lines · 753 tokens per session scan A bfda22493739

Subscribe to this mod's changes

Usage4Claude CLAUDE.md is an instructions file published in the GitHub repository f-is-h/Usage4Claude (411 stars, last pushed 29d ago), licensed MIT. It adds 957 tokens to every session, about $0.0038 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

Other instructions, from other repositories