sagemath

sagemath is a skill for Claude Code, Codex from 02loveslollipop/OpenCROW. It costs 68 tokens per session (1,285 once invoked), scanned A, original, Apache-2.0.

A runner for SageMath, a mathematics system used for areas such as number theory, algebra, and cryptography.

In plain words
What is it for?
Solving cryptography and CTF tasks involving finite fields, elliptic curves, lattices, polynomial algebra, modular arithmetic, discrete logarithms, and random-number analysis.
Why use it?
It provides a consistent way to run Sage code or files when ordinary Python is not enough for the mathematical operations involved.

Skill for Claude CodeCodex

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

Good fit Solving cryptography and CTF tasks involving finite fields, elliptic curves, lattices, polynomial algebra, modular arithmetic, discrete logarithms, and random-number analysis.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/02loveslollipop/opencrow/sagemath
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 02loveslollipop/OpenCROW --skill sagemath
Clone the repo
git clone --depth 1 https://github.com/02loveslollipop/OpenCROW

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 sagemath

README.md
[![agentmods](https://agentmods.dev/badge/skills/02loveslollipop/opencrow/sagemath/github.svg)](https://agentmods.dev/skills/02loveslollipop/opencrow/sagemath)
Your own site
<a href="https://agentmods.dev/skills/02loveslollipop/opencrow/sagemath"><img src="https://agentmods.dev/badge/skills/02loveslollipop/opencrow/sagemath/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 sagemath

Your own site · 80×15
<a href="https://agentmods.dev/skills/02loveslollipop/opencrow/sagemath"><img src="https://agentmods.dev/badge/skills/02loveslollipop/opencrow/sagemath.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,285 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00068 $0.01285
Opus 5 $0.00034 $0.00642
Sonnet 5 $0.00014 $0.00257
Haiku 4.5 $0.00007 $0.00128

Measured 9d ago against content hash c24664e8fe0f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sagemath 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/run_sage.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/sagemath/SKILL.md · 95 lines

How it starts

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

OpenCROW Runner - SageMath

Runtime preflight

Probe required commands with command -v and Python modules with importlib.util.find_spec before use. Prefer a PATH-resolved OpenCROW MCP helper or the ctf/sage environment when available, then the managed helper or system Python. If a capability is missing, stop that path safely and report the exact missing command or module.

Use this skill to execute SageMath reliably from the best detected Sage runtime.

Quick Start

Use the bundled runner:

python3 scripts/run_sage.py --code 'print(factor(2^20 - 1))'

Or execute an existing .sage file:

python3 scripts/run_sage.py --file /absolute/path/to/script.sage

Workflow

  1. Decide whether the task is best expressed as inline code or a .sage file.
  2. For small one-off computations, pass the code with --code.
  3. For longer programs or reusable work, create a .sage file and pass it with --file.
  4. For CTF crypto tasks, prefer Sage when the problem involves polynomial rings, finite fields, matrices over modular domains, lattices, or symbolic number theory operations.
  5. Review stdout/stderr from SageMath and report the meaningful result back to the user.

Runner Notes

  • The runner probes OPENCROW_SAGE, a Conda environment named sage, and then a PATH-resolved sage command. If all are missing it reports that exact capability gap.
  • For --code, the runner writes the code into a temporary .sage file first. This avoids quoting issues and keeps behavior aligned with file execution.
  • Pass --timeout SECONDS when a computation may hang or run too long.
  • Pass --keep-temp only when debugging generated Sage code.

Patterns

For inline calculations:

python3 scripts/run_sage.py --code '
R.<x> = QQ[]
f = x^4 - 1
print(f.factor())
'

For file-based workflows:

  1. Create a .sage file in the workspace.
  2. Run it with the bundled runner.
  3. If the script generates files, verify the outputs before replying.

For CTF cryptography workflows:

Read the full file on GitHub · 95 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. 9d ago First seen · 95 lines · 68 tokens per session scan A c24664e8fe0f

Subscribe to this mod's changes

sagemath is a skill published in the GitHub repository 02loveslollipop/OpenCROW (8 stars, last pushed 2d ago), licensed Apache-2.0. It adds 68 tokens to every session and 1,285 once invoked, about $0.0003 per session on Opus 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.