diff --git a/.claude/settings.example.json b/.claude/settings.example.json index e5608e0..6c2978f 100644 --- a/.claude/settings.example.json +++ b/.claude/settings.example.json @@ -35,7 +35,7 @@ }, { "type": "command", - "command": "if [ \"$MLFLOW_CLAUDE_TRACING_ENABLED\" = \"true\" ]; then mlflow autolog claude -u http://127.0.0.1:$MLFLOW_PORT -n $MLFLOW_EXPERIMENT_NAME; fi" + "command": "if [ \"$MLFLOW_CLAUDE_TRACING_ENABLED\" = \"true\" ]; then python3 -c \"import mlflow; client=mlflow.tracking.MlflowClient(tracking_uri='http://127.0.0.1:$MLFLOW_PORT'); exp=client.get_experiment_by_name('$MLFLOW_EXPERIMENT_NAME'); client.restore_experiment(exp.experiment_id) if exp and exp.lifecycle_stage == 'deleted' else None\" && mlflow autolog claude -u http://127.0.0.1:$MLFLOW_PORT -n $MLFLOW_EXPERIMENT_NAME; fi" } ] } diff --git a/docs/mlflow-tracing.md b/docs/mlflow-tracing.md index a08d3b9..43ce303 100644 --- a/docs/mlflow-tracing.md +++ b/docs/mlflow-tracing.md @@ -25,11 +25,11 @@ Use `.claude/settings.example.json` and copy the MLflow-related keys/hook blocks Required pieces: - `MLFLOW_CLAUDE_TRACING_ENABLED`, `MLFLOW_PORT`, `MLFLOW_EXPERIMENT_NAME` - `SessionStart` and `Stop` hooks - -## 4) Enable autologging and verify +Note: Set MLFLOW_CLAUDE_TRACING_ENABLED to false to disable tracking +## 4) Start claude ```bash -mlflow autolog claude -u "http://127.0.0.1:$MLFLOW_PORT" -n "$MLFLOW_EXPERIMENT_NAME" +claude ``` Then run Claude and execute an RCA prompt. If configured correctly, traces appear in your MLflow UI. diff --git a/skills/root-cause-analysis/SKILL.md b/skills/root-cause-analysis/SKILL.md index 4cb7f39..eb756a9 100644 --- a/skills/root-cause-analysis/SKILL.md +++ b/skills/root-cause-analysis/SKILL.md @@ -81,7 +81,7 @@ If any checks have `"status": "missing"` and `"configurable": true`, offer to he }, { "type": "command", - "command": "if [ \"$MLFLOW_CLAUDE_TRACING_ENABLED\" = \"true\" ]; then mlflow autolog claude -u http://127.0.0.1:$MLFLOW_PORT -n $MLFLOW_EXPERIMENT_NAME; fi" + "command": "if [ \"$MLFLOW_CLAUDE_TRACING_ENABLED\" = \"true\" ]; then python3 -c \"import mlflow; client=mlflow.tracking.MlflowClient(tracking_uri='http://127.0.0.1:$MLFLOW_PORT'); exp=client.get_experiment_by_name('$MLFLOW_EXPERIMENT_NAME'); client.restore_experiment(exp.experiment_id) if exp and exp.lifecycle_stage == 'deleted' else None\" && mlflow autolog claude -u http://127.0.0.1:$MLFLOW_PORT -n $MLFLOW_EXPERIMENT_NAME; fi" } ] }