Danglebary

Claude Sort — Development skill for Claude Code

Development community

Sorts an array by asking Claude Opus to do it.

How to install Claude Sort

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Danglebary/claude-sort and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Sort does

Sorts an array by asking Claude Opus to do it. A rigorously engineered joke.

Alternatives in Development

  • Desloppify — Agent harness to make your slop code well-engineered and beautiful 3k ★
  • Claudes C Compiler — Claude Opus 4.6 wrote a dependency-free C compiler in Rust, with backends targeting x86 (64- and 32-bit), ARM 2.6k ★
  • Claude Engineer — A version of command line interface(CLI) that leverages the power of Claude Opus(3-4.7) 954 ★

README

claude-sort

Sorts an array by asking Claude Opus to do it.

import { claudeSort } from "claude-sort";

const result = await claudeSort([3, 1, 2]);
// { outcome: "sorted", items: [1, 2, 3], attempts: 1, usage: { inputTokens: 212, outputTokens: 51 } }

`Array.prototype.sort` does this in about 40 nanoseconds and no dollars. This package does it in about four seconds and a fraction of a cent, over the network, with retries. It is a joke about how much of that trade we have been making lately, and it is built like it is not one: strict TypeScript, a pure core, schema-validated I/O, assertions on both sides of every boundary, and 73 tests that never touch the network.

Install

npm install claude-sort

Credentials resolve the way the Anthropic SDK resolves them: `ANTHROPIC_API_KEY`, then `ANTHROPIC_AUTH_TOKEN`, then an `ant auth login` profile. Pass `apiKey` to override that for one call.

Usage

Every ending is a named outcome, so nothing has to be caught for a sort that simply did not happen:

import { claudeSort } from "claude-sort";

const result = await claudeSort(["Neptune", "Mercury", "Earth", "Jupiter"], {
  criterion: "distance from the Sun, nearest first",
});

switch (result.outcome) {
  case "sorted":
    console.log(result.items); // ["Mercury", "Earth", "Jupiter", "Neptune"]
    break;
  case "limitExceeded":
    console.log(`too many: ${result.limit} was ${result.actual}`);
    break;
  case "unsorted":
    console.log(`no valid ordering in ${result.attempts} attempts`);
    break;
  case "refused":
    console.log(result.detail);
    break;
  case "apiError":
    console.log(`api error ${result.httpStatus}`);
    break;
}

The comparator is a sentence, which is the one thing this does that `Array.prototype.sort` cannot:

await claudeSort(bugReports, { criterion: "how angry the reporter sounds" });
await claudeSort(names, { criterion: "Vietnamese alphabetical order" });
await claudeSort(commits, { criterion: "