use-namedtuple-record

use-namedtuple-record is a skill for Claude Code from jimmc414/claude-code-plugin-marketplace. It costs 30 tokens per session (640 once invoked), scanned A, original, MIT.

A Python record type with named, immutable fields that still behaves like a tuple.

In plain words
What is it for?
Use it for points, coordinates, and small fixed records that need named access, tuple unpacking, or storage in sets and dictionaries.
Why use it?
It makes tuple-based data easier to understand while keeping it lightweight, hashable, and usable as dictionary keys or set members. Use a different type when fields must change.

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 points, coordinates, and small fixed records that need named access, tuple unpacking, or storage in sets and dictionaries.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimmc414/claude-code-plugin-marketplace/use-namedtuple-record
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-namedtuple-record
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-namedtuple-record

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/use-namedtuple-record"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/use-namedtuple-record.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 640 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.00030 $0.00640
Opus 5.5 $0.00012 $0.00256
Sonnet 5.5 $0.00006 $0.00128
Haiku 4.5 $0.00003 $0.00064

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

Security

Grade A, and why

use-namedtuple-record 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-namedtuple-record/SKILL.md · 83 lines

What it actually says

use-namedtuple-record

When to Use

  • Need tuple-like efficiency with named access
  • Data should be immutable
  • Will use as dict keys or in sets
  • Want self-documenting code
  • Replacing anonymous tuples with meaning
  • Coordinates, points, records

When NOT to Use

  • Need mutable fields (use dataclass)
  • Need methods beyond basic access
  • Complex initialization logic needed

The Pattern

Use namedtuple for lightweight, immutable records with named fields.

from collections import namedtuple

# Define the type
Point = namedtuple('Point', ['x', 'y'])
# Or: Point = namedtuple('Point', 'x y')

# Create instances
p = Point(3, 4)
p = Point(x=3, y=4)

# Access by name or index
p.x  # 3
p[0]  # 3

# Immutable and hashable
{p: 'origin'}  # Can be dict key
{p, q, r}  # Can be in set

# Tuple operations work
x, y = p  # Unpacking

Example (from pytudes)

from collections import namedtuple

# Geometry (Convex Hull.ipynb)
Point = namedtuple('Point', 'x y')

def turn(A, B, C):
    """Direction of turn A -> B -> C."""
    diff = (B.x - A.x) * (C.y - B.y) - (B.y - A.y) * (C.x - B.x)
    return 'right' if diff < 0 else 'left' if diff > 0 else 'straight'

# Much clearer than:
# diff = (B[0] - A[0]) * (C[1] - B[1]) - (B[1] - A[1]) * (C[0] - B[0])

# Game structures (Maze.ipynb)
Maze = namedtuple('Maze', 'width height edges')

maze = Maze(width=10, height=10, edges=set())
print(f"Maze is {maze.width}x{maze.height}")

# Complex data (AdventUtils.ipynb)
Node = namedtuple('Node', 'state parent action path_cost')

node = Node(state=(0,0), parent=None, action=None, path_cost=0)
child = Node(state=(1,0), parent=node, action='E', path_cost=1)

Key Principles

  1. Immutable by design: Can't accidentally modify
  2. Hashable: Use in sets and as dict keys
  3. Memory efficient: Same as tuple, smaller than dict
  4. Self-documenting: p.x beats p[0]
  5. Tuple compatible: Unpacking, indexing still work
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 · 83 lines · 30 tokens per session scan A 22572a3d97f8

Subscribe to this mod's changes

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