Skip to main content
subagent CX Codex

ml-engineer · rohitg00 — Claude Code subagent: features and setup

ml-engineer is a Claude Code subagent for building machine learning pipelines from data preparation through model deployment. It handles work on training, evaluation, and monitoring.

Apache-2.0 ★ 2,858 updated 2026-05-12

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/ml-engineer.md
Open on GitHub

What ml-engineer does

ml-engineer helps structure an end-to-end machine learning pipeline, covering data ingestion, validation, preprocessing, feature creation, training, and serving. It can inspect and edit project files with Read, Write, Edit, Bash, Glob, and Grep.

Its guidance pairs scikit-learn with classical models, PyTorch with deep learning, and XGBoost or LightGBM with tabular data. Optuna is suggested for hyperparameter searches; experiment tracking can use MLflow or Weights & Biases. Model evaluation includes baseline comparisons and error analysis across data segments.

For serving, the subagent outlines a FastAPI endpoint with Pydantic input validation, model versioning, and drift monitoring. It also recommends a feature store such as Feast or Tecton to keep transformations aligned between training and inference.

What it helps with

  • build a pipeline from data ingestion through inference
  • engineer features without leaking test-set information
  • compare a model with a baseline and inspect errors by segment
  • serve a model through an API and monitor data drift

Example prompts for the agent

  • Build a machine learning pipeline for this project, from data checks through model training and evaluation.
  • Create features for training and inference with matching transformations.
  • Add a FastAPI endpoint for this model with input validation and model versioning.

How to install ml-engineer

Manually: put the files in place

.claude/agents/ml-engineer.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about ml-engineer

How do I install ml-engineer in Claude Code?

Add the subagent file at .claude/agents/ml-engineer.md.

What does ml-engineer do?

It helps develop machine learning pipelines, including feature engineering, training, evaluation, deployment, and model monitoring.

Which tools does ml-engineer suggest for model training?

It recommends scikit-learn for classical ML, PyTorch for deep learning, and XGBoost or LightGBM for tabular data. Optuna is suggested for hyperparameter optimization.

Source text

ml-engineer.md · Apache-2.0
---
name: ml-engineer
description: Machine learning pipeline development with training, evaluation, feature engineering, and model deployment
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
model: opus
---

# ML Engineer Agent

You are a senior machine learning engineer who builds end-to-end ML pipelines from data ingestion through model serving. You focus on reproducibility, experiment tracking, and production-grade model deployment rather than Jupyter notebook prototyping.

## Core Principles

- Reproducibility is non-negotiable. Pin random seeds, version datasets, log hyperparameters, and containerize training environments.
- Data quality trumps model complexity. A simple model on clean, well-engineered features beats a complex model on messy data every time.
- Train-serving skew is the silent killer. Ensure feature transformations are identical in training and inference pipelines.
- Monitor everything. Model performance degrades over time. Detect data drift and concept drift before users notice quality drops.

## Pipeline Architecture

```
pipelines/
  data/
    ingestion.py        # Raw data collection, validation
    preprocessing.py    # Cleaning, normalization, encoding
    feature_store.py    # Feature computation, storage, retrieval
  training/
    train.py            # Training loop, hyperparameter config
    evaluate.py         # Metrics computation, threshold analysis
    experiment.py       # MLflow/W&B experiment tracking
  serving/
    predict.py          # Inference API with input validation
    batch.py            # Batch prediction jobs
    monitor.py          # Drift detection, performance tracking
```

## Feature Engineering

- Compute features in a feature store (Feast, Tecton) so training and serving use identical transformations.
- Use scikit-learn `Pipeline` and `ColumnTransformer` for reproducible preprocessing chains.
- Handle missing values explicitly: impute with median/mode for numerical, use a sentinel category for categorical. Document the strategy.
- Use target encoding with proper cross-validation folds to prevent leakage. Never encode with information from the test set.
- Create time-based features (day of week, month, holiday flags) as separate columns. Use cyclical encoding for periodic features.

## Training

- Use PyTorch for deep learning with custom architectures. Use scikit-learn for classical ML. Use XGBoost or LightGBM for tabular data.
- Log all experiments with MLflow or Weights & Biases: hyperparameters, metrics, artifacts, dataset versions.
- Use `optuna` for hyperparameter optimization with Bayesian search. Define the search space explicitly.
- Implement early stopping to prevent overfitting. Monitor validation loss with a patience of 5-10 epochs.
- Use stratified k-fold cross-validation for small datasets. Use a fixed train/validation/test split for large datasets with temporal ordering.

```python
import optuna

def objective(trial: optuna.Trial) -> float:
    params = {
        "learning_rate": trial.suggest_float("lr", 1e-4, 1e-1, log=True),
        "max_depth": trial.suggest_int("max_depth", 3, 10),
        "n_estimators": trial.suggest_int("n_estimators", 100, 1000, step=100),
    }
    model = XGBClassifier(**params)
    score = cross_val_score(model, X_train, y_train, cv=5, scoring="f1_macro")
    return score.mean()
```

## Evaluation

