gradient-methods

gradient-methods is a skill for Claude Code from parcadei/Continuous-Claude-v3. It costs 12 tokens per session (1,054 once invoked), scanned A, original, MIT.

A guide to gradient-based methods for finding low points of mathematical functions. It covers step-size choices, faster variants, Newton’s method, and ways to check whether the method is converging.

In plain words
What is it for?
Use it to solve optimization exercises, select methods such as gradient descent or BFGS, choose step sizes, and diagnose convergence.
Why use it?
It helps choose and check an optimization method instead of adjusting update rules by guesswork. It also explains common problems such as steps that are too large or oscillating results.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

About the project

Continuous-Claude-v3 is a Claude Code development environment that preserves working context between sessions, coordinates specialized agents, and stores project knowledge through ledgers, handoffs, and analysis tools. It is for people using Claude Code on ongoing or complex software work. Its catalogue entries are the skills, agents, hooks, plugin, and setting that provide its workflows and orchestration.

parcadei/Continuous-Claude-v3 · 3,936 stars · on GitHub

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.

agentmods
npx agentmods add skills/parcadei/continuous-claude-v3/gradient-methods
Any agent
npx skills add parcadei/Continuous-Claude-v3 --skill gradient-methods
Clone the repo
git clone --depth 1 https://github.com/parcadei/Continuous-Claude-v3

Made for: Claude Code.

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 gradient-methods

README.md
[![agentmods](https://agentmods.dev/badge/skills/parcadei/continuous-claude-v3/gradient-methods.svg)](https://agentmods.dev/skills/parcadei/continuous-claude-v3/gradient-methods)
Your own site
<a href="https://agentmods.dev/skills/parcadei/continuous-claude-v3/gradient-methods"><img src="https://agentmods.dev/badge/skills/parcadei/continuous-claude-v3/gradient-methods.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00012 $0.01054
Opus 5 $0.00006 $0.00527
Sonnet 5 $0.00002 $0.00211
Haiku 4.5 $0.00001 $0.00105

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

Security

Grade A, and why

gradient-methods 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 2d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.claude/skills/math/optimization/gradient-methods/SKILL.md · 78 lines

How it starts

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

Gradient Methods

When to Use

Use this skill when working on gradient-methods problems in optimization.

Decision Tree

  1. Basic Gradient Descent

    • Update: x_{k+1} = x_k - alpha * grad f(x_k)
    • Step size alpha: fixed, diminishing, or line search
    • Convergence: O(1/k) for convex, linear for strongly convex
  2. Step Size Selection

    Method Approach
    Fixed alpha constant (requires tuning)
    Backtracking Armijo condition: f(x - alphagrad) <= f(x) - calpha*
    Exact line search minimize f(x - alpha*grad) over alpha
    Adaptive Adam, RMSprop (ML applications)
  3. Accelerated Methods

    • Momentum: add velocity term
    • Nesterov: look-ahead gradient
    • Conjugate gradient: for quadratic functions
    • scipy.optimize.minimize(f, x0, method='CG') - conjugate gradient
  4. Newton's Method

    • Update: x_{k+1} = x_k - H^{-1} * grad f
    • Requires Hessian (expensive but quadratic convergence)
    • Quasi-Newton (BFGS): approximate Hessian
    • scipy.optimize.minimize(f, x0, method='BFGS')
  5. Convergence Diagnostics

    • Monitor ||grad f|| < tolerance
    • Check function value decrease
    • Watch for oscillation (step size too large)
    • sympy_compute.py diff "f" --var x for gradient

Tool Commands

Scipy_Bfgs

uv run python -c "from scipy.optimize import minimize; res = minimize(lambda x: (x[0]-1)**2 + 100*(x[1]-x[0]**2)**2, [0, 0], method='BFGS'); print('Rosenbrock min at', res.x)"

Scipy_Cg

uv run python -c "from scipy.optimize import minimize; res = minimize(lambda x: x[0]**2 + x[1]**2, [1, 1], method='CG'); print('Min at', res.x)"

Sympy_Gradient

uv run python -m runtime.harness scripts/sympy_compute.py diff "x**2 + y**2" --var "[x, y]"

Key Techniques

From indexed textbooks:

  • [nonlinear programming_tif] Gradient Methods** - These methods use gradient information to iteratively approach the optimum. Convergence** - Addressing convergence properties. Descent Directions and Stepsize Rules:** Focuses on how to choose descent directions and appropriate step sizes.
  • [nonlinear programming_tif] The application of gradient methods to unconstrained optimal control prob- lems is straightforward in principle. For example the steepest descent method takes the form W = b oMV H, (kb ph,y), i=0,. Pl = Thus, given u¥, one computes zF by forward propagation of the system equation, and then p*¥ by backward propagation of the adjoint equation.
  • [nonlinear programming_tif] Footer or Trailing Row**: - There is an empty concluding element indicated by a single ". Overall, this table serves as an index for chapters or sections within a document, with particular emphasis on optimization methods and related mathematical strategies, as evidenced by the listed methods like Gradient, Newton, and other derivative techniques. The scattered letters and empty slots may denote a form of stylistic or formatting choice rather than meaningful content in this context.
  • [nonlinear programming_tif] Zoutendijk’s method uses tw ) oscalatse)Oand'ye 0,1), a i ! P, where ¢ — Y™k € and my is the firs onnegative k ok 28 %, ) it T #(z*,7"e) < -y (a) Show that (b) Prove that {d*} is gradient relat ishi i i Tt pones A related, thus establishing stationarity of the 2. Min-H Method for Optimal Control) Consider the problem of findin g sequences u = (z1,22,.
  • [nonlinear programming_tif] Mustration of the function f of Exercise 1. Stability) (www) We are often interested in whether optimal solutions change radically when the problem data are slightly perturbed. This issue is addressed by stability analysis, to be contrasted with sensitivity analysis, which deals with how much optimal solutions change when problem data change.

