Agent-rewritten optimizer during training
OPAL wraps a PyTorch optimizer so Claude Code can rewrite the update rule and analysis programs while the model trains.
In the author's runs, SiT-B/2 FID-50K fell from 35.7 to 23.6 and LightningDiT-B/1 from 3.22 to 2.31 versus official recipes.
Overview
How it was set up
Wrap your PyTorch optimizer with opal.wrap, pass goal and a cost cap, and run Claude Code logged in on rank 0. Dry run uses backend=keep.
Worth knowing
Not always better: one modded-nanogpt run ended worse than the record. Agent waiting adds time, so short runs slow down badly.
A prompt to start from
The source does not show the prompt.
Sources 1
History
- Source published
- 2026-10-21
- Added to Agentic Feats
- 2026-10-26
- Pick
- No
- Markdown copy
- /c/agent-rewritten-optimizer-during-training-claude-code.md
More in coding
131 featsResult$28,335 spent, 9,350 commits across 145 repos, with spend up 7.4x in April after parallel git worktrees. Only 0.7% of tool calls ran overnight.
ResultOpus 5.5 recorded the repo's demo video itself using the record feature, and the author uses the tool constantly for debugging.
ResultA nightly workflow found a meteor on 25 October 2026. The bundled night detector found 95% of planes and 90% of meteors on held-out nights.