rust-observability

rust-observability is a skill for Claude Code, Codex from rewrite-rs/skills. It costs 85 tokens per session (1,239 once invoked), scanned A, original, BSD-3-Clause.

Guidance for reporting what a Rust program is doing through structured logs and tracing. Structured logs keep values such as user IDs and paths as named fields instead of hiding them inside text.

In plain words
What is it for?
Use it when adding or reviewing logs, tracing spans, metrics-related events, or `println!` calls in Rust code.
Why use it?
It makes events searchable and keeps useful context across asynchronous operations, while reducing noisy, duplicated, or accidentally exposed information.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the rewrite-rs-skills plugin — 28 skills shipped together

Good fit Use it when adding or reviewing logs, tracing spans, metrics-related events, or println! calls in Rust code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rewrite-rs/skills/rust-observability
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.

Any agent
npx skills add rewrite-rs/skills --skill rust-observability
Clone the repo
git clone --depth 1 https://github.com/rewrite-rs/skills

Made for: Claude Code, Codex.

Or install rewrite-rs-skills, the plugin that ships this one along with the rest of its 28 skills.

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 rust-observability

README.md
[![agentmods](https://agentmods.dev/badge/skills/rewrite-rs/skills/rust-observability/github.svg)](https://agentmods.dev/skills/rewrite-rs/skills/rust-observability)
Your own site
<a href="https://agentmods.dev/skills/rewrite-rs/skills/rust-observability"><img src="https://agentmods.dev/badge/skills/rewrite-rs/skills/rust-observability/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 rust-observability

Your own site · 80×15
<a href="https://agentmods.dev/skills/rewrite-rs/skills/rust-observability"><img src="https://agentmods.dev/badge/skills/rewrite-rs/skills/rust-observability.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,239 The whole file, excluding the scripts and references it only reads on demand.
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.00085 $0.01239
Opus 5.5 $0.00034 $0.00496
Sonnet 5.5 $0.00017 $0.00248
Haiku 4.5 $0.00009 $0.00124

Measured 1mo ago against content hash 91a1a72e8b2f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rust-observability 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 1mo 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.

skills/rust/rust-observability/SKILL.md · 123 lines

How it starts

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

Rust Observability

A log line is a structured event with named fields, and a library never installs a subscriber. This skill governs how Rust code reports what it is doing; what an error type contains is /rust-errors, and span behaviour across cancellation is /async-rust.

A log line is an event, not a sentence

The core move: fields stay fields. error!(user_id, %path, "config load failed") is queryable — user_id and path are named columns. The interpolated form, error!("config load failed for user {user_id} at {path}"), is a string someone will later write a regex against. The difference shows up the first time somebody needs "all failures for one user" — the moment logging either pays for itself or does not.

The three layers, and which to use

println! writes to stdout with no level, no filter, and no structure; it belongs in a CLI producing output the user asked for, never in a library. log is the older facade, right when the dependency budget is tight. tracing is the default here: spans carry context across .await points, which is the problem async code actually has.

Naming events

component.operation.state — config.load.failed, pool.connection.acquired. A consistent scheme is what makes a dashboard possible; ad-hoc English messages are what make it impossible. Message templates with placeholder syntax are one implementation of the field idea, not the idea itself — a codebase already on templates is fine.

Spans

#[tracing::instrument] on a function makes every event inside it inherit the request context; skip keeps large or secret arguments out of the fields. The rule: a span is a unit of work with a beginning and an end; an event is a point in time.

Levels and filtering

  • error! — someone should look at this.
  • warn! — something went wrong and the code handled it.
  • info! — lifecycle events a reader wants without a bug.
  • debug! / trace! — developer detail, off in production.

The boundary that matters is error!: because it means someone should look, a handled and expected failure is warn! or debug! at most. EnvFilter gives per-module control, and in a library, filtering is the whole story:

Read the full file on GitHub · 123 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 123 lines · 85 tokens per session scan A 91a1a72e8b2f

Subscribe to this mod's changes

rust-observability is a skill published in the GitHub repository rewrite-rs/skills (8 stars, last pushed 2mo ago), licensed BSD-3-Clause. It adds 85 tokens to every session and 1,239 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

rust

Expert in Rust development with focus on safety, performance, and async programming.

Mindrally/skills · 16 tokens

polars

High-performance DataFrame library for Python ETL, analytics, and pandas migration. It supports expression-based data manipulation with lazy query optimization, parallel execution, streaming out-of-core processing, Arrow interoperability, and optional GPU execution.

K-Dense-AI/scientific-agent-skills · 47 tokens

rust-engineer

Writes, reviews, and debugs idiomatic Rust code with memory safety and zero-cost abstractions. Implements ownership patterns, manages lifetimes, designs trait hierarchies, builds async applications with tokio, and structures error handling with Result/Option. Use when building Rust applications, solving ownership or…

Jeffallan/claude-skills · 120 tokens

rust-crate-ci

Load before editing any Rust crate in this repo (currently runners/swarm-sandbox-runner). Covers the mandatory local validation gate, common rustfmt/clippy pitfalls, and Windows-specific Rust correctness patterns that CI enforces but are hard to catch locally without a Windows toolchain.

ZaxbyHub/opencode-swarm · 60 tokens

kysely

Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.

Mindrally/skills · 26 tokens

beautifulsoup-parsing

Expert guidance for HTML/XML parsing using BeautifulSoup in Python with best practices for DOM navigation, data extraction, and efficient scraping workflows.

Mindrally/skills · 32 tokens