coding-import

A command that fetches a public LeetCode programming problem and saves it as a Markdown file in your local practice library. It accepts a problem URL, a problem slug, or the daily problem.

In plain words
What is it for?
Use it to build a local collection of LeetCode problems for interview practice, coding exercises, or mock sessions.
Why use it?
It removes the need to copy problem details into your notes by hand. It also keeps the import read-only and requires no LeetCode login.

Command

Part of the swe-interview-coach plugin — 3 skills, 17 commands, 4 agents shipped together

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 commands/kirilxd/swe-interview-coach/coding-import
Clone the repo
git clone --depth 1 https://github.com/kirilxd/swe-interview-coach

Or install swe-interview-coach, the plugin that ships this one along with the rest of its 3 skills, 17 commands, 4 agents.

Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,439 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 $0.00032 $0.01439
Opus 5 $0.00016 $0.00720
Sonnet 5 $0.00006 $0.00288
Haiku 4.5 $0.00003 $0.00144

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

Security

Grade A, and why

coding-import 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 3d 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/coding-import.md · 87 lines

How it starts

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

You are running /coding-import. You import a single LeetCode problem into the user's local library as a normal markdown entry, using only the WebFetch tool — no MCP server, no login, no auth, no submission, and no redistribution beyond the user's own machine. This is a read-only fetch of a public problem page for personal interview prep.

Step 1 — Parse $ARGUMENTS

Resolve $ARGUMENTS into a slug and a fetch target:

  • A full URL like https://leetcode.com/problems/<slug>/ → extract <slug> (the path segment after problems/); fetch target is that URL.
  • A bare slug like two-sum (kebab-case, no slashes) → slug = <arg>; fetch target is https://leetcode.com/problems/<slug>/.
  • The literal daily → fetch target is the daily endpoint (Step 2); slug is not yet known and is filled in from the fetched title.

If $ARGUMENTS is empty, ask the user for a URL, slug, or daily, then stop until they answer.

Step 2 — Fetch with WebFetch

Fetch the problem with the WebFetch tool (the same tool the behavioral commands use) — no auth header, no cookies, no login.

  1. Primary (URL/slug): WebFetch the https://leetcode.com/problems/<slug>/ page. Prompt it to extract: title, difficulty (Easy/Medium/Hard), the full problem statement, every worked example (input → output, plus any explanation), the constraints, and the function name + parameters if a code signature is shown.
  2. Fallback (extraction poor — LeetCode is JS-heavy, so the page often renders thin): if the primary fetch returns little or no statement/examples, WebFetch the unofficial REST endpoint instead, which returns JSON:
    • URL/slug: https://alfa-leetcode-api.onrender.com/select?titleSlug=<slug>
    • daily: https://alfa-leetcode-api.onrender.com/daily — then set slug from the returned titleSlug. Extract the same fields from the JSON (question/content HTML → statement + examples + constraints; difficulty; title).
  3. Both fail / empty: do NOT invent a problem — ask the user to paste the problem text (statement + examples + constraints) and build from that; if they decline, stop.

Read the full file on GitHub · 87 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. 3d ago First seen · 87 lines · 32 tokens per session scan A ad71631343ca

Subscribe to this mod's changes

coding-import is a command published in the GitHub repository kirilxd/swe-interview-coach (79 stars, last pushed 1mo ago), licensed MIT. It adds 32 tokens to every session and 1,439 once invoked, about $0.0002 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-30.