redis-streams-rails

redis-streams-rails is a skill for Claude Code, Codex from sandeepmvl/rails-skills. It costs 102 tokens per session (2,030 once invoked), scanned A, original, MIT.

Guidance for using Redis Streams, a Redis data structure that keeps an ordered, replayable record of messages, in Rails applications. It covers adding messages, consumer groups, acknowledgements, pending messages, retention limits, and when Kafka may be a better fit.

In plain words
What is it for?
Use it to design or review Rails event pipelines, configure Redis Streams consumers, acknowledge and reclaim work, cap retention, and decide when to move to Kafka.
Why use it?
It helps teams add durable message processing using Redis they already operate, while avoiding common problems such as unbounded storage or abandoned messages.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design or review Rails event pipelines, configure Redis Streams consumers, acknowledge and reclaim work, cap retention, and decide when to move to Kafka.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sandeepmvl/rails-skills/45-redis-streams-rails
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 sandeepmvl/rails-skills --skill 45-redis-streams-rails
Clone the repo
git clone --depth 1 https://github.com/sandeepmvl/rails-skills

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 redis-streams-rails

README.md
[![agentmods](https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/45-redis-streams-rails/github.svg)](https://agentmods.dev/skills/sandeepmvl/rails-skills/45-redis-streams-rails)
Your own site
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/45-redis-streams-rails"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/45-redis-streams-rails/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 redis-streams-rails

Your own site · 80×15
<a href="https://agentmods.dev/skills/sandeepmvl/rails-skills/45-redis-streams-rails"><img src="https://agentmods.dev/badge/skills/sandeepmvl/rails-skills/45-redis-streams-rails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,030 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.00102 $0.02030
Opus 5.5 $0.00041 $0.00812
Sonnet 5.5 $0.00020 $0.00406
Haiku 4.5 $0.00010 $0.00203

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

Security

Grade A, and why

redis-streams-rails 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 2mo 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/45-redis-streams-rails/SKILL.md · 248 lines

How it starts

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

Redis Streams

Redis Streams is the "I already have Redis, give me Kafka-ish semantics without a new operational dependency" option. Good up to medium throughput, single-region, and short retention. Outgrows the pattern at high throughput / long retention — that's Kafka territory.

The opinion

Use Redis Streams when you already run Redis (you almost certainly do) and you need pub/sub-with-history + consumer groups, but don't yet justify Kafka's operational cost. Cap streams with MAXLEN. Use consumer groups with manual acknowledgement. Periodically claim entries idle for > N minutes (PEL handling). Plan to migrate to Kafka if throughput exceeds ~10k events/sec sustained or you need cross-region replication.

Why Redis Streams over plain pub/sub

Feature Redis pub/sub Redis Streams
Persistence None (drop on publish if no subscriber) Disk + AOF
Replay None Yes (read from any offset)
Consumer groups No Yes
Acknowledgement No Yes (XACK)
Pending tracking No Yes (XPENDING)
Memory growth None Bounded with MAXLEN

If you need anything beyond fire-and-forget broadcasts: Streams, not pub/sub.

Setup

# Gemfile
gem "redis", "~> 6.0"
gem "connection_pool"  # for thread-safe sharing
# config/initializers/redis.rb
REDIS_STREAMS = ConnectionPool.new(size: 10, timeout: 5) do
  Redis.new(url: ENV.fetch("REDIS_STREAMS_URL"))
end

Pattern 1: Producing (XADD)

class EventPublisher
  STREAM = "orders.events"
  MAX_LEN = 1_000_000  # approximate cap

  def self.publish(event_type:, payload:)
    REDIS_STREAMS.with do |redis|
      redis.xadd(
        STREAM,
        {
          event_type: event_type,
          payload: payload.to_json,
          published_at: Time.current.iso8601
        },
        maxlen: MAX_LEN,
        approximate: true  # ~ trim — Redis trims when convenient, much faster
      )
    end
  end
end

EventPublisher.publish(
  event_type: "order.placed",
  payload: { order_id: 42, account_id: 7, total_cents: 12_500 }
)

Read the full file on GitHub · 248 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. 2mo ago Changed 2bad1f619b71
  2. 3mo ago First seen · 248 lines · 102 tokens per session scan A 4a0e946cba24

Subscribe to this mod's changes

redis-streams-rails is a skill published in the GitHub repository sandeepmvl/rails-skills (22 stars, last pushed 2mo ago), licensed MIT. It adds 102 tokens to every session and 2,030 once invoked, about $0.0004 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-30.

Related

redis-streams-rails compared with skills from other repositories

redis-streams-rails next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
redis-streams-railssandeepmvl/rails-skillsSkill222mo agoMITA102Claude Code, Codex
using-redis-token-bucketsPostHog/posthog-fossSkill736todayMITA148Claude Code, Codex
using-redis-token-bucketsPostHog/posthogSkill41ktodaynoneA148Claude Code, Codex
background-job-orchestratorcuriositech/some_claude_skillsSkill2845d agoMITA95Claude Code
spring-data-redisrrezartprebreza/spring-boot-skillsSkill37415d agoMITA37Claude Code, Codex
idempotency-handlingsecondsky/claude-skillsSkill2573d agoMITA46Claude Code
bullmqzhe-qi/clhoria-templateSkill1945d agoMITA45Claude Code