Skip to content

Claude Opus 5.5 (effort default (no --effort flag) · thinking on) on Unicode-correct username canonicalisation (NFKC, casefold, mixed-script), terminal width, cluster-safe truncation and slugs

AClaude Opus 5.5default · thinking on · Claude Code 2.1.299 (headless -p) · cloud · 2026-10-17 · by @bobsiopener

Trust 80%Fully autonomoussuccess · first try
Estimated cost
$0.24
Wall time
58s
Human step-ins
0
Outcome
Pass

Compare with other models on this task →

Summary

Exact prompt

# Task: make the text helpers Unicode-correct Rewrite the four functions in `textnorm.py` (Python stdlib only, `unicodedata` is fine) to these rules: **canonical_username(s)** - used to detect duplicate/impersonating accounts. 1. Remove zero-width/format characters U+200B, U+200C, U+200D, U+2060, U+FEFF and U+00AD (soft hyphen); apply NFKC; casefold (Python `str.casefold()`; note it maps a Greek final sigma ς to σ, so `"Δημήτρης"` -> `"δημήτρησ"`); strip surrounding whitespace. 2. The result must be 3-32 characters, contain only letters (any script, category L*), digits (Nd), `.`, `_`, `-`, and must not mix scripts: all letters must come from one script among Latin, Greek, Cyrillic (judge by `unicodedata.name` starting with `LATIN`, `GREEK`, `CYRILLIC`; letters from any other script are allowed only if all letters are from that same other script, judged by the first word of the name). Otherwise raise `ValueError`. Examples: `" John_Doe "` -> `"john_doe"`; `"STRASSE"` and `"straße"` both -> `"strasse"`; `"pаypal"` (Cyrillic а) -> ValueError. **display_width(s)** - terminal columns: characters with East Asian Width `W` or `F` count 2; combining marks (categories Mn, Me), format chars (Cf) and the zero-width chars above count 0; control characters (Cc) count 0; everything else 1 (so East Asian Width `A`/`N`/`Na`/`H` count 1: `…` is 1, `❤` is 1, each regional-indicator letter is 1 so a flag pair is 2, and U+FE0F is 0 as a combining mark). **truncate(s, width, ellipsis="…")** - if `display_width(s) <= width` return `s` unchanged. Otherwise return the longest prefix such that display_width(prefix) + display_width(ellipsis) <= `width`, never splitting a base character from its following combining marks/ZWJ/variation selectors (U+FE00-FE0F), never splitting a regional-indicator pair (flag) and never leaving a dangling ZWJ (U+200D) at the end of the prefix. Then append ellipsis. If even the ellipsis doesn't fit, return "". **slugify(s)** - NFKD, drop combining marks, map `ß`->`ss`, `æ`->`ae`, `œ`->`oe`, `ø`->`o`, `ł`->`l`, `đ`->`d`, `þ`->`th` (and their uppercase forms), lowercase, then every run of characters other than `a-z0-9` becomes a single `-`; strip leading/trailing `-`. If longer than 60 characters, cut to 60 and then, if the cut fell inside a word (the 60th and 61st characters are both letters/digits), back off to the last `-` within the 60 (when there is one); finally strip trailing `-`. Examples: 20 x "word " -> 12 x "word" joined by `-`; `"abc " + 70 x "y"` -> `"abc"`; 70 x "x" -> 60 x "x". Empty result -> `"n-a"`. No network.

Tests hit casefold (ß->ss, final sigma), NFKC compatibility chars (fullwidth, ligatures, roman numerals), homoglyph mixed-script detection, East Asian width, combining marks, flags, ZWJ emoji and variation selectors in truncation, and transliteration + word-boundary cuts in slugs. Original benchmark task written for usecaserank.com (not based on a specific public post). Headless, offline run on a reproducible fixture. Each run's notes say how its cost was measured (estimates are marked).

Success criteria: 1. All 8 hidden unittest cases pass: username normalisation, script rules, invalid usernames, display width, basic truncation, grapheme-safe truncation, slug transliteration, slug length cutting.

Setup notes: Use Case Scout batch 6 case f07-unicode-text-normalization (offline fixture). Prepared with batch6/prepare.sh; hidden key/tests kept outside the agent's work dir. Prompt = TASK.md verbatim. Scored with the scout's scorer: `python score.py WORKDIR KEYDIR`. Tools: Read/Write/Edit/Glob/Grep/Bash, web disabled. Single run, no retries. Claude Code's own reported cost for claude-opus-5.5: $0.244329. Score: 8/8. Cost is an ESTIMATE: measured tokens x pricing.json list price (Claude Pro subscription, nothing billed); input_tokens include cache reads and writes. Single run.

Estimated cost List-price estimate; not actually billed.

Metrics

Estimated cost
$0.24
Wall time
58s
Human step-ins
0
Turns
6
Model usage
ModelInput tokOutput tokCost
AClaude Opus 5.5anthropic/claude-opus-5.5effort default (no --effort flag) · thinking on131,0905,758$0.24

Reproduce this run

  1. Use the use case prompt on the use case page.
  2. Same setup: Claude Opus 5.5 (anthropic/claude-opus-5.5, effort default (no --effort flag) · thinking on) via Claude Code 2.1.299 (headless -p), cloud.
  3. It counts as a success only if it meets every success criterion: 1. All 8 hidden unittest cases pass: username normalisation, script rules, invalid usernames, display width, basic truncation, grapheme-safe truncation, slug transliteration, slug length cutting.
  4. Log model, tokens, wall time, human step-ins and the evidence log, then submit it as a reproduction. A different model? Submit a head-to-head rerun.

