agentleFS
russmckendrickrussmckendrick/tokenuse/AGENTS.md

tokenuse

AGENTS.md35 starsChanged 6 months agoMITView on GitHub

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 0 are common, 1 is distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before finishing code changes, run the same local pass as the CI check jobs: cargo fmt --check, cargo check, cargo clippy --all-targets …

    line 6
  2. Very specific:

    Run all desktop pnpm commands non-interactively with CI=true so pnpm never stops on a no-TTY module purge prompt.

    line 9
  3. Distinctive:

    If a required dependency/check command fails because the sandbox blocks registry or network access, rerun the same command with network …

    line 10
  4. Very specific:

    Update embedded pricing: cargo run -- --refresh-prices - never hand-edit costs/pricing-upstream.json or src/pricing/snapshot.json.

    line 11
  5. Very specific:

    Update embedded currency rates: cargo run -- --generate-currency-json - never hand-edit costs/exchange-rates.json.

    line 12
  6. Very specific:

    Default builds include confirmed Config-page downloads for local exchange-rate/pricing files.

    line 13
  7. Very specific:

    All shipped user-facing wording belongs in src/copy/copy.json and is exposed through src/copy/mod.rs / Tauri snapshots.

    line 20
  8. Very specific:

    Add user-visible changes that affect shipped behavior or documented workflows to docs/releases/unreleased.md.

    line 25
  9. Very specific:

    Do not bump Cargo.toml, edit Cargo.lock just for a version change, or create a numbered docs/releases/<version>.md unless Russ explicitly …

    line 26
  10. Very specific:

    When Russ asks to prep a release, choose a short human-readable release name, move the relevant unreleased.md notes into …

    line 27
  11. Very specific:

    Keep docs/architecture.md, docs/usage.md, and the docs/tools/<name>.md files in sync with the code they describe.

    line 29
  12. Very specific:

    Update docs/README.md whenever a new top-level doc lands so the index stays current.

    line 30

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

AGENTS.md

Tooling

  • Code discovery via /codebase-memory. This repo is indexed by the codebase-memory-mcp server. Prefer its tools (search_graph, trace_path, get_code_snippet, get_architecture, query_graph, search_code) for locating functions, callers, call chains, or architecture overviews — they return structured graph results in a fraction of the tokens that grep/Read would burn. Fall back to Grep/Read only for plain-text content (markdown, configs, fixtures) or when the graph is stale. If the index is missing or out of date, run index_repository first; detect_changes maps a working-tree diff to affected symbols.
  • Before finishing code changes, run the same local pass as the CI check jobs: cargo fmt --check, cargo check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test from the repo root.
  • For desktop changes, also mirror the CI desktop check job: from desktop/, run CI=true pnpm run check and CI=true pnpm run build; from desktop/src-tauri/, run cargo check.
  • For dependency changes and every release, audit both Rust lockfiles from the repo root with cargo audit --file Cargo.lock and cargo audit --file desktop/src-tauri/Cargo.lock, then run CI=true pnpm audit --audit-level low from desktop/. Use cargo-audit 0.22.2 to match CI and fetch current advisory data; include development dependencies. Audit service/network failures are failed checks, not clean results. Review and report advisory warnings as well as vulnerabilities; do not add ignores or weaken the audit threshold just to publish.
  • Run all desktop pnpm commands non-interactively with CI=true so pnpm never stops on a no-TTY module purge prompt.
  • If a required dependency/check command fails because the sandbox blocks registry or network access, rerun the same command with network approval instead of retrying in the sandbox.
  • Update embedded pricing: cargo run -- --refresh-prices - never hand-edit costs/pricing-upstream.json or src/pricing/snapshot.json.
  • Update embedded currency rates: cargo run -- --generate-currency-json - never hand-edit costs/exchange-rates.json.
  • Default builds include confirmed Config-page downloads for local exchange-rate/pricing files. Use --no-default-features for a no-download build; ureq remains gated behind the refresh-prices and refresh-currency features.

