Skip to main content
command CX Codex

batch-operations-prompt — Claude Code command: setup and usage

batch-operations-prompt transforms bulk code modification requests into structured plans with parallel stages and sequential tasks. It optimizes Claude Code execution through TodoWrite checklists.

MIT ★ 2,744 updated 2026-10-08

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/batch-operations-prompt.md
Open on GitHub

What batch-operations-prompt does

This command restructures complex refactoring requests into phased execution plans. It isolates read-only discovery tasks so they can run concurrently, while sequencing dependent file modifications. Each generated plan includes initial prerequisites, conflict checks, and sequential verification steps such as linting, test runs, and build validation.

You can provide instructions directly in the prompt or reference a specification file using relative or absolute paths like @path/to/plan.md. The command structures outputs into TodoWrite task lists, respecting Claude's constraints on concurrent in-progress items.

Unstructured bulk edits frequently cause race conditions across shared modules. This prompt forces the agent to group targets by conflict risk before touching code, calculating expected parallelization gains up front.

What it helps with

  • organize multi-file refactoring into parallel and sequential phases
  • convert loose editing requests into TodoWrite task lists
  • prevent edit collisions across shared modules and imports
  • verify codebase integrity with automated lint and test steps after bulk edits

Example prompts for the agent

  • /batch-operations-prompt @docs/refactoring-plan.md
  • /batch-operations-prompt Convert callbacks to async/await across all service files
  • /batch-operations-prompt Update all API calls to use the new authentication header

How to install batch-operations-prompt

Manually: put the files in place

.claude/commands/batch-operations-prompt.md

Call it with /batch-operations-prompt. For all projects use ~/.claude/commands/

Questions about batch-operations-prompt

How to install batch-operations-prompt in Claude Code?

Save the command markdown file to .claude/commands/batch-operations-prompt.md within your project repository. Once placed, invoke it using /batch-operations-prompt.

What does batch-operations-prompt do?

It analyzes requested code updates and generates an execution plan dividing tasks into concurrent discovery, grouped modifications, and validation steps. This prevents edit collisions during broad refactoring.

Does the command support external file inputs?

Yes, pass a file path prefixed with @ in $ARGUMENTS, such as /batch-operations-prompt @refactoring-plan.txt. If no argument is given, it processes the prompt text directly.

Source text

batch-operations-prompt.md · MIT
# Batch Operations Prompt

Optimize prompts for multiple file operations, parallel processing, and efficient bulk changes across a codebase. This helps Claude Code work more efficiently with TodoWrite patterns.

## Usage Examples

### Basic Usage
"Convert to batch: Update all test files to use new API"
"Batch prompt for: Rename variable across multiple files"
"Optimize for parallel: Add logging to all service files"

### With File Input
`/batch-operations-prompt @path/to/operation-request.md`
`/batch-operations-prompt @../refactoring-plan.txt`

### Complex Operations
"Batch refactor: Convert callbacks to async/await in all files"
"Parallel update: Add TypeScript types to all components"
"Bulk operation: Update import statements across the project"

## Instructions for Claude

When creating batch operation prompts:

### Input Handling
- If `$ARGUMENTS` is provided, read the file at that path to get the operation request to optimize
- If no `$ARGUMENTS`, use the user's direct input as the operation to optimize
- Support relative and absolute file paths

1. **Identify Parallelizable Tasks**: Determine what can be done simultaneously
2. **Group Related Operations**: Organize tasks by type and dependency
3. **Create Efficient Sequences**: Order operations to minimize conflicts
4. **Use TodoWrite Format**: Structure for Claude's task management
5. **Include Validation Steps**: Add checks between batch operations

### Batch Prompt Structure

#### 1. Overview
- Scope of changes
- Files/patterns affected
- Expected outcome

#### 2. Prerequisite Checks
- Required tools/dependencies
- Initial validation commands
- Backup recommendations

#### 3. Parallel Operations
- Independent tasks that can run simultaneously
- File groups that don't conflict
- Read operations for gathering information

#### 4. Sequential Operations
- Tasks with dependencies
- Operations that modify same files
- Final validation steps

### Optimization Strategies

#### File Grouping
```markdown
## Batch Operation: [Operation Name]

### Phase 1: Analysis (Parallel)
- Search for all affected files using Glob/Grep
- Read current implementations
- Identify patterns and dependencies

### Phase 2: Implementation (Grouped)
Group A (Independent files):
- File1.js: [specific change]
- File2.js: [specific change]

Group B (Related components):
- Component1.tsx: [change]
- Component1.test.tsx: [related change]

### Phase 3: Validation (Sequential)
1. Run linter on modified files
2. Execute test suite
3. Build verification
```

