htmx

htmx is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 98 tokens per session (3,598 once invoked), scanned C, original, MIT.

A way to add interactive behavior to server-rendered HTML by sending requests and replacing parts of a page, without adopting a JavaScript application framework.

In plain words
What is it for?
Use it for form submissions, search, infinite scrolling, inline editing, and other page updates in apps built with server-side templates.
Why use it?
It avoids building a separate client-side application and avoids sending JSON that the browser must turn back into HTML.

Skill for Claude CodeCodex

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

Good fit Use it for form submissions, search, infinite scrolling, inline editing, and other page updates in apps built with server-side templates.

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

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 htmx

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/htmx"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/htmx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,598 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 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.00098 $0.03598
Opus 5 $0.00049 $0.01799
Sonnet 5 $0.00020 $0.00720
Haiku 4.5 $0.00010 $0.00360

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

Security

Grade C, and why

htmx scanned grade C 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 5d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- Response to POST /cart/add: swap the row in normally... -->
skills/htmx/SKILL.md · 262 lines

How it starts

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

htmx: hypermedia-driven UIs

The server owns all application state and renders HTML. The client is dumb: it swaps server-rendered fragments into the DOM. There is no JSON API for the UI, no client store, no virtual DOM, no client router. If you find yourself returning JSON and rendering it with JavaScript, you have stopped doing htmx and started building an SPA — use a different tool.

The unit of work is one request, described by four attributes on one element:

  1. a verb — hx-get / hx-post / hx-put / hx-patch / hx-delete (the URL)
  2. hx-target — which DOM node receives the response (CSS selector or this)
  3. hx-swap — how the response is placed (default innerHTML)
  4. hx-trigger — on what event (default: natural — click for buttons, submit for forms, change for inputs)

Versions (verify before pinning). htmx 2.0.x is current stable (2.0.10 latest 2.x line); v1 (1.9.x) is legacy, kept only for IE/old-browser support. htmx v4 is in beta targeting Summer 2026 and changes some defaults (default swap behavior, config) — do not write to v4 yet. Pin to 2.x:

<script src="https://unpkg.com/[email protected]" crossorigin="anonymous"></script>

When to use

  • Adding interactivity to a server-rendered app without a JS framework.
  • Wiring a verb + hx-target + hx-swap + hx-trigger to update a page region.
  • Returning partials/fragments — full page on direct navigation, fragment on htmx request (branch on the HX-Request header).
  • Out-of-band updates (hx-swap-oob) when one response must refresh several regions.
  • Trigger-driven UX: active search, infinite scroll, inline edit, click-to-load, polling, revealed, intersect, debounced input.
  • Server-driven control flow via response headers (HX-Trigger, HX-Redirect, …).

When NOT to use — route elsewhere

  • A client-state-heavy SPA (offline, optimistic UI everywhere, complex client routing) → react, vue-nuxt, svelte, solid-js, angular, or ../nextjs/SKILL.md. htmx is the anti-SPA; do not fight it.
  • How to structure the server framework itself (routers, ORM, controllers) → ../fastapi/SKILL.md, django, rails, laravel. This skill owns the htmx contract (which fragment, which header, which swap), not framework internals. Cross-link, do not duplicate.
  • Generic XSS/CSP/auth theory → ../secure-coding/SKILL.md. Keep only the htmx-specific notes here.
  • Focus management and ARIA live regions after a swap → accessibility.
  • Browser E2E of swaps → testing-web / e2e-testing.
  • Purely-client state (Alpine, vanilla sprinkles) → out of scope; htmx is for server round-trips.

Read the full file on GitHub · 262 lines

Files

What ships with it

5 files 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. 5d ago First seen · 262 lines · 98 tokens per session scan C e49d1cc50b8b

Subscribe to this mod's changes

htmx is a skill published in the GitHub repository ericrisco/rsc-harness (74 stars, last pushed 2d ago), licensed MIT. It adds 98 tokens to every session and 3,598 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.