r3bl-open-core: Skill for Claude Code

.agents/skills/fast-string-allocations/SKILL.md

fast-string-allocations is a skill for Claude Code, Codex from r3bl-org/r3bl-open-core. It costs 36 tokens per session (563 once invoked), scanned A, original, Apache-2.0.

A guide to building strings in Rust without creating unnecessary temporary memory objects. It covers approaches such as push_str and format_no_alloc for code that runs frequently.

In plain words
What is it for?
Use it when building ANSI terminal control sequences, formatting tracing logs, or writing code that runs during a 60-frame-per-second render cycle.
Why use it?
It helps avoid slower string formatting in performance-sensitive code, such as rendering interfaces, writing logs, or handling event loops.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is r3bl-org/r3bl-open-core's own configuration. It tells Claude Code and Codex how to work on r3bl-open-core itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything r3bl-open-core configures →

Reuse

Borrowing it

Nothing to install: this file belongs to r3bl-org/r3bl-open-core. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/r3bl-org/r3bl-open-core/main/.agents/skills/fast-string-allocations/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core

Made for: Claude Code, Codex.

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 fast-string-allocations

README.md
[![agentmods](https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/fast-string-allocations/github.svg)](https://agentmods.dev/skills/r3bl-org/r3bl-open-core/fast-string-allocations)
Your own site
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/fast-string-allocations"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/fast-string-allocations/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 fast-string-allocations

Your own site · 80×15
<a href="https://agentmods.dev/skills/r3bl-org/r3bl-open-core/fast-string-allocations"><img src="https://agentmods.dev/badge/skills/r3bl-org/r3bl-open-core/fast-string-allocations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 563 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00036 $0.00563
Opus 5 $0.00018 $0.00282
Sonnet 5 $0.00007 $0.00113
Haiku 4.5 $0.00004 $0.00056

Measured 10d ago against content hash a1491a831c2c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

fast-string-allocations 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 10d 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/skills/fast-string-allocations/SKILL.md · 47 lines

How it starts

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

Fast String Allocations & Zero-Overhead Formatting

When writing code that involves string building, formatting, or rendering (especially in the TUI engine, logging, or event loops), you MUST adhere to the codebase's strict zero-allocation architecture.

When to Use

  • When building ANSI escape sequences
  • When building strings in a 60 FPS event loop or render cycle
  • When using tracing::*! macros
  • Whenever you are tempted to use format! or write! on a Formatter

Core Strategy

Read the full Source of Truth at mod@crate::core::common::fast_strings#string-allocation-performance-strategy for detailed architectural constraints.

Performance Hierarchy (Fastest to Slowest)

  1. Direct push_str() - Zero overhead, direct memory copy.
  2. crate::format_no_alloc! - Zero heap allocations, reuses existing heap.
  3. FastStringify - Temporary heap allocation, completely bypasses Formatter state machine.
  4. inline_string! - Stack allocated (16 bytes), but dynamically spills to the heap if exceeded.
  5. format! / write! - Always heap allocates (format!) OR uses heavy formatter overhead (write!). Avoid in hot paths.

Implementation Guidelines

1. The FastStringify Trait

Use for custom types (like ANSI codes) that are serialized millions of times.

  • Bypasses the expensive Formatter state machine by pushing everything into a temporary heap String and making ONE f.write_str() call.
  • Use generate_impl_display_for_fast_stringify! to auto-generate the Display block.

2. The inline_string! Macro

Use for stack-allocated strings (16 bytes).

  • Drop-in replacement for format!.
  • The primary use case is the core Editor Component and tracing::*! macros.
  • Warning: If text exceeds 16 bytes, it spills to the heap and incurs the cost of format!.

3. The format_no_alloc! Macro

Use for hot loops where the string is guaranteed to exceed 16 bytes (meaning inline_string! would spill).

  • Hoist a String::with_capacity(N) outside the loop.
  • Pass the hoisted string into the macro inside the loop to clear and write into the existing capacity.
  • Zero allocations per tick.

Read the full file on GitHub · 47 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. 10d ago First seen · 47 lines · 36 tokens per session scan A a1491a831c2c

Subscribe to this mod's changes

fast-string-allocations is a skill published in the GitHub repository r3bl-org/r3bl-open-core (483 stars, last pushed 3d ago), licensed Apache-2.0. It adds 36 tokens to every session and 563 once invoked, about $0.0002 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 skills, from other repositories