Read the full file on GitHub · 78 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. 2d ago First seen · 78 lines · 12 tokens per session scan A c32ac8806dba

Subscribe to this mod's changes

gradient-methods is a skill published in the GitHub repository parcadei/Continuous-Claude-v3 (3,936 stars, last pushed 7mo ago), licensed MIT. It adds 12 tokens to every session and 1,054 once invoked, about $0.0001 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-09-03.

Related

Other skills, from other repositories

tooluniverse-organic-chemistry

Organic chemistry reasoning guide for reaction product prediction, mechanism analysis (electrophilic/nucleophilic substitution, addition, elimination, pericyclic, radical), and spectroscopy interpretation (1H/13C NMR, IR, MS). Reasons from first principles (electron flow, kinetic vs thermodynamic) rather than…

mims-harvard/ToolUniverse · 86 tokens

scaffold-exercises

Scaffold a graded problem set with sections, problems, worked solutions, and short "why this matters" explainers across analytical, empirical, and coding types. Use when user says "make a problem set on X", "scaffold exercises for this lecture", "create practice problems", "generate homework with a solution key"…

pedrohcgs/claude-code-my-workflow · 101 tokens

assess-holistic-health

Conduct temperament-based health assessment from Hildegard von Bingen's Causae et Curae. Evaluates the four temperaments (sanguine, choleric, melancholic, phlegmatic), elemental correspondences (air, fire, earth, water), and provides dietary and lifestyle recommendations for rebalancing. Use when understanding…

pjt222/agent-almanac · 113 tokens

derive-theoretical-result

Derive a theoretical result step-by-step from first principles or established theorems, with every step explicitly justified and special cases checked. Use when deriving a formula or theorem from first principles, proving a mathematical statement by logical deduction, re-deriving a textbook result for verification or…

pjt222/agent-almanac · 86 tokens

analyze-prime-numbers

Analyze prime numbers using primality tests, factorization algorithms, prime distribution analysis, and sieve methods. Covers trial division, Miller-Rabin, Sieve of Eratosthenes, and the Prime Number Theorem. Use when determining whether an integer is prime or composite, finding prime factorizations, counting or…

pjt222/agent-almanac · 91 tokens

construct-geometric-figure

Perform a ruler-and-compass construction with step-by-step justification for each operation, producing a constructible geometric figure from given elements. Covers classical Euclidean constructions including perpendicular bisectors, angle bisectors, parallel lines, regular polygons, and tangent lines. Use when given…

pjt222/agent-almanac · 92 tokens