new-hybrid-atom

new-hybrid-atom is a command for Claude Code from naporin0624/claude-plugin-hono-electron. It costs 0 tokens per session (1,652 once invoked), scanned A, original, MIT.

A code-generation command for creating a Jotai state atom that receives live updates through an IPC event stream and uses HTTP as a fallback. Jotai is a JavaScript library for managing application state; IPC lets parts of a desktop app communicate.

In plain words
What is it for?
Use it to add atoms for entities such as users, notifications, or events, including their event source and renderer-side state file.
Why use it?
It gives the project a prescribed structure for combining live desktop events with a request-based backup source.

Command for Claude Code

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { {name}Atom, refresh{Entities}Atom } from '../atoms/{name}.atom';.

Part of the hono-electron-ipc plugin — 6 skills, 7 commands shipped together

Good fit Use it to add atoms for entities such as users, notifications, or events, including their event source and renderer-side state file.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/naporin0624/claude-plugin-hono-electron
agentmods
npx agentmods add commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom

Made for: Claude Code.

Or install hono-electron-ipc, the plugin that ships this one along with the rest of its 6 skills, 7 commands.

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 new-hybrid-atom

README.md
[![agentmods](https://agentmods.dev/badge/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom/github.svg)](https://agentmods.dev/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom)
Your own site
<a href="https://agentmods.dev/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom"><img src="https://agentmods.dev/badge/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom/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 new-hybrid-atom

Your own site · 80×15
<a href="https://agentmods.dev/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom"><img src="https://agentmods.dev/badge/commands/naporin0624/claude-plugin-hono-electron/new-hybrid-atom.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,652 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.00000 $0.01652
Opus 5 $0.00000 $0.00826
Sonnet 5 $0.00000 $0.00330
Haiku 4.5 $0.00000 $0.00165

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

Security

Grade A, and why

new-hybrid-atom 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.

commands/new-hybrid-atom.md · 258 lines

How it starts

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

Create New Hybrid Atom

Create a new Jotai hybrid atom with IPC stream subscription and HTTP fallback.

Parameters

  • name: The atom name (e.g., "users", "notifications", "activeEvent")
  • entity: The entity type (e.g., "User", "Notification", "Event")
  • ipcEvent: The IPC event name (e.g., "app:users", "app:notifications")

Instructions

  1. Define event source in src/renderer/src/adapters/ipc-events/index.ts
  2. Create atom file at src/renderer/src/views/atoms/{name}.atom.ts
  3. Follow hybrid pattern: Stream + HTTP fallback

Event Source Setup

// src/renderer/src/adapters/ipc-events/index.ts
import { createEventSubscription } from '@utils/event-subscription';

// Add new event source
export const {name}Source = createEventSubscription<void>('{ipcEvent}');

// For snapshot events (granular updates)
export const {name}Snapshot = createEventSubscription<{
  type: 'create' | 'update' | 'delete';
  value: {Entity};
}>('{ipcEvent}:modify');

Atom Template

// src/renderer/src/views/atoms/{name}.atom.ts
import { atom } from 'jotai';
import { atomWithRefresh } from 'jotai/utils';
import { client } from '@adapters/client';
import { {name}Source } from '@adapters/ipc-events';
import { debounce } from '@utils/debounce';

// ═══════════════════════════════════════════════════════════════════════════
// Type Definitions
// ═══════════════════════════════════════════════════════════════════════════

interface {Entity} {
  id: string;
  // Add entity fields
  name: string;
  createdAt: Date;
}

// ═══════════════════════════════════════════════════════════════════════════
// Error Classes
// ═══════════════════════════════════════════════════════════════════════════

class UnauthorizedError extends Error {
  constructor(message = 'Unauthorized') {
    super(message);
    this.name = 'UnauthorizedError';
  }
}

class UnknownError extends Error {
  constructor(message = 'Unknown error') {
    super(message);
    this.name = 'UnknownError';
  }
}

// ═══════════════════════════════════════════════════════════════════════════
// Helper Functions
// ═══════════════════════════════════════════════════════════════════════════

/**
 * Shared fetch logic for consistency between atoms.
 */
const fetch{Entities} = async (): Promise<{Entity}[]> => {
  const res = await client.{endpoint}.$get();

  if (res.status === 401) throw new UnauthorizedError();
  if (res.status === 500) throw new UnknownError();

  const data = await res.json();

  // Transform API response to domain model
  return data.map((x) => ({
    id: x.id,
    name: x.name,
    createdAt: new Date(x.createdAt),
    // Map other fields
  }));
};

// ═══════════════════════════════════════════════════════════════════════════
// Step 1: Single Fetch Atom (HTTP Fallback)
// ═══════════════════════════════════════════════════════════════════════════

/**
 * HTTP-only fetch atom.
 * Used as fallback when stream atom isn't mounted yet.
 */
const singleFetch{Entities}Atom = atomWithRefresh(
  async (): Promise<{Entity}[]> => fetch{Entities}()
);

// ═══════════════════════════════════════════════════════════════════════════
// Step 2: Stream Atom (IPC Subscription)
// ═══════════════════════════════════════════════════════════════════════════

/**
 * Stream atom with IPC subscription.
 *
 * - onMount: Sets up IPC subscription
 * - Debounces updates to prevent thrashing
 * - Returns cleanup function for subscription
 */
const stream{Entities}Atom = atom<{ value: {Entity}[] }>();

stream{Entities}Atom.onMount = (set) => {
  const handle{Entities}Update = debounce(async () => {
    try {
      const items = await fetch{Entities}();
      set({ value: items });
    } catch (e) {
      console.error('Failed to fetch {entities}:', e);
      // Keep previous data on error
    }
  }, 300);

  // Immediate initial fetch
  handle{Entities}Update();

  // Subscribe to IPC events
  return {name}Source.subscribe(handle{Entities}Update);
};

// ═══════════════════════════════════════════════════════════════════════════
// Step 3: Hybrid Selector Atom (Public API)
// ═══════════════════════════════════════════════════════════════════════════

/**
 * Hybrid atom that selects between stream and HTTP fallback.
 *
 * This is the atom that components should use.
 *
 * Read: Returns data from stream if available, otherwise HTTP fetch
 * Write: Manual refresh capability
 */
export const {name}Atom = atom(
  // Read function
  async (get) => {
    const stream = get(stream{Entities}Atom);

    // Stream not ready - use HTTP fallback
    if (stream === undefined) {
      return get(singleFetch{Entities}Atom);
    }

    // Stream ready - use stream data
    return stream.value;
  },

  // Write function (optional - for manual refresh)
  (_get, set) => {
    set(stream{Entities}Atom, undefined);  // Reset stream
    set(singleFetch{Entities}Atom);        // Trigger HTTP refetch
  }
);

// ═══════════════════════════════════════════════════════════════════════════
// Optional: Refresh Atom
// ═══════════════════════════════════════════════════════════════════════════

/**
 * Write-only atom for manual refresh.
 * Useful when you need to force a data refresh.
 */
export const refresh{Entities}Atom = atom(null, (_get, set) => {
  set(singleFetch{Entities}Atom);
  set(stream{Entities}Atom, undefined);
});

Read the full file on GitHub · 258 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 · 258 lines · 0 tokens per session scan A 38accd12db85

Subscribe to this mod's changes

new-hybrid-atom is a command published in the GitHub repository naporin0624/claude-plugin-hono-electron (3 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,652 tokens. 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-31.