use-lambda-inline

use-lambda-inline is a skill for Claude Code from jimmc414/claude-code-plugin-marketplace. It costs 26 tokens per session (629 once invoked), scanned A, original, MIT.

A Python pattern for writing small, unnamed functions directly where they are needed, such as sorting keys or simple callbacks.

In plain words
What is it for?
Use it for one-expression transformations, filters, sorting rules, operation tables, and callback registration.
Why use it?
It keeps tiny operations close to the code that uses them, without creating a separate function name. It is not suitable when the logic is complex or reused.

Skill for Claude Code

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

Part of the norvig-patterns plugin — 54 skills shipped together

Good fit Use it for one-expression transformations, filters, sorting rules, operation tables, and callback registration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline
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 jimmc414/claude-code-plugin-marketplace --skill use-lambda-inline
Clone the repo
git clone --depth 1 https://github.com/jimmc414/claude-code-plugin-marketplace

Made for: Claude Code.

Or install norvig-patterns, the plugin that ships this one along with the rest of its 54 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline/github.svg)](https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline)
Your own site
<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline/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 use-lambda-inline

Your own site · 80×15
<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/use-lambda-inline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 629 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.00026 $0.00629
Opus 5.5 $0.00010 $0.00252
Sonnet 5.5 $0.00005 $0.00126
Haiku 4.5 $0.00003 $0.00063

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

Security

Grade A, and why

use-lambda-inline 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.

plugins/norvig-patterns/skills/use-lambda-inline/SKILL.md · 85 lines

How it starts

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

use-lambda-inline

When to Use

  • Simple one-liner needed inline
  • key= argument to sorted/max/min
  • Dict of operation functions
  • Trivial transformations
  • Callback registration

When NOT to Use

  • Multiple statements needed
  • Function will be reused by name
  • Complex logic that needs documentation
  • Recursion needed (lambda can't easily recurse)

The Pattern

Use lambda for anonymous, single-expression functions.

# Sorting with custom key
sorted(items, key=lambda x: x.priority)
max(scores, key=lambda s: s.value)

# Dict of operations
ops = {'+': lambda a, b: a + b,
       '-': lambda a, b: a - b,
       '*': lambda a, b: a * b}

result = ops['+'](3, 4)  # 7

# Filter with inline predicate
positive = filter(lambda x: x > 0, numbers)

# Default argument for capturing
buttons = [Button(lambda i=i: click(i)) for i in range(10)]

Example (from pytudes)

# Lisp interpreter operations (lis.py)
env = {
    '+': op.add,
    '-': op.sub,
    'apply': lambda proc, args: proc(*args),
    'begin': lambda *x: x[-1],
    'car': lambda x: x[0],
    'cdr': lambda x: x[1:],
    'cons': lambda x, y: [x] + y,
    'length': len,
    'list': lambda *x: list(x),
    'map': lambda *args: list(map(*args)),
    'null?': lambda x: x == [],
    'number?': lambda x: isinstance(x, Number),
}

# Probability key functions (Probability.ipynb)
max(candidates, key=lambda c: probability(c))

# MRV heuristic (Sudoku.ipynb)
s = min((s for s in squares if len(values[s]) > 1),
        key=lambda s: len(values[s]))

# Sort by multiple criteria
sorted(items, key=lambda x: (x.category, -x.priority, x.name))

# Regex substitution callback (Cryptarithmetic.ipynb)
result = re.sub(r'[A-Z]+',
                lambda m: translate_word(m.group()),
                formula)

Key Principles

  1. One expression only: No statements, just return value
  2. Use op module for operators: op.add clearer than lambda a,b: a+b
  3. Default args for capture: lambda i=i: captures current i
  4. Keep it short: If complex, use named function
  5. Readable keys: key=lambda x: x.name is clear

Read the full file on GitHub · 85 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. 1mo ago First seen · 85 lines · 26 tokens per session scan A 3e4425ae59a3

Subscribe to this mod's changes

use-lambda-inline is a skill published in the GitHub repository jimmc414/claude-code-plugin-marketplace (4 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 629 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-09-04.

Related

Other skills, from other repositories

clean-code

Use when the user writes new Python, or asks for review, refactor, or cleanup of Python code, names, comments/docstrings, functions, or tests. Applies Robert Martin's complete Clean Code catalog -- naming, functions, comments, DRY, boundary conditions, and tests -- to the code being changed.

Sagargupta16/claude-skills · 66 tokens

csharp-source-generator

Use when writing, reviewing, debugging, or testing C# source generators and Roslyn incremental generators. Covers IIncrementalGenerator architecture, SyntaxProvider pipelines, generated-code snapshots with Verify, analyzer packaging, marker attributes, AnalyzerConfigOptionsProvider, SDK compatibility, diagnostics, and…

AndyElessar/skills · 152 tokens

rust-coding-standards

Rust coding standards, documentation authoring, content workflows, and quality patterns for systemprompt.io development.

systempromptio/systemprompt-marketplace · 26 tokens

extension-building

Build library extensions for systemprompt.io with Rust - architecture, traits, schemas, API routes, jobs, and code review.

systempromptio/systemprompt-marketplace · 27 tokens

rust-dev-guide

Entry point for rust-development — routes to the right sub-skill for your task.

systempromptio/systemprompt-marketplace · 20 tokens

python-package-management

Guide for managing packages in the Agent Framework Python monorepo, including creating new connector packages, versioning, and the lazy-loading pattern. Use this when adding, modifying, or releasing packages.

microsoft/agent-framework · 43 tokens