ds-learn

ds-learn is a command for Claude Code from StamKavid/last-ds-mile. It costs 11 tokens per session (473 once invoked), scanned A, original, MIT.

A command for recording a meaningful failure and its fix as a reusable project lesson. It can label the lesson by workflow stage and relevant data-science topics.

In plain words
What is it for?
Use it after a failure has been diagnosed and fixed to save the cause, solution, and relevant tags in the project’s learning log.
Why use it?
It prevents important debugging knowledge from being lost and allows related lessons to surface again later.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

Part of the last-ds-mile plugin — 29 skills, 17 commands, 3 agents, 4 hooks shipped together

Good fit Use it after a failure has been diagnosed and fixed to save the cause, solution, and relevant tags in the project’s learning log.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/stamkavid/last-ds-mile/ds-learn
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.

Clone the repo
git clone --depth 1 https://github.com/StamKavid/last-ds-mile

Made for: Claude Code.

Or install last-ds-mile, the plugin that ships this one along with the rest of its 29 skills, 17 commands, 3 agents, 4 hooks.

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 ds-learn

README.md
[![agentmods](https://agentmods.dev/badge/commands/stamkavid/last-ds-mile/ds-learn.svg)](https://agentmods.dev/commands/stamkavid/last-ds-mile/ds-learn)
Your own site
<a href="https://agentmods.dev/commands/stamkavid/last-ds-mile/ds-learn"><img src="https://agentmods.dev/badge/commands/stamkavid/last-ds-mile/ds-learn.svg" alt="Measured on agentmods" height="20"></a>
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 473 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.00011 $0.00473
Opus 5 $0.00005 $0.00236
Sonnet 5 $0.00002 $0.00095
Haiku 4.5 $0.00001 $0.00047

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

Security

Grade A, and why

ds-learn 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 8d 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.

commands/ds-learn.md · 32 lines

What it actually says

Invoke the capturing-learnings skill now via the Skill tool to determine whether what just happened clears the bar for a real lesson, and to get the capture format. (This command's steps below are the mechanical write path; capturing-learnings's own Core Process covers the judgment call and also fires as a standalone proactive nudge — the two lists overlap by design, not by drift; keep them in sync if either changes.) Then:

  1. If the user provided details in $ARGUMENTS, use them. Otherwise ask what broke and what fixed it.
  2. Determine tags: always include the current or next pipeline stage (ds-frame through ds-handoff, from .last-ds-mile/stages/ — same stage /ds would route to next) so the lesson can resurface via SessionStart's stage-based matching, plus any domain skill(s) (target-leakage-detection, imbalanced-data, etc.) genuinely relevant. A skill-only tag with no stage tag will never resurface automatically — nothing in this plugin re-attaches a captured entry to a skill file, so always include a stage tag if you want this lesson to resurface.
  3. Append one line to .last-ds-mile/learnings.jsonl (create the file and its parent .last-ds-mile/ directory if either doesn't exist yet) with this exact shape:
{"type": "lesson", "recorded_at": "<current UTC timestamp in the same format datetime.now(timezone.utc).isoformat() produces, e.g. 2026-07-10T14:23:45.123456+00:00 — matches what hooks/stop_persist_learnings.py already writes to this same file>", "session_id": "unknown", "title": "<short title>", "what_broke": "<the specific failure>", "what_fixed_it": "<the specific fix>", "tags": ["<stage-or-skill-name>", "..."]}
  1. Confirm back to the user in one line: what was captured and which tags it was filed under.
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. 8d ago First seen · 32 lines · 11 tokens per session scan A ce3a04f51d05

Subscribe to this mod's changes

ds-learn is a command published in the GitHub repository StamKavid/last-ds-mile (3 stars, last pushed 1mo ago), licensed MIT. It adds 11 tokens to every session and 473 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-08-31.