factor-step-by-step

factor-step-by-step is a skill for Claude Code, Codex from nerdai/llm-agents-from-scratch. It costs 33 tokens per session (349 once invoked), scanned A, original, Apache-2.0.

A step-by-step tool workflow for breaking an integer greater than one into its prime factors. Prime factors are the prime numbers that multiply together to make the original number.

In plain words
What is it for?
Use it to factor a supplied number and report its factors, starting value, and number of tool steps.
Why use it?
It requires each factor to come from the tool and waits for the result before continuing, so the final factorisation is not guessed.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to factor a supplied number and report its factors, starting value, and number of tool steps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nerdai/llm-agents-from-scratch/factor-step-by-step
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 nerdai/llm-agents-from-scratch --skill factor-step-by-step
Clone the repo
git clone --depth 1 https://github.com/nerdai/llm-agents-from-scratch

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 factor-step-by-step

README.md
[![agentmods](https://agentmods.dev/badge/skills/nerdai/llm-agents-from-scratch/factor-step-by-step/github.svg)](https://agentmods.dev/skills/nerdai/llm-agents-from-scratch/factor-step-by-step)
Your own site
<a href="https://agentmods.dev/skills/nerdai/llm-agents-from-scratch/factor-step-by-step"><img src="https://agentmods.dev/badge/skills/nerdai/llm-agents-from-scratch/factor-step-by-step/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 factor-step-by-step

Your own site · 80×15
<a href="https://agentmods.dev/skills/nerdai/llm-agents-from-scratch/factor-step-by-step"><img src="https://agentmods.dev/badge/skills/nerdai/llm-agents-from-scratch/factor-step-by-step.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 349 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.00033 $0.00349
Opus 5.5 $0.00013 $0.00140
Sonnet 5.5 $0.00007 $0.00070
Haiku 4.5 $0.00003 $0.00035

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

Security

Grade A, and why

factor-step-by-step 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.

more-examples/ch09/.agents/skills/factor-step-by-step/SKILL.md · 62 lines

What it actually says

Factor Step by Step

Fully factor a starting number into its prime factors using the factor_step tool.

Arguments

The user must provide a starting number (an integer greater than 1).

If no starting number is given, ask the user before proceeding.

Steps

1. Initialize

Set the current remainder n to the starting number provided.

Begin tracking the factors as a list: [].

2. Call the tool

Call factor_step with the current value of n.

factor_step(n=<current_remainder>)

STOP and WAIT for the tool result before continuing.

3. Record the result

Append the returned factor to the factors list.

Set n to the returned remaining.

4. Check termination

  • If n == 1, proceed to Step 5.
  • Otherwise, go back to Step 2.

Important rules:

  • NEVER fabricate or simulate tool call results.
  • NEVER make multiple tool calls in a single response.
  • ALWAYS wait for the actual tool response before deciding next steps.

5. Report the result

Print the complete list of prime factors, for example:

1024 = 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2

Also report:

  • Starting number
  • Total steps taken (number of tool calls made)
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 · 62 lines · 33 tokens per session scan A de78f52a452e

Subscribe to this mod's changes

factor-step-by-step is a skill published in the GitHub repository nerdai/llm-agents-from-scratch (194 stars, last pushed yesterday), licensed Apache-2.0. It adds 33 tokens to every session and 349 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-25.

Related

factor-step-by-step compared with skills from other repositories

factor-step-by-step next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
factor-step-by-stepnerdai/llm-agents-from-scratchSkill194yesterdayApache-2.0A33Claude Code, Codex
hr-onboardingnexu-io/open-designSkill106kyesterdayApache-2.0A62Claude Code, Codex
book-mirrorgarrytan/gbrainSkill32kyesterdayMITA138Claude Code
exam-forecastanthropics/claude-for-legalSkill9.9k3d agoApache-2.0A73Claude Code
lean-formalizewanshuiyin/Auto-claude-code-research-in-sleepSkill19k3d agoMITA81Claude Code
eli5companion-inc/feynmanSkill10k6d agoMITA63Claude Code, Codex
deck-course-modulenexu-io/html-anythingSkill9.4k24d agoApache-2.0A25Claude Code, Codex