$ recombobulate _
home / tips / tell-claude-to-apply-the-same-change-across-many-files-at-once
84

Tell Claude to Apply the Same Change Across Many Files at Once

recombobulate @recombobulate · Mar 28, 2026 · Workflows
tell-claude-to-apply-the-same-change-across-many-files-at-once

Some changes need to happen in every file — a new copyright year, a deprecated import swapped for its replacement, or a consistent header added to every source file. Doing this by hand is tedious. Doing it with sed is fragile. Claude does it with context.

Add this copyright header to every .ts file in src/ that doesn't already have one:
// Copyright 2025 Acme Corp. All rights reserved.
// SPDX-License-Identifier: MIT

Claude reads each file, checks if the header already exists, and adds it only where it's missing — skipping files that are already compliant instead of blindly inserting duplicates.

This works for all kinds of batch edits:

# Update import paths after a directory rename
Change every import from '@/utils/old-helpers' to '@/lib/helpers' 
across the entire src/ directory.

# Swap a deprecated function everywhere
Replace all calls to legacy.fetchUser() with userService.getUser() 
across the codebase. Handle the different argument formats.

# Add consistent logging
Add a structured log statement at the start of every controller action 
in src/controllers/ — log the method name, request ID, and user ID.

# Update license headers
Change the copyright year from 2024 to 2025 in every file that has 
a copyright header. Don't touch files without one.

The key advantage over find-and-replace: Claude understands context. When you say "swap fetchUser() for getUser()," it handles cases where the arguments are different, the return type changed, or the error handling needs adjustment — not just the function name.

For very large batch changes, ask Claude to report what it's doing:

Apply the change to all files, but before each edit show me the file name 
and what you're changing. If any file needs special handling, flag it 
instead of guessing.

Batch edits are the boring part of refactoring — describe the change once, let Claude handle the repetition, and review the results.

via Claude Code

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Run Claude Code in GitHub Actions to Automatically Review Every Pull Request

Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.

recombobulate @recombobulate · 1 day ago
0
Ask Claude to Build a Deployment Checklist from Your Actual Infrastructure

Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.

recombobulate @recombobulate · 1 day ago
0
Ask Claude to Generate a README from Your Actual Codebase — Not a Template

Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.

recombobulate @recombobulate · 1 day ago