write-error-divergence

write-error-divergence is a skill for Claude Code, Codex from PlamenTSV/plamen. It costs 32 tokens per session (611 once invoked), scanned A, original, MIT.

A code-audit skill for file and database writes that update stored data alongside metadata, indexes, caches, or checkpoints. It checks whether these parts agree when a write fails.

In plain words
What is it for?
It is for reviewing file writes, database transactions, batches, commits, cache updates, indexes, temporary files, renames, flushes, and recovery paths.
Why use it?
It helps prevent a program from reporting success or advancing its metadata when the actual data was not saved. Such mismatches can appear after a crash or restart.

Skill for Claude CodeCodex

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

Good fit It is for reviewing file writes, database transactions, batches, commits, cache updates, indexes, temporary files, renames, flushes, and recovery paths.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plamentsv/plamen/write-error-divergence
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 PlamenTSV/plamen --skill write-error-divergence
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

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 write-error-divergence

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/plamentsv/plamen/write-error-divergence"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/write-error-divergence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 611 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.00032 $0.00611
Opus 5.5 $0.00013 $0.00244
Sonnet 5.5 $0.00006 $0.00122
Haiku 4.5 $0.00003 $0.00061

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

Security

Grade A, and why

write-error-divergence 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.

agents/skills/injectable/l1/write-error-divergence/SKILL.md · 49 lines

How it starts

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

Injectable Skill: Write Error Divergence

L1 trigger: STORAGE or DATABASE_TX flag OR file/DB write APIs detected (write_all, fs::write, rename, flush, commit, put, insert, batch, transaction) Inject Into: depth-state-trace, depth-edge-case Language: Go and Rust Finding prefix: [WED-N]

Purpose

Node clients often pair durable writes with in-memory metadata, indexes, caches, or database transactions. If metadata advances before the durable write succeeds, restart or reorg behavior can diverge from the actual persisted state.

1. Write Unit Enumeration

For each storage path, enumerate the logical write unit:

Write Unit Data Write Metadata/Index Update Error Check Rollback/Cleanup Verdict

Include:

  • block/header/transaction persistence;
  • cache metadata, expiry timestamps, indices, checkpoints, migration markers;
  • database transactions and batches;
  • file writes that use temp files, rename, flush, fsync, or parent-directory fsync.

2. Required Checks

For each write unit:

  • Metadata-before-data: metadata, cache state, or checkpoint markers must not advance before the durable write succeeds.
  • Success-after-side-effect: Ok(()), HTTP success, or actor success messages must be returned only after the write and required flush/commit complete.
  • Commit-before-check: database transactions must not commit when the closure or inner operation returned an error.
  • Partial write: short writes, interrupted writes, rename failures, flush/fsync failures, and parent-directory fsync failures must be handled consistently.
  • Rollback/cleanup: failed writes must either roll back metadata or leave an explicit repair/retry marker.
  • Restart trace: trace what a node observes after restart if the write fails at each boundary.

Tag evidence as [WED-METADATA-BEFORE-DATA:{file}:{line}], [WED-COMMIT-BEFORE-CHECK:{file}:{line}], [WED-SUCCESS-BEFORE-WRITE:{file}:{line}], or [WED-RESTART-DIVERGE:{file}:{line}].

Read the full file on GitHub · 49 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. 2mo ago First seen · 49 lines · 32 tokens per session scan A 71e0d6f5113f

Subscribe to this mod's changes

write-error-divergence is a skill published in the GitHub repository PlamenTSV/plamen (320 stars, last pushed 2mo ago), licensed MIT. It adds 32 tokens to every session and 611 once invoked, about $0.0001 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-09-03.

Related

write-error-divergence compared with skills from other repositories

write-error-divergence next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
write-error-divergencePlamenTSV/plamenSkill3202mo agoMITA32Claude Code, Codex
postgresql-indexingprowler-cloud/prowlerSkill15k3d agoApache-2.0A108Claude Code
triage-issuesgoogleapis/mcp-toolboxSkill17k3d agoApache-2.0A164Claude Code, Codex
gh-awprowler-cloud/prowlerSkill15k3d agoApache-2.0A59Claude Code
sql-optimization-patternssickn33/agentic-awesome-skillsSkill51kyesterdayMITA28Claude Code
graphjin-evaldosco/graphjinSkill3.2k2d agoApache-2.0A27Claude Code, Codex
byted-bytehouse-slow-querybytedance/agentkit-samplesSkill4965d agoApache-2.0A74Claude Code, Codex