codemap_label_migrate
Migrate assignments from one label to another. Useful for renaming or consolidating labels.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fromLabelId | string | ✅ Required | Source label ID to migrate from |
toLabelId | string | ✅ Required | Destination label ID to migrate to |
target | string|array | ❌ Optional | Optional: specific targets or glob patterns (omit for all) |
Usage Examples
MCP Usage (for AI Agents like Claude)
json
{
"name": "codemap_label_migrate",
"arguments": {
"fromLabelId": "lbl_old_wip",
"toLabelId": "lbl_work_in_progress_241291"
}
}Example Output
JSON Response
json
{
"ok": true,
"migrated": 8,
"fromLabel": {
"id": "lbl_old_wip",
"name": "Old WIP"
},
"toLabel": {
"id": "lbl_work_in_progress_241291",
"name": "Work In Progress"
},
"targets": [
"src/features/auth/login.ts",
"src/features/auth/signup.ts",
"src/components/Dashboard.vue",
"src/components/Header.vue",
"src/api/auth-routes.ts",
"src/services/auth-service.ts",
"src/utils/validators.ts",
"src/types/auth.ts"
]
}When to Use This Tool
- Consolidate duplicate labels into one
- Rename labels by migrating to new label with better name
- Reorganize labeling scheme
- Clean up deprecated labels
Common Patterns
Consolidation: Merge similar labels
Renaming: Create new label, migrate from old, delete old
Cleanup: Migrate before deleting unused labels
Renaming: Create new label, migrate from old, delete old
Cleanup: Migrate before deleting unused labels
Pro Tips
- Omit
targetto migrate ALL assignments - Use
targetpatterns to migrate selectively - Verify with
label_searchbefore migrating - Source label remains after migration (use
label_deleteto remove) - Migration is tracked in session log