Chat APIs are the wrong hammer for repo-wide refactors. Use Bedrock batch inference (or equivalent overnight jobs) to process large file sets cheaply, then apply intents in controlled daytime merges.
⚡ TL;DR: Queue file shards → batch model job → intents JSONL → daytime apply with CI. Not for interactive chat.
Batch shape
# batch/shard.py
def shards(paths: list[str], n=50):
for i in range(0, len(paths), n):
yield paths[i:i+n]
{"recordId": "f-001", "modelInput": {"messages": [{"role": "user", "content": "Emit rename intents for…"}]}}
# submit Bedrock batch (illustrative)
aws bedrock create-model-invocation-job \
--job-name refactor-2026-09-11 \
--role-arn arn:aws:iam::123:role/bedrock-batch \
--model-id anthropic.claude-… \
--input-data-config s3InputDataConfig={s3Uri=s3://batch/in/} \
--output-data-config s3OutputDataConfig={s3Uri=s3://batch/out/}
Daytime apply
Never auto-merge overnight batch output. Humans + CI apply intents in PRs sliced by directory.
Closing checklist
- [ ] Shard inputs
- [ ] Batch for offline refactors
- [ ] Validate intents before apply
- [ ] Cost-compare vs interactive
- [ ] Keep human merge gates
Series navigation
Day 73: Draft-Then-Verify Routing · Day 75: Autoscaling Retrieval and Embed Jobs
Last updated September 11, 2026
Discover more from CheatCoders
Subscribe to get the latest posts sent to your email.
