depyler: Command for Claude Code

.claude/commands/improve-compile-rate.md

improve-compile-rate is a command for Claude Code from paiml/depyler. It costs 0 tokens per session (578 once invoked), scanned A, original, MIT.

An autonomous work plan for improving Depyler’s single-shot compile rate—the share of Python examples that compile successfully into Rust on the first attempt—to 80% on a named example collection.

In plain words
What is it for?
Use it to find the most common conversion errors, inspect failing Python and Rust, change Depyler, run its tests and checks, and measure the updated compile rate.
Why use it?
It provides a repeatable loop for measuring failures, investigating the generated code, fixing the compiler, and checking whether the result improved. This avoids judging progress without measurements.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is paiml/depyler's own configuration. It tells Claude Code how to work on depyler itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything depyler configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/noah/src/reprorusted-python-cli.

Reuse

Borrowing it

Nothing to install: this file belongs to paiml/depyler. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/paiml/depyler/main/.claude/commands/improve-compile-rate.md
Clone the repo
git clone --depth 1 https://github.com/paiml/depyler

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 improve-compile-rate

README.md
[![agentmods](https://agentmods.dev/badge/commands/paiml/depyler/improve-compile-rate.svg)](https://agentmods.dev/commands/paiml/depyler/improve-compile-rate)
Your own site
<a href="https://agentmods.dev/commands/paiml/depyler/improve-compile-rate"><img src="https://agentmods.dev/badge/commands/paiml/depyler/improve-compile-rate.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 578 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.00000 $0.00578
Opus 5 $0.00000 $0.00289
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

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

Security

Grade A, and why

improve-compile-rate 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.

.claude/commands/improve-compile-rate.md · 74 lines

How it starts

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

Depyler Single-Shot Compile Rate: Autonomous Improvement Loop

Goal

Reach 80% single-shot compile rate on reprorusted-python-cli corpus. Work through bugs autonomously.

Measure First

cd /home/noah/src/reprorusted-python-cli
make corpus-retranspile
make corpus-e2e-rate

If >= 80%, report success and stop.

Iteration Loop

1. Find Top Error

cd /home/noah/src/reprorusted-python-cli
uv run python scripts/measure_compile_rate.py --json | jq -r '.failing[].error' | sort | uniq -c | sort -rn | head -5

2. Investigate

Find a failing example, read its Python source and generated Rust. Understand the gap.

3. Fix in depyler

Locations:

  • Module mappings → crates/depyler-core/src/direct_rules.rs
  • Type mappings → crates/depyler-core/src/type_mapper.rs
  • Expr generation → crates/depyler-core/src/rust_gen/expr_gen.rs
  • Cargo.toml → crates/depyler-core/src/cargo_toml_gen.rs

4. Validate

cd /home/noah/src/depyler
cargo test -p depyler-core
cargo clippy -p depyler-core -- -D warnings

If fails: git checkout -- . and try different approach.

5. Measure Impact

cargo install --path crates/depyler --force
cd /home/noah/src/reprorusted-python-cli
make corpus-retranspile && make corpus-e2e-rate

If regression: rollback. If no change: still commit (may help other metrics).

6. Commit

git add -A && git commit -m "fix(core): [description] (Refs #193)"

7. Repeat until 80%

Bug Recovery

Issue Action
Tests fail Rollback, try narrower fix
Regression Rollback, add guards
Same error 3x Skip, move to next pattern
Transpile drops Rollback, fix is too broad

Priority Errors (from corpus analysis)

  1. cannot find value os - 16 files
  2. cannot find function date - 10 files
  3. expected value, found crate tempfile - 8 files
  4. SCRIPT defined multiple times - 5 files

Exit

  • SUCCESS: Rate >= 80%
  • STUCK: No progress 5 iterations
  • BLOCKED: Can't fix failing tests

Read the full file on GitHub · 74 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. 8d ago First seen · 74 lines · 0 tokens per session scan A c61192634bc1

Subscribe to this mod's changes

improve-compile-rate is a command published in the GitHub repository paiml/depyler (358 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 578 tokens. 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.