agentleFS
ronrefaelronrefael/sonde/CLAUDE.md

sonde

CLAUDE.md2 starsChanged 8 months agoMITView on GitHub

sonde: precision instrumentation that continuously measures AI usage and reports conditions in real-time. Rust statusline binary (Phase 1), macOS menu bar app in Swift (Phase 2).

  • Reads credentials

The file

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

7 rules. About 0 are common, 0 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    All config structs: #[derive(Debug, Deserialize, Default)], all fields pub Option<T>

    line 12
  2. Very specific:

    Never use ? operator where a warning is needed -- use explicit match

    line 16
  3. Very specific:

    Create src/modules/{name}.rs with pub fn render(ctx: &Context, cfg: &SondeConfig) -> Option<String>

    line 22
  4. Very specific:

    Add match arm in src/modules/mod.rs

    line 23
  5. Very specific:

    Test fixtures in tests/fixtures/

    line 53
  6. Very specific:

    Use rstest for parameterized tests

    line 55
  7. Very specific:

    Use assert_cmd for CLI integration tests

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
CLAUDE.md

sonde — Claude Code Instructions

What this project is

sonde: precision instrumentation that continuously measures AI usage and reports conditions in real-time. Rust statusline binary (Phase 1), macOS menu bar app in Swift (Phase 2).

Non-negotiable code patterns

  • Module interface: pub fn render(ctx: &Context, cfg: &SondeConfig) -> Option<String>
  • All config structs: #[derive(Debug, Deserialize, Default)], all fields pub Option<T>
  • Context struct: all Option<T>, NO deny_unknown_fields (forward-compatible)
  • Disabled flag -> silent None (no warning)
  • Missing data -> explicit match + tracing::warn! + None
  • Never use ? operator where a warning is needed -- use explicit match
  • stdout owned ONLY by main.rs; all diagnostics via tracing::* to stderr
  • OAuth token: NEVER written to disk, cache, stdout, or stderr

Adding a new module (2 files max)

  1. Create src/modules/{name}.rs with pub fn render(ctx: &Context, cfg: &SondeConfig) -> Option<String>
  2. Add match arm in src/modules/mod.rs

File ownership rules

  • stdin reading: src/context.rs ONLY
  • stdout writing: src/main.rs ONLY
  • HTTP calls: src/usage_api.rs ONLY (OAuth) and src/promo.rs ONLY (PromoClock)
  • Credential access: src/platform.rs ONLY
  • Cache I/O: src/cache.rs ONLY
  • Config parsing: src/config.rs ONLY
  • ANSI styling: src/ansi.rs ONLY

Key APIs

Claude Code OAuth usage endpoint

GET https://api.anthropic.com/api/oauth/usage Authorization: Bearer {token} anthropic-beta: oauth-2025-04-20

PromoClock API

GET https://promoclock.co/api/status

Credential locations

  • macOS: security find-generic-password -s "Claude Code-credentials" -w
  • Linux: ~/.claude/.credentials.json
  • Linux fallback: secret-tool lookup service "Claude Code-credentials"

Testing

  • echo '{"model":{"display_name":"Opus"}}' | cargo run to test
  • Test fixtures in tests/fixtures/
  • Mock HTTP calls in tests -- never hit real APIs
  • Use rstest for parameterized tests
  • Use assert_cmd for CLI integration tests

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.