#### TodoWrite Integration
```markdown
### Task List Structure
1. Gather information (can parallelize):
   - Find all files matching pattern X
   - Read configuration files
   - Check current implementations

2. Batch updates (group by conflict potential):
   - Update non-conflicting files (parallel)
   - Update shared modules (sequential)
   - Update test files (parallel)

3. Verification (sequential):
   - Run type checking
   - Execute tests
   - Validate build
```

### Conversion Examples

#### Original Request:
"Update all API calls to use the new authentication header"

#### Batch-Optimized Version:
```markdown
## Batch Operation: Update API Authentication Headers

### Prerequisites
- Verify new auth header format
- Check all API call patterns in codebase

### Parallel Phase 1: Discovery
Execute simultaneously:
1. Grep for "fetch(" patterns
2. Grep for "axios." patterns
3. Grep for "api." patterns
4. Read auth configuration file

### Parallel Phase 2: Read Current Implementations
Read all files containing API calls (batch read):
- src/services/*.js
- src/api/*.js
- src/utils/api*.js

### Sequential Phase 3: Update by Pattern Type
Group 1 - Fetch calls:
- Update all fetch() calls with new header
- Pattern: Add "Authorization: Bearer ${token}"

Group 2 - Axios calls:
- Update axios config/interceptors
- Update individual axios calls

Group 3 - Custom API wrappers:
- Update wrapper functions
- Ensure backward compatibility

### Parallel Phase 4: Update Tests
Simultaneously update:
- Unit tests mocking API calls
- Integration tests with auth
- E2E test auth setup

### Sequential Phase 5: Validation
1. ESLint all modified files
2. Run test suite
3. Test one API call manually
4. Build project
```

### Output Format

Generate batch prompt as:

```markdown
## Batch Operation Prompt: [Operation Name]

### Efficiency Metrics
- Estimated sequential time: X operations
- Optimized parallel time: Y operations
- Parallelization factor: X/Y

### Execution Plan

#### Stage 1: Information Gathering (Parallel)
```bash
# Commands that can run simultaneously
[command 1] &
[command 2] &
[command 3] &
wait
```

#### Stage 2: Bulk Operations (Grouped)
**Parallel Group A:**
- Files: [list]
- Operation: [description]
- No conflicts with other groups

**Sequential Group B:**
- Files: [list]
- Operation: [description]
- Must complete before Group C

#### Stage 3: Verification (Sequential)
1. [Verification step 1]
2. [Verification step 2]
3. [Final validation]

### TodoWrite Task List
- [ ] Complete Stage 1 analysis (parallel)
- [ ] Execute Group A updates (parallel)
- [ ] Execute Group B updates (sequential)
- [ ] Run verification suite
- [ ] Document changes
```

Remember to:
- Maximize parallel operations
- Group by conflict potential
- Use TodoWrite's in_progress limitation wisely
- Include rollback strategies
- Provide specific file patterns

© centminmod · MIT · centminmod/my-claude-code-setup

Similar slash commands

All slash commands for Agent setup: memory, context, orchestration →

From the same set35

The whole set →
check-best-practices The check-best-practices command reviews code against language-specific standards, conventions, and best practices. It spots issues from critical bugs to style violations and suggests concrete improvements. CX Codex +1 ★ 2,744repo stars claude-docs-consultant claude-docs-consultant pulls official Claude Code documentation directly from code.claude.com on demand. Fetches only the markdown files needed for the active task. CX Codex +1 ★ 2,744repo stars explain-architecture-pattern The explain-architecture-pattern command identifies architecture and design patterns in a codebase, then explains the structure behind them. Use it when the project’s organization needs a clear rationale. CX Codex +1 ★ 2,744repo stars convert-to-test-driven-prompt convert-to-test-driven-prompt turns a plain request into a TDD-style prompt with test cases, expected outcomes, and success criteria. Useful when behavior needs to be pinned down before code exists. CX Codex +1 ★ 2,744repo stars memory-bank-synchronizer memory-bank-synchronizer is a Claude Code subagent that checks memory-bank files against the codebase and refreshes documentation when CLAUDE-*.md diverges from the implementation. CX Codex ★ 2,744repo stars ux-design-expert ux-design-expert audits user flows, builds Tailwind design systems and themes Highcharts charts. Useful when the interface is done but people still get lost. CX Codex ★ 2,744repo stars code-searcher code-searcher navigates codebases, tracks vulnerabilities, and returns exact file and line references. CX Codex ★ 2,744repo stars cleanup-context cleanup-context — a Claude Code command that audits project documentation files (CLAUDE-*.md, CLAUDE.md, README.md) to identify redundant content, obsolete materials, and overlapping coverage. CX Codex +1 ★ 2,744repo stars

Project sponsors

Companies that keep this analytics open