CodexBar AGENTS.md

Repository instructions for CodexBar, a Swift menu-bar app that checks AI provider usage, credits, limits, and configuration health. They describe the project layout, build commands, tests, release scripts, and coding conventions.

In plain words
What is it for?
Finding the right source and test files, building the app, running its test suite, packaging it, and following its release process.
Why use it?
They give coding agents the project’s expected workflow so changes fit the existing code and can be tested consistently.

Instructions file for CodexOpenCode

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/steipete/codexbar/agents-md
Clone the repo
git clone --depth 1 https://github.com/steipete/CodexBar

Made for: Codex, OpenCode.

Per session 1,449 This file is loaded in full into every session.
When invoked 1,449 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.01449 $0.01449
Opus 5 $0.00724 $0.00724
Sonnet 5 $0.00290 $0.00290
Haiku 4.5 $0.00145 $0.00145

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

Security

Grade A, and why

CodexBar 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 2d 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 · 49 lines

How it starts

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

Repository Guidelines

Project Structure & Modules

  • Sources/CodexBar: Swift 6 menu bar app (usage/credits probes, icon renderer, settings). Keep changes small and reuse existing helpers.
  • Tests/CodexBarTests: XCTest coverage for usage parsing, status probes, icon patterns; mirror new logic with focused tests.
  • Scripts: build/package helpers (package_app.sh, sign-and-notarize.sh, make_appcast.sh, build_icon.sh, compile_and_run.sh). Release wrappers call Scripts/mac-release, which resolves MAC_RELEASE_TOOL or the shared agent-scripts checkout.
  • docs: release notes and process (docs/RELEASING.md, screenshots). Root-level zips/appcast are generated artifacts—avoid editing except during releases.

Build, Test, Run

  • Dev loop: ./Scripts/compile_and_run.sh kills old instances, builds, packages, relaunches CodexBar.app, and confirms it stays running; add --test for the sharded full suite.
  • Quick build/test: swift build (debug) or swift build -c release; make test for the sharded full suite.
  • Package locally: ./Scripts/package_app.sh to refresh CodexBar.app, then restart with pkill -x CodexBar || pkill -f CodexBar.app || true; cd /Users/steipete/Projects/codexbar && open -n /Users/steipete/Projects/codexbar/CodexBar.app.
  • Release flow: ./Scripts/release.sh; app metadata lives in .mac-release.env, repo build/signing stays in Scripts/sign-and-notarize.sh, and validation steps live in docs/RELEASING.md.

Coding Style & Naming

  • Enforce SwiftFormat/SwiftLint: run swiftformat Sources Tests and swiftlint --strict. 4-space indent, 120-char lines, explicit self is intentional—do not remove.
  • Favor small, typed structs/enums; maintain existing MARK organization. Use descriptive symbols; match current commit tone.

Testing Guidelines

  • Add/extend XCTest cases under Tests/CodexBarTests/*Tests.swift (FeatureNameTests with test_caseDescription methods).
  • Swift Testing: prefer backticked sentence names; no camelCase.
  • Model names in tests/code: released models or clearly fictitious names only; never expose unreleased names.
  • Always run make test before handoff; add focused swift test --filter ... runs for parser/provider fixes when possible.
  • After any code change, run make check and fix all reported format/lint issues before handoff.
  • Prefer CLI/focused tests over app-bundle live tests when behavior can be verified without relaunching CodexBar.
  • Never run tests/checks or ad-hoc validation that can display macOS Keychain prompts. Live provider probes, browser-cookie imports, codexbar usage against real accounts, and real SecItem reads must be explicitly requested; otherwise use parser tests, stubs, test stores, or KeychainNoUIQuery.
  • macOS CI is brittle around headless AppKit status/menu tests. Prefer covering menu behavior through stable state/model seams (MenuDescriptor, ProvidersPane, CodexAccountsSectionState, etc.) instead of constructing live NSStatusBar/NSMenu flows unless the AppKit wiring itself is the thing under test.

Read the full file on GitHub · 49 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. 2d ago First seen · 49 lines · 1,449 tokens per session scan A 61c870bb0b15

Subscribe to this mod's changes

CodexBar AGENTS.md is an instructions file published in the GitHub repository steipete/CodexBar (20,730 stars, last pushed 2d ago), licensed MIT. It adds 1,449 tokens to every session, about $0.0072 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.

Related

Other instructions, from other repositories