use-comprehension-chain

use-comprehension-chain is a skill for Claude Code from jimmc414/claude-code-plugin-marketplace. It costs 29 tokens per session (725 once invoked), scanned A, original, MIT.

A Python syntax for building lists, dictionaries, or sets by filtering and transforming items in a compact expression.

In plain words
What is it for?
Use it to filter sequences, calculate transformed values, create lookup dictionaries, remove duplicates, or flatten nested data.
Why use it?
It replaces several lines of simple looping code with a direct description of the result. Complex logic can become harder to read this way.

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 to filter sequences, calculate transformed values, create lookup dictionaries, remove duplicates, or flatten nested data.

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

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

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

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

Security

Grade A, and why

use-comprehension-chain 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 3mo 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-comprehension-chain/SKILL.md · 83 lines

How it starts

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

use-comprehension-chain

When to Use

  • Transforming sequences (map)
  • Filtering sequences
  • Building dicts or sets from data
  • Combining filter + map
  • Creating lookup tables

When NOT to Use

  • Complex logic that needs multiple statements
  • Side effects needed during iteration
  • Code would be unreadable as one-liner

The Pattern

Use comprehensions for concise, readable data transformation.

# List comprehension: map + filter
squares = [x**2 for x in range(10)]
evens = [x for x in numbers if x % 2 == 0]
even_squares = [x**2 for x in numbers if x % 2 == 0]

# Dict comprehension: build lookup tables
word_lengths = {word: len(word) for word in words}
index = {item: i for i, item in enumerate(items)}
inverted = {v: k for k, v in original.items()}

# Set comprehension: unique values
unique_lengths = {len(word) for word in words}

# Nested comprehension: flatten or cross product
flat = [x for row in matrix for x in row]
pairs = [(x, y) for x in xs for y in ys]

# Conditional expression in comprehension
signs = ['pos' if x > 0 else 'neg' if x < 0 else 'zero' for x in numbers]

Example (from pytudes)

# Sudoku: precompute structure (sudoku.py)
def cross(A, B):
    return [a + b for a in A for b in B]

squares = cross('ABCDEFGHI', '123456789')  # 81 squares

unitlist = (
    [cross(r, '123456789') for r in 'ABCDEFGHI'] +  # Rows
    [cross('ABCDEFGHI', c) for c in '123456789'] +  # Cols
    [cross(rs, cs) for rs in ['ABC','DEF','GHI']    # Boxes
                   for cs in ['123','456','789']]
)

# Unit lookup
units = {s: [u for u in unitlist if s in u] for s in squares}

# Peer lookup
peers = {s: set(sum(units[s], [])) - {s} for s in squares}

# Word prefixes (Boggle.ipynb)
prefixes = {word[:i] for word in words for i in range(1, len(word))}

# Edits (spell.py)
splits = [(word[:i], word[i:]) for i in range(len(word) + 1)]
deletes = [L + R[1:] for L, R in splits if R]
transposes = [L + R[1] + R[0] + R[2:] for L, R in splits if len(R) > 1]

Read the full file on GitHub · 83 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. 3mo ago First seen · 83 lines · 29 tokens per session scan A 460d2ae81387

Subscribe to this mod's changes

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

use-comprehension-chain compared with skills from other repositories

use-comprehension-chain next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
use-comprehension-chainjimmc414/claude-code-plugin-marketplaceSkill4todayMITA29Claude Code
clean-codeSagargupta16/claude-skillsSkill53d agoMITA66Claude Code
csharp-source-generatorAndyElessar/skillsSkill23d agononeA112Claude Code
rust-coding-standardssystempromptio/systemprompt-marketplaceSkill21mo agononeA26Claude Code
extension-buildingsystempromptio/systemprompt-marketplaceSkill21mo agononeA27Claude Code
rust-dev-guidesystempromptio/systemprompt-marketplaceSkill21mo agononeA20Claude Code
agents-cli-claudegoogle/agents-cliSkill6.5k2d agoApache-2.0A77Claude Code