event-sourcing

event-sourcing is a skill for Claude Code from sethdford/claude-skills. It costs 40 tokens per session (587 once invoked), scanned A, original, MIT.

A software design guide for event sourcing, a way of storing every state change as an unchangeable event log instead of only storing the latest value.

In plain words
What is it for?
Use it when designing audit trails, event logs, replayable state, event schemas, snapshots, projections, or systems that need historical views.
Why use it?
It preserves the full history of what happened, making systems easier to audit, analyze over time, replay, and connect to event-driven processing.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the data-architecture plugin — 8 skills shipped together

Good fit Use it when designing audit trails, event logs, replayable state, event schemas, snapshots, projections, or systems that need historical views.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sethdford/claude-skills/event-sourcing
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 sethdford/claude-skills --skill event-sourcing
Clone the repo
git clone --depth 1 https://github.com/sethdford/claude-skills

Made for: Claude Code.

Or install data-architecture, the plugin that ships this one along with the rest of its 8 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 event-sourcing

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sethdford/claude-skills/event-sourcing"><img src="https://agentmods.dev/badge/skills/sethdford/claude-skills/event-sourcing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 587 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.00040 $0.00587
Opus 5 $0.00020 $0.00293
Sonnet 5 $0.00008 $0.00117
Haiku 4.5 $0.00004 $0.00059

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

Security

Grade A, and why

event-sourcing 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 11d 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.

architect/data-architecture/skills/event-sourcing/SKILL.md · 48 lines

How it starts

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

Event Sourcing

Build auditable systems by storing complete history of state changes as immutable events rather than current values.

Context

You are designing a system requiring auditability, temporal analysis, or replay capability. Event sourcing provides complete history and enables powerful event-driven architectures. Read domain requirements and existing event-driven patterns.

Domain Context

Based on Greg Young's event sourcing work and CQRS patterns:

  • Event Store: Append-only log of domain events; immutable, ordered
  • Aggregate Reconstruction: Replay events to reconstruct current state on-demand
  • Snapshots: Optimize replay by storing intermediate state; trade storage for speed
  • Event Versioning: Events evolve; handle schema changes in replays
  • Projections: Materialize different views from event stream (CQRS read models)

Instructions

  1. Identify Core Events: What state changes matter? Order placed, payment received, shipment dispatched. Each event is fact about domain; captured in past tense.

  2. Design Event Schema: Each event contains timestamp, aggregate ID, type, data. Include enough context to understand intent (who, when, why).

  3. Plan Aggregate Boundaries: Group related events into aggregates. Order aggregate: contains all events for single order. Enables consistent snapshots and replay.

  4. Implement Snapshot Strategy: Full replay from beginning gets slow. Snapshot order state every 100 events; replay only from last snapshot. Balance storage and speed.

  5. Create Read Projections: Maintain materialized views (current-state, analytics) from event stream. These are caches; can be rebuilt from events anytime.

Anti-Patterns

  • Event Sourcing Everything: Overkill for simple systems. Event store adds complexity. Guard: Use only when auditability or temporal queries justify cost.
  • Storing Mutable Events: Treat events as modifiable records. Result: history changes, audit trail meaningless. Guard: Events are immutable facts; never modify.
  • No Event Versioning Strategy: Events change, old replays break. Result: can't handle evolution. Guard: Version events; handle multiple versions in replay logic.
  • Ignoring Snapshot Consistency: Snapshots diverge from event stream. Result: data inconsistency. Guard: Snapshots are optimization; rebuild from events periodically to verify.

Read the full file on GitHub · 48 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. 11d ago First seen · 48 lines · 40 tokens per session scan A c54f75e2d808

Subscribe to this mod's changes

event-sourcing is a skill published in the GitHub repository sethdford/claude-skills (40 stars, last pushed 6mo ago), licensed MIT. It adds 40 tokens to every session and 587 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.