litestar-htmx

litestar-htmx is a skill for Claude Code from litestar-org/litestar-skills. It costs 71 tokens per session (3,135 once invoked), scanned A, original, MIT.

A server-side integration between Litestar and HTMX, a browser library that updates parts of a page by sending requests without full page reloads. It provides request helpers, template responses, and typed response headers.

In plain words
What is it for?
Use it to inspect HTMX request headers, return HTML fragments, configure the HTMX plugin, and set HX response behavior.
Why use it?
It keeps HTMX-specific request and response handling consistent and separates full-page routes from partial HTML routes.

Skill for Claude Code

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

Part of the litestar plugin — 31 skills, 1 agent, 1 hook shipped together

Good fit Use it to inspect HTMX request headers, return HTML fragments, configure the HTMX plugin, and set HX response behavior.

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

Made for: Claude Code.

Or install litestar, the plugin that ships this one along with the rest of its 31 skills, 1 agent, 1 hook.

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 litestar-htmx

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/litestar-org/litestar-skills/litestar-htmx"><img src="https://agentmods.dev/badge/skills/litestar-org/litestar-skills/litestar-htmx.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,135 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.00071 $0.03135
Opus 5 $0.00036 $0.01568
Sonnet 5 $0.00014 $0.00627
Haiku 4.5 $0.00007 $0.00314

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

Security

Grade A, and why

litestar-htmx 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.

plugins/litestar/skills/litestar-htmx/SKILL.md · 341 lines

How it starts

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

litestar-htmx

litestar-htmx is the standalone Litestar integration for HTMX. Version 0.5.0 ships the litestar_htmx import package with request helpers, an optional application plugin, template responses, and typed HTMX response-header helpers.

Code Style Rules

  • Import the integration from litestar_htmx, never litestar.plugins.htmx; Litestar no longer owns this package's import surface.
  • Use HTMXRequest when handlers inspect HTMX request headers.
  • Return template fragments from HTMX endpoints; keep full-page routes and fragment routes distinct.
  • Use the response classes for HX-* headers; do not assemble those headers by hand.
  • Keep browser-side HTMX extensions separate from this server package.

Quick Reference

Configure the plugin

from litestar import Litestar
from litestar_htmx import HTMXPlugin

app = Litestar(
    route_handlers=[...],
    plugins=[HTMXPlugin()],
)

HTMXPlugin() is the convenience path: it registers the package's request and response types. Its default HTMXConfig(set_request_class_globally=True) sets HTMXRequest only when the application does not already have a request class.

Preserve an existing custom request class by extending HTMXRequest:

from litestar_htmx import HTMXRequest


class ApplicationRequest(HTMXRequest):
    """Application request with HTMX helpers."""

If the application only needs response helpers, use HTMXConfig(set_request_class_globally=False). To inspect request.htmx, configure HTMXRequest (or a subclass) as the application request class. The plugin never replaces a request class already present in AppConfig.

The plugin itself is optional. Applications can instead set request_class=HTMXRequest directly and return the response subclasses without registering HTMXPlugin.

Inspect request headers

request.htmx is always an HTMXDetails object. Its truth value is True only when HX-Request is exactly "true".

from litestar import get
from litestar.response import Template
from litestar_htmx import HTMXRequest


@get("/items")
async def list_items(request: HTMXRequest) -> Template:
    template_name = "partials/item-list.html" if request.htmx else "pages/items.html"
    return Template(template_name=template_name, context={"items": []})

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

Subscribe to this mod's changes

litestar-htmx is a skill published in the GitHub repository litestar-org/litestar-skills (14 stars, last pushed 21d ago), licensed MIT. It adds 71 tokens to every session and 3,135 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

liveview-patterns

Build LiveView: async data (assignasync), PubSub (check connected?), phx-change events, form components/modals/uploads, streams for lists, livepatch. Use when handling interactions, debugging events, or tracking Presence.

oliver-kriska/claude-elixir-phoenix · 51 tokens

cesiumjs-core-utilities

CesiumJS core utilities and networking - Resource, Color, Event, Request, RequestScheduler, error handling, helper functions, feature detection. Use when fetching remote data, managing HTTP requests, working with colors, handling events, debugging errors, or using utility functions like defined, clone, or…

CesiumGS/cesiumjs-skills · 69 tokens

fec-data-fetching

A frontend guide for handling data that comes from a server, including typed requests, caching, refreshing, pagination, and updates. Server state means data owned by an API rather than by a page’s local controls.

bovinphang/frontend-craft · 76 tokens

fec-react-project-standard

A guide for organizing medium-sized or large React and TypeScript projects. It defines boundaries between pages, business features, shared components, hooks, services, state, APIs, and utilities.

bovinphang/frontend-craft · 101 tokens

scaffold-fastapi-vite-saas

A starter project for a self-hosted web app with a FastAPI Python backend and a Vite single-page frontend in one Git repository. A monorepo is one repository that holds multiple parts of a project.

TNT-Likely/honeycomb · 170 tokens

turbo-streams-patterns

Build targeted Turbo Streams correctly — model broadcasts over Action Cable, custom stream actions, authorized stream channels, and Kredis presence. Use when adding real-time/live updates (chat append, replace a card, toggle a class), writing a custom turbo-stream action, securing who can subscribe to a record's…

davidteren/hotwire-codex-skills · 105 tokens