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
- Very specific: line 6
Before finishing code changes, run the same local pass as the CI check jobs: cargo fmt --check, cargo check, cargo clippy --all-targets …
- Very specific: line 9
Run all desktop pnpm commands non-interactively with CI=true so pnpm never stops on a no-TTY module purge prompt.
- Distinctive: line 10
If a required dependency/check command fails because the sandbox blocks registry or network access, rerun the same command with network …
- Very specific: line 11
Update embedded pricing: cargo run -- --refresh-prices - never hand-edit costs/pricing-upstream.json or src/pricing/snapshot.json.
- Very specific: line 12
Update embedded currency rates: cargo run -- --generate-currency-json - never hand-edit costs/exchange-rates.json.
- Very specific: line 13
Default builds include confirmed Config-page downloads for local exchange-rate/pricing files.
- Very specific: line 20
All shipped user-facing wording belongs in src/copy/copy.json and is exposed through src/copy/mod.rs / Tauri snapshots.
- Very specific: line 25
Add user-visible changes that affect shipped behavior or documented workflows to docs/releases/unreleased.md.
- Very specific: line 26
Do not bump Cargo.toml, edit Cargo.lock just for a version change, or create a numbered docs/releases/<version>.md unless Russ explicitly …
- Very specific: line 27
When Russ asks to prep a release, choose a short human-readable release name, move the relevant unreleased.md notes into …
- Very specific: line 29
Keep docs/architecture.md, docs/usage.md, and the docs/tools/<name>.md files in sync with the code they describe.
- Very specific: line 30
Update docs/README.md whenever a new top-level doc lands so the index stays current.
≈ “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.
Files
AGENTS.md
Tooling
- Code discovery via
/codebase-memory. This repo is indexed by thecodebase-memory-mcpserver. 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 thatgrep/Readwould burn. Fall back toGrep/Readonly for plain-text content (markdown, configs, fixtures) or when the graph is stale. If the index is missing or out of date, runindex_repositoryfirst;detect_changesmaps 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, andcargo testfrom the repo root. - For desktop changes, also mirror the CI desktop check job: from
desktop/, runCI=true pnpm run checkandCI=true pnpm run build; fromdesktop/src-tauri/, runcargo check. - For dependency changes and every release, audit both Rust lockfiles from the repo root with
cargo audit --file Cargo.lockandcargo audit --file desktop/src-tauri/Cargo.lock, then runCI=true pnpm audit --audit-level lowfromdesktop/. 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
pnpmcommands non-interactively withCI=trueso 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-editcosts/pricing-upstream.jsonorsrc/pricing/snapshot.json. - Update embedded currency rates:
cargo run -- --generate-currency-json- never hand-editcosts/exchange-rates.json. - Default builds include confirmed Config-page downloads for local exchange-rate/pricing files. Use
--no-default-featuresfor a no-download build;ureqremains gated behind therefresh-pricesandrefresh-currencyfeatures.
Non-obvious rules
- Consult
DESIGN.mdbefore 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-projectsalways run a fresh ingest and bypass the cache. DashboardDatafields are&'static str. Sample data uses string literals; ingested data is leaked via theleak()helper insrc/ingest/pipeline.rs. Do not change these toStringwithout auditing every renderer.- All shipped user-facing wording belongs in
src/copy/copy.jsonand is exposed throughsrc/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 - seesrc/mcp/http.rsanddocs/development/architecture.mdbefore touching it. The opt-inquota-syncfeature 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 - deletinglimits/copilot.jsonstops its auto-refresh. Seedocs/development/tools/claude-subscription.md,docs/development/tools/codex-subscription.md, anddocs/development/tools/copilot.mdbefore 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, editCargo.lockjust for a version change, or create a numbereddocs/releases/<version>.mdunless 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.mdnotes intodocs/releases/<version>.mdusing that name in the title and intro, then bumpCargo.tomland let Cargo updateCargo.lockin 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, anddesktop/src-tauri/tauri.conf.jsonversions 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 thedocs/tools/<name>.mdfiles 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.mdwhenever 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
ToolAdapterand lives undersrc/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'sconfig.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 toapp::Tool, updateingest::matches_tool, update display labels such astool_short_label, and writedocs/tools/<name>.md. - Limits-only adapters (e.g.
claude_subscription,codex_subscription) may omitdiscovery.rsandparser.rsand instead inline a minimal sidecar discovery inmod.rs; they emit onlyLimitSnapshotrows 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. Noapp::Toolvariant,matches_toolarm, or session ingestion is needed for those. config::TOOL_IDmust match the literalingest::matches_toolcompares against - they are stringly typed across the boundary.- Claude Code, Cursor, Codex, and Copilot all have implemented parsers. Read
docs/tools/<name>.mdfor the source schema and parser caveats before changing one.
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
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.

