inline-lambda-functions

inline-lambda-functions is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 32 tokens per session (1,153 once invoked), scanned A, original, MIT.

A coding style guide for using short anonymous functions directly where they are needed. These functions include JavaScript or TypeScript arrow functions, Python lambdas, and Rust closures.

In plain words
What is it for?
Use it for array transformations, sorting callbacks, event handlers, and other small single-use functions.
Why use it?
It avoids separate helper functions for simple one-use operations, reducing boilerplate and keeping the related code together.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 7 plugins shipped together

Good fit Use it for array transformations, sorting callbacks, event handlers, and other small single-use functions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/inline-lambda-functions
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 alivirgo/Major-AI-Skills --skill inline-lambda-functions
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 7 plugins.

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 inline-lambda-functions

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/inline-lambda-functions.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/inline-lambda-functions)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/inline-lambda-functions"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/inline-lambda-functions.svg" alt="Measured on agentmods" 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 1,153 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.00032 $0.01153
Opus 5 $0.00016 $0.00576
Sonnet 5 $0.00006 $0.00231
Haiku 4.5 $0.00003 $0.00115

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

Security

Grade A, and why

inline-lambda-functions 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 2d 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.

skills/inline-lambda-functions/SKILL.md · 130 lines

How it starts

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

Inline Lambda & Callback Compression Protocol

Overview

When generating data transformations, array processing, or event handlers, default LLM outputs frequently define verbose 5-to-8 line standalone named helper functions for trivial, single-use operations ("Let me define a helper function compareUserTimestamps and then pass it to .sort()").

Defining separate named functions for one-off operations bloats output tokens, introduces unneeded namespace pollution, and fragments the reader's attention across multiple parts of the file.

The Inline Lambda Compression Protocol leverages concise single-expression anonymous functions (JavaScript/TypeScript arrow functions, Python lambdas, Rust closures) directly at the call site.


Verbose Named Helpers vs. Inline Lambda Expressions

┌─────────────────────────────────────────────────────────────┐
│                 Callback Code Density Comparison            │
│                                                             │
│  Verbose Standalone Named Helper (18 Lines / 140 Tokens):   │
│  function compareOrdersByDate(a, b) {                       │
│    const dateA = new Date(a.createdAt).getTime();           │
│    const dateB = new Date(b.createdAt).getTime();           │
│    return dateB - dateA;                                    │
│  }                                                          │
│  function getActiveUserIds(users) {                         │
│    const activeList = [];                                   │
│    for (let i = 0; i < users.length; i++) {                 │
│      if (users[i].isActive === true) {                      │
│        activeList.push(users[i].id);                        │
│      }                                                      │
│    }                                                        │
│    return activeList;                                       │
│  }                                                          │
│                                                             │
│  Inline Lambda Pipeline (3 Lines / 28 Tokens - 80% Cut):    │
│  const sorted = orders.sort((a, b) => b.createdAt - a.createdAt);│
│  const activeIds = users.filter(u => u.isActive).map(u => u.id); │
└─────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 130 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. 2d ago First seen · 130 lines · 32 tokens per session scan A 04f108231fa6

Subscribe to this mod's changes

inline-lambda-functions is a skill published in the GitHub repository alivirgo/Major-AI-Skills (1 stars, last pushed today), licensed MIT. It adds 32 tokens to every session and 1,153 once invoked, about $0.0002 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-09-05.

Related

Other skills, from other repositories