Relay365Multi-model API relay desk
← All desk bulletins
Agent shift notesEN1 desk reads

02:00 Shift Note: Claude Code Migration Gates

Tonight’s choice is autonomy or controlled batches

An overnight migration succeeds when the morning engineer can explain every change, not merely when the agent reports completion. For Claude Code, the useful head-to-head comparison is unrestricted repository-wide execution against a gated batch runner. Both can produce patches. Only the second makes stopping, inspection, and recovery explicit.

This shift note assumes a repository migration: replacing deprecated APIs, updating configuration formats, or changing repeated source patterns. Production data migrations need a separate execution plan, access review, and recovery procedure. Do not treat a passing source-code migration as permission to rewrite live data.

Unrestricted execution wins on setup, loses on containment

The unrestricted approach starts with a broad instruction, generous tool permissions, and an overnight deadline. Its appeal is real: little orchestration, fewer handoffs, and room for Claude Code to discover unexpected dependencies.

The same freedom increases the potential impact of mistakes. An agent can expand scope to repair unrelated failures, repeatedly attempt an expensive operation, or leave a large patch whose intermediate state is difficult to reconstruct. A successful tool exit does not establish that the migration preserved behavior.

Verdict: Reserve broad autonomous exploration for disposable environments without production credentials. It is a poor default for an unattended migration touching a valuable working tree.

Gated batches win on recoverability and review

The controlled approach gives Claude Code a bounded unit of work while an external runner owns the queue, limits, validation, and stop decisions. Define batches by package or dependency boundary rather than arbitrary file counts. Keep each patch small enough for a reviewer to understand independently.

  • Start from a recorded commit in a dedicated branch and isolated worktree, with only the credentials and network access the task actually needs.
  • Record the batch identifier, input revision, approved paths, acceptance checks, and output commit in a durable journal outside the agent’s editable workspace.
  • Run formatting, type checks, targeted tests, and migration-specific assertions before accepting a batch.
  • Stop on changes outside approved paths, failed checks, exhausted budgets, or an ambiguous result instead of asking the agent to improvise indefinitely.
  • Publish a morning handoff containing accepted commits, failed batches, logs, and the exact command or procedure for resuming.

Prompts describe scope; they do not enforce it. Use operating-system isolation, filesystem permissions, and runner-side diff checks where appropriate. Configure Claude Code permissions narrowly rather than disabling safeguards to avoid overnight prompts.

Verdict: Gated batches are the better default for unattended work. They require more preparation, but leave evidence that another engineer can verify.

Deterministic transforms beat repeated agent edits

There is another important comparison inside the batch runner: asking Claude Code to rewrite every occurrence versus having it develop a deterministic transform first. For mechanical replacements, a tested codemod is usually easier to rerun and audit. Claude Code can investigate exceptions and propose the transform; conventional tooling can apply it consistently.

Test the migration against representative fixtures, including already-migrated inputs. A rerun should either make no further changes or explicitly reject an unexpected state. For genuinely semantic edits, retain agent-generated patches but strengthen behavioral checks.

Verdict: Prefer deterministic execution for repetitive changes and bounded agent reasoning for exceptions. Do not spend the entire night rediscovering the same replacement rule.

Direct access and Relay365 have different operational boundaries

Direct provider access keeps fewer intermediaries in the request path. Relay365 instead offers a pay-as-you-go relay desk across multiple model families and works with Claude Code, Codex, Gemini CLI, and OpenAI SDK clients. That can fit teams consolidating access across tools.

The trade-off is another operational dependency. Before scheduling unattended work, verify the actual authentication flow, model mapping, tool behavior, data-handling requirements, and error handling on your chosen route. Relay365’s API base is https://api.api365relay.com; OpenAI clients add /v1. Do not assume that endpoint convention is also Claude Code’s configuration recipe.

Verdict: Choose direct access for a simpler request path, or Relay365 when consolidated access genuinely helps. Create a Relay365 account and validate one disposable batch before trusting an overnight queue.

Morning acceptance remains a human decision

Keep automatic merging and production deployment outside this overnight workflow. The final verdict is straightforward: let Claude Code generate bounded changes, let an external runner enforce gates, and let the incoming engineer accept the result. Completion is a logged, testable state—not an optimistic final message.

Further desk bulletins

Curious how it runs on your own code? Sign up →