lightning-memory

lightning-memory is a skill for Claude Code, Codex from singularityjason/lightning-memory. It costs 19 tokens per session (527 once invoked), scanned A, original, MIT.

A local memory system for AI agents that stores and searches information, using Nostr keys for identity and the Lightning Network for optional paid access. Nostr is a decentralized messaging protocol, while Lightning enables small Bitcoin payments.

In plain words
What is it for?
Use it to save, search, retrieve, and manage agent memories through an MCP connection. MCP is a standard way for tools to connect to applications such as Claude Code, Cursor, and Windsurf.
Why use it?
It lets agents recall past information such as purchases, vendors, and spending without relying on a remote embedding service by default. It can also share memories through Nostr relays or charge for access through Lightning.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Good fit Use it to save, search, retrieve, and manage agent memories through an MCP connection. MCP is a standard way for tools to connect to applications such as Claude Code, Cursor, and Windsurf.

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

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 lightning-memory

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/singularityjason/lightning-memory/openclaw-skill"><img src="https://agentmods.dev/badge/skills/singularityjason/lightning-memory/openclaw-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 527 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.00019 $0.00527
Opus 5.5 $0.00008 $0.00211
Sonnet 5.5 $0.00004 $0.00105
Haiku 4.5 $0.00002 $0.00053

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

Security

Grade A, and why

lightning-memory 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 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.

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.

openclaw-skill/SKILL.md · 73 lines

What it actually says

Lightning Memory

Decentralized agent memory for the Lightning economy. Store, query, and recall memories with cryptographic identity (Nostr) and micropayments (Lightning/L402).

Installation

pip3 install lightning-memory

No API keys required. Runs fully local by default. Optional Nostr relay sync and Lightning L402 gateway for decentralized/paid access.

What It Does

AI agents can transact via Lightning (L402) but can't remember what they paid for, which vendors are reliable, or their spending patterns. Lightning Memory fixes this:

  • Cryptographic identity via Nostr keypairs — memories are signed and verifiable
  • Semantic search with local ONNX embeddings (no API calls)
  • Nostr relay sync — memories replicate across relays using NIP-78 events
  • L402 payment gateway — sell memory access via Lightning micropayments with macaroon auth
  • MCP server — works with Claude Code, Cursor, Windsurf, and any MCP client

MCP Tools (7 tools)

Tool Purpose
store_memory Store a memory with content, tags, and metadata
query_memories Semantic search across stored memories
get_memory Retrieve a specific memory by ID
list_memories List recent memories with optional filters
delete_memory Remove a memory by ID
get_identity Get the current Nostr identity (npub)
sync_status Check Nostr relay sync status

Quick Start

from lightning_memory import MemoryStore

store = MemoryStore()
store.add("Vendor X charges 50 sats for image gen, quality 8/10")
results = store.query("reliable image generation vendors")

MCP Server

python -m lightning_memory.server

Or add to your MCP client config:

{
  "lightning-memory": {
    "command": "python3",
    "args": ["-m", "lightning_memory.server"]
  }
}
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 · 73 lines · 19 tokens per session scan A 909f209da617

Subscribe to this mod's changes

lightning-memory is a skill published in the GitHub repository singularityjason/lightning-memory (9 stars, last pushed 7mo ago), licensed MIT. It adds 19 tokens to every session and 527 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-08-31.

Related

Other skills, from other repositories

saturnzap

Non-custodial Lightning wallet for AI agents via sz CLI: send/receive sats, pay invoices, auto-pay HTTP 402 (L402), manage channels and liquidity. Use when: (1) paying for API access with Lightning, (2) creating or paying BOLT11 invoices, (3) checking wallet balance or channel health, (4) managing peers and channels.…

lqwdtech/SaturnZap · 98 tokens

sparkbtcbot

Give an AI agent a self-custodial Bitcoin wallet on the Spark L2. Covers wallet init from a BIP39 mnemonic, zero-fee Spark and BTKN/LRC20 token transfers, Lightning invoices (create and pay), Spark native invoices, L402 paywall payment, L1 deposits and cooperative withdrawals, and message signing. Make sure to use…

echennells/sparkbtcbot · 272 tokens

satrank-l402

Discover and score L402 endpoints on Bitcoin Lightning before paying. Use when an agent needs to call a paid API and wants a Bayesian trust posterior + offline-verifiable Nostr assertion. Bitcoin-pure, no x402/EVM.

proofoftrust21/satrank · 52 tokens

lightning-architecture-review

Review Bitcoin Lightning Network protocol designs, compare channel factory approaches, and analyze Layer 2 scaling tradeoffs. Covers trust models, on-chain footprint, consensus requirements, HTLC/PTLC compatibility, liveness, and watchtower support.

8144225309/superscalar-mcp · 52 tokens

lightning-channel-factories

Technical reference on Lightning Network channel factories, multi-party channels, LSP architectures, and Bitcoin Layer 2 scaling without soft forks. Covers Decker-Wattenhofer, timeout trees, MuSig2 key aggregation, HTLC/PTLC forwarding, and watchtower breach detection.

8144225309/superscalar-mcp · 61 tokens

lightning-factory-explainer

Explain Bitcoin Lightning channel factories and the SuperScalar protocol — scalable Lightning onboarding using shared UTXOs, Decker-Wattenhofer trees, timeout-signature trees, MuSig2, and Taproot. No soft fork required.

8144225309/superscalar-mcp · 53 tokens