bin-packing

bin-packing is a skill for Claude Code from hajibabaie/combinatorial-optimization-skills. It costs 129 tokens per session (10,316 once invoked), scanned A, original, MIT.

A guide to bin packing, the task of placing items into capacity-limited containers while using as few containers as possible.

In plain words
What is it for?
Use it to solve standard packing problems, compare first-fit and best-fit decreasing methods, handle repeated item sizes, model conflicts or variable bin sizes, and validate results.
Why use it?
It helps choose between quick placement rules, mathematical lower bounds, and exact optimization models based on the data and constraints.

Skill for Claude Code

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

Part of the combinatorial-optimization plugin — 76 skills shipped together

Good fit Use it to solve standard packing problems, compare first-fit and best-fit decreasing methods, handle repeated item sizes, model conflicts or variable bin sizes, and validate results.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hajibabaie/combinatorial-optimization-skills/bin-packing
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 hajibabaie/combinatorial-optimization-skills --skill bin-packing
Clone the repo
git clone --depth 1 https://github.com/hajibabaie/combinatorial-optimization-skills

Made for: Claude Code.

Or install combinatorial-optimization, the plugin that ships this one along with the rest of its 76 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 bin-packing

README.md
[![agentmods](https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/bin-packing/github.svg)](https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/bin-packing)
Your own site
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/bin-packing"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/bin-packing/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 bin-packing

Your own site · 80×15
<a href="https://agentmods.dev/skills/hajibabaie/combinatorial-optimization-skills/bin-packing"><img src="https://agentmods.dev/badge/skills/hajibabaie/combinatorial-optimization-skills/bin-packing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,316 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.00129 $0.10316
Opus 5.5 $0.00052 $0.04126
Sonnet 5.5 $0.00026 $0.02063
Haiku 4.5 $0.00013 $0.01032

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

Security

Grade A, and why

bin-packing 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.

skills/bin-packing/SKILL.md · 763 lines

How it starts

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

Bin Packing

You are an expert in one-dimensional bin packing and its standard variants. This skill covers construction heuristics with worst-case guarantees (FF, BF, FFD, BFD), the L1 and L2 lower bounds, the compact assignment MIP with symmetry breaking, the arc-flow exact model, item conflicts, variable bin sizes, and the relation to cutting stock. Use the framework below to choose the right bound, heuristic, and exact model for the instance at hand, and to validate every solution independently.

Initial Assessment

Establish the following before proposing a method.

  • Instance size. Get n (number of items), the capacity C, and the number of distinct item sizes d. If d << n (many duplicates), aggregate items into (size, demand) pairs and treat the problem as cutting stock — pattern-based models scale with d, not n.
  • Weight type. Integer or fractional weights? Arc-flow and DP-based bounds need integer weights; fractional data must be scaled. Ask for the scaling precision the user accepts.
  • Sanity of the data. Check 0 < w_i <= C for every item. An item with w_i > C makes the instance infeasible; items with w_i = 0 should be removed before modeling.
  • Variant detection. Identical bins, or multiple bin types with different capacities and costs (variable-sized bin packing)? Are there incompatible item pairs that may not share a bin (bin packing with conflicts)? Cardinality limits per bin?
  • Objective check. Confirm the goal is minimizing the number of bins. If the number of bins is fixed and the goal is balancing loads, that is multiprocessor scheduling (P||Cmax), a different problem with different methods.
  • Online vs offline. Do all items arrive up front? Online arrival changes the achievable guarantees (no algorithm beats competitive ratio ~1.54) and rules out sorting-based methods.
  • Exactness need. Is a provably optimal count required, or is "within one bin of a lower bound, certified" enough? FFD plus L2 often closes the gap without any solver.
  • Time budget and solver access. Seconds or hours? Is a Gurobi license available, or should the model run on HiGHS / CP-SAT? Arc-flow models can be large: estimate C * d arcs first.
  • Solution artifact. Does the user need only the bin count, or the explicit item-to-bin assignment? The assignment matters for downstream use and for validation.
  • Scale of repetition. One instance, or thousands solved in a loop (e.g., inside a pricing or simulation routine)? Repetition pushes toward O(n log n) heuristics with cached bounds.

Read the full file on GitHub · 763 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 · 763 lines · 129 tokens per session scan A cd004bac6e9d

Subscribe to this mod's changes

bin-packing is a skill published in the GitHub repository hajibabaie/combinatorial-optimization-skills (23 stars, last pushed 5mo ago), licensed MIT. It adds 129 tokens to every session and 10,316 once invoked, about $0.0005 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

bin-packing compared with skills from other repositories

bin-packing next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
bin-packinghajibabaie/combinatorial-optimization-skillsSkill235mo agoMITA129Claude Code
top-designwondelai/skillsSkill2.9k4d agoMITA113Claude Code, Codex
design-everyday-thingswondelai/skillsSkill2.9k4d agoMITA132Claude Code
traction-eoswondelai/skillsSkill2.9k4d agoMITA147Claude Code, Codex
create-appwondelai/skillsSkill2.9k4d agoMITA217Claude Code
improve-appwondelai/skillsSkill2.9k4d agoMITA236Claude Code
cold-start-problemwondelai/skillsSkill2.9k4d agoMITA168Claude Code