write-events

write-events is a skill for Claude Code from thenativeweb/claude-plugins. It costs 39 tokens per session (725 once invoked), scanned A, original, MIT.

A procedure for writing events to EventSourcingDB, a database that stores changes as an ordered history of events.

In plain words
What is it for?
Use it to store, append, or publish one or more events, including operations that require optimistic locking or subject constraints.
Why use it?
It explains how to find the database address and token, format event data, and apply optional checks before appending events.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the esdb plugin — 11 skills shipped together

Good fit Use it to store, append, or publish one or more events, including operations that require optimistic locking or subject constraints.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add thenativeweb/claude-plugins
Claude Code
/plugin install esdb

Made for: Claude Code.

Or install esdb, the plugin that ships this one along with the rest of its 11 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 write-events

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/thenativeweb/claude-plugins/write-events"><img src="https://agentmods.dev/badge/skills/thenativeweb/claude-plugins/write-events.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 725 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00039 $0.00725
Opus 5.5 $0.00016 $0.00290
Sonnet 5.5 $0.00008 $0.00145
Haiku 4.5 $0.00004 $0.00072

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

Security

Grade A, and why

write-events scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -i -X POST \
plugins/esdb/skills/write-events/SKILL.md · 97 lines

How it starts

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

Write Events

Write one or more events to an EventSourcingDB instance.

Shared Instructions

First read ${CLAUDE_PLUGIN_ROOT}/shared/common.md. It explains how to determine the base URL and API token, how to handle NDJSON responses, and which conventions apply. Follow it throughout this skill.

Also read ${CLAUDE_PLUGIN_ROOT}/shared/cloudevents.md. It explains which event fields you must provide, which are server-managed, and how the fields are validated.

Request

curl -s -i -X POST \
  -H "authorization: Bearer ${ESDB_API_TOKEN}" \
  -H "content-type: application/json" \
  -d '<REQUEST_BODY>' \
  "${ESDB_URL:-http://localhost:3000}/api/v1/write-events"

Request Body

{
  "events": [
    {
      "source": "<source-url>",
      "subject": "/<subject-path>",
      "type": "<reverse.domain.event-type>",
      "data": { ... }
    }
  ],
  "preconditions": [
    {
      "type": "<precondition-type>",
      "payload": { ... }
    }
  ]
}

The preconditions field is optional. Available precondition types:

  • isSubjectPristine – Subject must have no events yet.

    { "type": "isSubjectPristine", "payload": { "subject": "/books/42" } }
    
  • isSubjectPopulated – Subject must already have events.

    { "type": "isSubjectPopulated", "payload": { "subject": "/books/42" } }
    
  • isSubjectOnEventId – Optimistic locking: last event must match given ID.

    { "type": "isSubjectOnEventId", "payload": { "subject": "/books/42", "eventId": "0" } }
    
  • isEventQlQueryTrue – Custom condition via EventQL query.

    { "type": "isEventQlQueryTrue", "payload": { "query": "FROM e IN events WHERE e.data.title == 'Some Title' PROJECT INTO COUNT() == 0" } }
    

Example

curl -s -i -X POST \
  -H "authorization: Bearer ${ESDB_API_TOKEN}" \
  -H "content-type: application/json" \
  -d "{
    \"events\": [
      {
        \"source\": \"https://example.com\",
        \"subject\": \"/books/42\",
        \"type\": \"io.eventsourcingdb.library.book-acquired\",
        \"data\": {
          \"title\": \"2001 - A Space Odyssey\",
          \"author\": \"Arthur C. Clarke\"
        }
      }
    ]
  }" \
  "${ESDB_URL:-http://localhost:3000}/api/v1/write-events"

Read the full file on GitHub · 97 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. 1mo ago First seen · 97 lines · 39 tokens per session scan A be02ac8a3e75

Subscribe to this mod's changes

write-events is a skill published in the GitHub repository thenativeweb/claude-plugins (6 stars, last pushed 3mo ago), licensed MIT. It adds 39 tokens to every session and 725 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). 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

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens

platform-custom-field-generate

Use when users create, generate, or validate Salesforce Custom Field metadata. Trigger on custom fields, field types, Roll-Up Summary, Master-Detail/Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from a field, or scoping picklist values per record type; also…

forcedotcom/sf-skills · 139 tokens

field-service-sobject-create-configure

Headless 360 REST API deployment step for creating sObject records. Handles describe-based field discovery, required-field derivation, entity-relationship ordering, and composite graph transactions. Use this skill when a designer skill (or a user directly) needs to create sObject records after design confirmation…

forcedotcom/sf-skills · 74 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

nornicdb-grpc

Drive NornicDB over gRPC — the Qdrant-compatible surface (Collections, Points, Snapshots) plus the additive NornicSearch service. Use when ingesting via Qdrant SDKs, migrating from Qdrant, or running hybrid text+vector search from a non-Bolt client. Covers connection, RPC catalog, collection→database mapping…

orneryd/NornicDB · 98 tokens