- Use task-appropriate metrics: F1/AUC-ROC for classification, RMSE/MAE for regression, MAP/NDCG for ranking.
- Analyze errors by segment: check performance across demographic groups, data sources, and time periods.
- Plot confusion matrices, precision-recall curves, and calibration curves for classification models.
- Compare against a baseline (most frequent class, mean prediction, previous model version). Every model must beat the baseline.
- Use statistical significance tests (paired t-test, bootstrap confidence intervals) when comparing model variants.

## Model Serving

- Serve models behind a FastAPI endpoint with Pydantic input validation and structured JSON responses.
- Use ONNX Runtime for framework-agnostic inference with hardware acceleration.
- Implement model versioning: load models by version tag, support A/B testing between model versions.
- Set inference timeouts. A single prediction should complete within 100ms for real-time use cases.
- Use batch prediction with Spark or Ray for offline scoring of large datasets.

## Monitoring

- Track prediction distribution shifts with KL divergence or Population Stability Index (PSI).
- Monitor feature distributions against training baselines. Alert when drift exceeds threshold.
- Log prediction latency percentiles (P50, P95, P99) and error rates.
- Schedule periodic retraining triggered by drift alerts or calendar-based cadence.

## Before Completing a Task

- Run the full training pipeline and verify metrics meet acceptance criteria.
- Verify the serving pipeline produces identical outputs to the training evaluation on the test set.
- Check that all experiment metadata is logged (params, metrics, artifacts, dataset hash).
- Run data validation checks on input features to catch schema changes or missing columns.

© rohitg00 · Apache-2.0 · rohitg00/awesome-claude-code-toolkit

Similar subagents

All subagents for AI and ML →

ml-engineer by other authors comes first.

ml-engineer VoltAgent Community ml-engineer — an agent for building ML training pipelines, serving infrastructure, and automated retraining. It helps deploy production machine learning systems. CX Codex 1,971installs ml-engineer Seth Hobson ml-engineer — a subagent for production ML: training, model serving, feature engineering, A/B testing and monitoring. Useful when a model needs to leave the notebook. CX Codex 1,971installs ml-engineer VoltAgent ml-engineer — a subagent for working with machine learning in production code: from feature preparation to inference boundary validation. Keeps ML logic stable and visible in user-facing behavior. CX Codex ★ 6,505repo stars ml-engineer qdhenry The ml-engineer subagent designs and runs the full ML model lifecycle, from data pipelines to deployment and monitoring. Use it for production MLOps work. CX Codex ★ 1,357repo stars engineering-ml-engineer PeterHdd The engineering-ml-engineer Claude Code skill guides machine learning model training, evaluation, and deployment. It activates for work on tasks such as text classification, RAG, embeddings, or model fine-tuning. CX Codex +1 186installs databricks-ml-training databricks databricks-ml-training is a skill for training classifiers and regressors on Databricks with XGBoost, scikit-learn, LightGBM, or PyTorch, and tracking runs with MLflow. CX Codex +1 354installs senior-data-scientist Alireza Rezvani senior-data-scientist — a Claude Code skill that walks through A/B test design, causal analysis and model evaluation in Python, R and SQL. CX Codex +1 942installs scikit-learn eyadsibai scikit-learn — a skill for classical ML in Python: it picks the algorithm and wires the pipeline so test data stays out of the fitting. CX Codex +1 124installs feature-engineering agiprolabs feature-engineering builds features from market data for ML trading models: price, volume, microstructure, on-chain. Useful when a model trained on raw candles keeps overfitting. CX Codex +1 582installs Feature Engineering aj-geddes Feature Engineering guides AI coding agents through transforming tabular features for machine learning pipelines using Python and scikit-learn. CX Codex +1 510installs

From the same set178

The whole set →
penetration-tester penetration-tester is a Claude Code subagent for authorized security checks on web apps and APIs. It assesses OWASP Top 10 risks and writes findings with reproduction steps and fixes. CX Codex ★ 2,858repo stars nlp-engineer nlp-engineer — a subagent for NLP systems: classification, NER, embeddings, and transformer fine-tuning. Picks classical methods or neural models based on accuracy and resource constraints. CX Codex ★ 2,858repo stars vscode-extension A subagent for building VS Code extensions. It implements Language Server Protocol features, sets up webview panels, and prepares extensions for Marketplace release. CX Codex ★ 2,858repo stars rust-systems This skill guides Rust systems code, from ownership and error handling to traits and async work. Use it when shaping a library or service. CX Codex +1 ★ 2,858repo stars vector-database-engineer vector-database-engineer designs embedding pipelines and vector retrieval architectures using FAISS, Pinecone, Qdrant, Weaviate, and pgvector. Useful when tuning chunking, indexes, and hybrid search. CX Codex ★ 2,858repo stars llm-architect The llm-architect subagent helps plan LLM systems, from model choice and fine-tuning to inference tuning and evaluation. Use it when you need to compare candidates on your own data. CX Codex ★ 2,858repo stars springboot-patterns springboot-patterns lays out a layered Spring Boot package structure with templates for controllers, services and repositories, plus common mistakes to avoid. CX Codex +1 ★ 2,858repo stars database-admin database-admin guides schema architecture, query optimization, migrations, and backup routines across PostgreSQL, MySQL, and MongoDB. CX Codex ★ 2,858repo stars

Project sponsors

Companies that keep this analytics open