complexity-coach

complexity-coach is a skill for Claude Code, Codex from Far-200/think-before-code. It costs 77 tokens per session (1,020 once invoked), scanned A, original, MIT.

A teaching guide for working out how much time and memory an algorithm uses from its actual code. Big-O is a shorthand for how that cost grows as the input gets larger.

In plain words
What is it for?
Use it for focused practice on time and space complexity, including nested loops, recursive algorithms, and amortized cost, where occasional expensive operations are averaged over many operations.
Why use it?
It helps learners derive complexity from loops, recursion, and repeated work instead of recalling a label for a familiar pattern. It focuses on the reasoning, not on fixing or redesigning the algorithm.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for focused practice on time and space complexity, including nested loops, recursive algorithms, and amortized cost, where occasional expensive operations are averaged over many operations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/far-200/think-before-code/complexity-coach
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 Far-200/think-before-code --skill complexity-coach
Clone the repo
git clone --depth 1 https://github.com/Far-200/think-before-code

Made for: Claude Code, Codex.

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 complexity-coach

README.md
[![agentmods](https://agentmods.dev/badge/skills/far-200/think-before-code/complexity-coach/github.svg)](https://agentmods.dev/skills/far-200/think-before-code/complexity-coach)
Your own site
<a href="https://agentmods.dev/skills/far-200/think-before-code/complexity-coach"><img src="https://agentmods.dev/badge/skills/far-200/think-before-code/complexity-coach/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 complexity-coach

Your own site · 80×15
<a href="https://agentmods.dev/skills/far-200/think-before-code/complexity-coach"><img src="https://agentmods.dev/badge/skills/far-200/think-before-code/complexity-coach.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,020 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.00077 $0.01020
Opus 5.5 $0.00031 $0.00408
Sonnet 5.5 $0.00015 $0.00204
Haiku 4.5 $0.00008 $0.00102

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

Security

Grade A, and why

complexity-coach 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.

skills/complexity-coach/SKILL.md · 101 lines

How it starts

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

Complexity Coach

Why this exists

dsa-tutor asks about complexity once, as one item among several during verification. That's enough to check the box, but it's not enough to build the skill of derivation — most learners answer with the complexity they've memorized for a pattern name, not one they worked out from the actual code in front of them. This skill exists to drill the derivation itself, either standalone or as a deeper follow-up to that single verification question.

This skill does not evaluate whether the algorithm is correct, and it does not suggest a better approach. If the learner's approach itself is in question, that's dsa-tutor's job. A broad review of existing code — correctness, maintainability, design — is code-review-coach's session; this skill applies when complexity derivation is the question itself, even if it arrived as one lens of such a review.

Circuit breaker

Never state the Big-O for the learner. If they state one first, treat it as a claim to be justified, not a fact to confirm.

Has the learner derived the complexity from the actual structure of
their code or approach — loop bounds, recursion depth, or amortized
cost — rather than recalled it from the pattern's name?

  NO  → ask them to derive it. Don't confirm or correct yet.
  YES → check it against a degenerate input before accepting it.

Protocol

  1. Identify every loop and recursive call, and ask the learner to state its bound in terms of the input size — not "it loops a bit," an actual expression.
  2. For nested structures, ask the learner to derive the total work as a sum over iterations rather than reciting a shape like "nested loop = O(n²)." A nested loop whose inner bound changes each pass is not automatically a different complexity — a loop that runs n + (n-1) + (n-2) + ... + 1 times is still Θ(n²), just arrived at through a sum instead of a flat multiplication. The point isn't to memorize which shapes are which; it's to make the learner actually sum or multiply the bounds instead of guessing from the shape.
  3. For recursion, ask them to write the recurrence relation (T(n) = ...) before reaching for a name. Then ask whether they can solve it by unrolling it a few levels, or whether they recognize a Master Theorem case — don't supply which case applies.
  4. For amortized structures (dynamic arrays, union-find with path compression, a two-pointer scan that never backtracks), ask them to reason about total work across all operations, not the worst single one.
  5. Ask space separately from time. Auxiliary space vs. input space, and whether the call stack from recursion counts (it does).
  6. Stress-test the claim against a degenerate input: does the complexity change for an already-sorted array, all-duplicate values, or an empty input? If the learner hasn't considered this, ask rather than tell.

Read the full file on GitHub · 101 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. 1mo ago First seen · 101 lines · 77 tokens per session scan A a9de41520ba9

Subscribe to this mod's changes

complexity-coach is a skill published in the GitHub repository Far-200/think-before-code (16 stars, last pushed 1mo ago), licensed MIT. It adds 77 tokens to every session and 1,020 once invoked, about $0.0003 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

Other skills, from other repositories

interactive-leetcode-mcp

Use when the user wants to practice LeetCode problems, submit solutions, or set up LeetCode integration. Covers MCP server installation, learning-guided practice flow, solution submission, and authentication.

SPerekrestova/interactive-leetcode-mcp · 46 tokens

leetcode-helper

Expert LeetCode problem solver for optimized C++ coding interview solutions. Use when: the user pastes a LeetCode problem, asks for an optimized algorithm, wants C++ LeetCode code, needs a dry run, asks for line-by-line explanation, wants a hint before the solution, wants brute force to optimized progression, wants…

Zephyrex21/claude-leetcode-helper · 98 tokens

configure-profile

Create or update the global learner profile. Interviews the learner using the measurement checklist in references/PROFILE-TEMPLATE.md and writes the structured result to profile/PROFILE.md. Use when a new learner sets up Upstack for the first time, or after completing a course to update skills and Dreyfus levels.

ishands/upstack · 64 tokens

create-course

Scaffold a new course directory from the COURSE.md schema. Creates the directory structure, populates COURSE.md with YAML frontmatter and markdown template sections, and creates stub assignment directories. Use for curated courses (core/courses/) or personal courses (custom/courses/) in any domain.

ishands/upstack · 60 tokens

start-course

Initialise a learning session. Checks for an existing journal in progress/ /journal.md, creates one from the template if missing, loads the course definition, and calibrates to the learner's declared context. Use when starting a new course or resuming after a break.

ishands/upstack · 60 tokens

start-learning-path

Enrol in a curated learning path. Discovers available paths, presents project options in plain language, records the learner's choice, initialises the integration journal, and displays the full course roadmap. Run once at the start of the path — not at the start of each course. Distinguishes enrolment (path level…

ishands/upstack · 83 tokens