How runs are scored: Methodology.

Was this useful?

⇄ Rerun on another model

Automated checks

Trust 80% comes from these checks (how Trust % works).

Evidence log
[
 {
  "duration_api_ms": 56590,
  "stop_reason": "end_turn",
  "session_id": "[REDACTED]",
  "total_cost_usd": 0.244329,
  "usage": {
   "input_tokens": 12,
   "cache_creation_input_tokens": 13193,
   "cache_read_input_tokens": 117885,
   "output_tokens": 5758,
   "output_tokens_details": {
    "thinking_tokens": 1489
   },
   "server_tool_use": {
    "web_search_requests": 0,
    "web_fetch_requests": 0
   },
   "service_tier": "standard",
   "cache_creation": {
    "ephemeral_1h_input_tokens": 13193,
    "ephemeral_5m_input_tokens": 0
   },
   "inference_geo": "global",
   "iterations": [
    {
     "input_tokens": 2,
     "output_tokens": 799,
     "cache_read_input_tokens": 24589,
     "cache_creation_input_tokens": 750,
     "cache_creation": {
      "ephemeral_5m_input_tokens": 0,
      "ephemeral_1h_input_tokens": 750
     },
     "type": "message"
    }
   ],
   "speed": "standard",
   "fallback_credit": null
  },
  "modelUsage": {
   "claude-opus-5-5": {
    "inputTokens": 12,
    "outputTokens": 5758,
    "cacheReadInputTokens": 117885,
    "cacheCreationInputTokens": 13193,
    "webSearchRequests": 0,
    "costUSD": 0.244329,
    "contextWindow": 1000000,
    "maxOutputTokens": 128000,
    "thinkingTokens": 1489,
    "canonicalModel": "claude-opus-5-5",
    "provider": "firstParty",
    "costBasis": "list"
   }
  },
  "permission_denials": [],
  "terminal_reason": "completed",
  "fast_mode_state": "off",
  "fast_mode_disabled_reason": "sdk_opt_in_required",
  "subagent_stats": {
   "spawned": 0,
   "requested": {
    "background": 0,
    "foreground": 0,
    "unset": 0
   },
   "started_in_background": 0,
   "max_depth": 0,
   "spawned_by_subagents": 0,
   "completed": 0,
   "failed": 0,
   "killed": {
    "parent": 0,
    "user": 0,
    "system": 0
   },
   "refused": {
    "depth_limit": 0,
    "concurrency_limit": 0,
    "budget": 0
   },
   "by_type": {}
  },
  "safety_stops": 0,
  "is_error": false,
  "num_turns": 6,
  "subtype": "success",
  "api_error_status": null,
  "result": "I rewrote all four functions in `textnorm.py` using only the standard library (`re` and `unicodedata`). They pass every example in the spec plus some edge cases I added. Those cases were ad-hoc checks and aren't saved as a test file. One of my own expected values was wrong at first and I corrected it: a letter plus a flag fits in a 3-column budget.\n\n- **`canonical_username`**: follows the steps in the order you gave. To check the script rule, it reads each letter's Unicode name: Latin, Greek and Cyrillic are matched by the name prefix, and any other script by the first word of the name. All letters must share one script.\n  - `\"  \uff2a\uff4f\uff48\uff4e_Doe \"` gives `john_doe`, and both `STRASSE` and `stra\u00dfe` give `strasse`.\n  - `\"\u0394\u03b7\u03bc\u03ae\u03c4\u03c1\u03b7\u03c2\"` gives `\u03b4\u03b7\u03bc\u03ae\u03c4\u03c1\u03b7\u03c3`, and `\u5c71\u7530\u592a\u90ce` is accepted.\n  - `p\u0430ypal` with a Cyrillic \u0430 is rejected, and so is a mix like `abc\u65e5\u672c`.\n- **`display_width`**: follows your rules; the zero-width checks run before the wide-character check.\n- **`truncate`**: splits the text into pieces that are never cut apart, then keeps whole pieces while they fit alongside the ellipsis. A piece is:\n  - a base character with any combining marks, ZWJ or variation selectors after it;\n  - a regional-indicator pair (a flag);\n  - a whole emoji sequence joined by ZWJ, such as \ud83d\udc68\u200d\ud83d\udc69\u200d\ud83d\udc67, so it can't end in a dangling ZWJ.\n- **`slugify`**: applies the special letter mappings after NFKD, because those letters (\u00df, \u00e6, \u00f8 and so on) don't decompose on their own. I also mapped the capital sharp s `\u1e9e` to `ss`.\n\n**Two things to be aware of:**\n- Combining marks count as width 0 and are kept with their base character in `truncate`. Spacing marks (category Mc) count as width 1, as your \"everything else\" rule says.\n- In `canonical_username`, a character such as `\u0130` turns into `i` plus a combining dot when lowercased. Combining marks aren't on the allowed list, so names containing it are rejected. That is what the rules say, but it may be stricter than you want for Turkish names.",
  "ttft_ms": 2225,
  "type": "result",
  "duration_ms": 57041,
  "uuid": "[REDACTED]",
  "ttft_stream_ms": 1698,
  "time_to_request_ms": 270,
  "first_content_frame_ms": 1698,
  "queued_turn_count": 0,
  "result_index": 0
 }
]

Get new runs and ranking changes weekly