Non-obvious rules

  • Consult DESIGN.md before any UI/theme change - the color tokens, density rules, and "no rounded card styling" guidance are enforced.
  • Ingest results are cached at ~/.cache/tokenuse/ingest-cache.json (TTL 15 min). On startup a fresh cache is reused so the dashboard opens fast; a stale or missing cache falls through to a synchronous ingest. A background refresher then re-runs ingest every 15 min and on the 'r' key, writing back to the cache. There is no live file watching - the timer is the only auto-refresh signal. Subcommands like --list-projects always run a fresh ingest and bypass the cache.
  • DashboardData fields are &'static str. Sample data uses string literals; ingested data is leaked via the leak() helper in src/ingest/pipeline.rs. Do not change these to String without auditing every renderer.
  • All shipped user-facing wording belongs in src/copy/copy.json and is exposed through src/copy/mod.rs / Tauri snapshots. Rust and Svelte should reference copy keys, not inline display strings, except for protocol IDs, parser fixtures, CSS classes, file names, and data-derived values.
  • The dashboard reads usage files directly - no Anthropic/OpenAI platform API keys, no proxy, no telemetry. Don't add network calls outside explicit Config-page downloads or maintainer refresh feature paths. The one inbound exception is the opt-in MCP HTTP endpoint (tokenuse mcp --http, desktop Config toggle): loopback-only, bearer-token-gated, serves local data to local clients, and makes no outbound calls - see src/mcp/http.rs and docs/development/architecture.md before touching it. The opt-in quota-sync feature stores a Claude.ai or ChatGPT session cookie locally (OS keychain) and calls those services' user-facing usage endpoints on explicit Config-page sync and, once a provider is opted in, from the 15-minute background refresher. Copilot's opt-in artifact is its sidecar file rather than a cookie - deleting limits/copilot.json stops its auto-refresh. See docs/development/tools/claude-subscription.md, docs/development/tools/codex-subscription.md, and docs/development/tools/copilot.md before adjusting that flow.

Documentation

  • Add user-visible changes that affect shipped behavior or documented workflows to docs/releases/unreleased.md.
  • Do not bump Cargo.toml, edit Cargo.lock just for a version change, or create a numbered docs/releases/<version>.md unless Russ explicitly asks to prep a release.
  • When Russ asks to prep a release, choose a short human-readable release name, move the relevant unreleased.md notes into docs/releases/<version>.md using that name in the title and intro, then bump Cargo.toml and let Cargo update Cargo.lock in the same change.
  • Before tagging a release, run all root and desktop checks above, even for a small release, plus both Rust audits and the frontend audit. Keep the root Cargo package, desktop Cargo package, desktop/package.json, and desktop/src-tauri/tauri.conf.json versions aligned, and regenerate both Cargo lockfiles through Cargo. Confirm the final commit passes the root/desktop CI matrix and audit jobs before pushing its tag. Release builds depend on the audits, and the release workflow publishes the checked-in release title and notes. Verify the published assets, updater manifest, and distribution jobs after the tag finishes.
  • Keep docs/architecture.md, docs/usage.md, and the docs/tools/<name>.md files in sync with the code they describe. If you change page routing, ingestion behavior, or a tool adapter's source schema, update the matching doc in the same change.
  • Update docs/README.md whenever a new top-level doc lands so the index stays current.

Tool Adapter Conventions

  • User-facing docs and UI call Claude Code, Cursor, Codex, and Copilot tools. The Rust adapter trait is named ToolAdapter and lives under src/tools/.
  • Each tool adapter lives in src/tools/<name>/{mod,config,discovery,parser}.rs. All paths, env vars, globs, and SQL queries belong in that adapter's config.rs - not in a shared top-level config.
  • Adding a tool: write the four adapter files, register it in tools::registry() (src/tools/mod.rs), add a variant to app::Tool, update ingest::matches_tool, update display labels such as tool_short_label, and write docs/tools/<name>.md.
  • Limits-only adapters (e.g. claude_subscription, codex_subscription) may omit discovery.rs and parser.rs and instead inline a minimal sidecar discovery in mod.rs; they emit only LimitSnapshot rows and tag them with the existing display tool ID (e.g. "claude-code", "codex") so the gauges appear in the same section as that tool's spend. No app::Tool variant, matches_tool arm, or session ingestion is needed for those.
  • config::TOOL_ID must match the literal ingest::matches_tool compares against - they are stringly typed across the boundary.
  • Claude Code, Cursor, Codex, and Copilot all have implemented parsers. Read docs/tools/<name>.md for the source schema and parser caveats before changing one.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.