codemap_script_delete
Delete a user-defined script. Removes the script file from disk.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
category | stringaudit | build | orient | close | utility | ✅ Required | Script category |
name | string | ✅ Required | Script name (filename without .js extension) |
Usage Examples
MCP Usage (for AI Agents like Claude)
json
{
"name": "codemap_script_delete",
"arguments": {
"category": "audit",
"name": "check-imports"
}
}Example Output
JSON Response
json
{
"success": true,
"deleted": {
"category": "audit",
"name": "check-imports"
},
"message": "Script deleted: audit/check-imports.js"
}When to Use This Tool
- Clean up obsolete scripts
- Remove incorrectly configured scripts
- Delete experimental utility scripts
- Replace scripts with updated versions
- Clean up before committing
Common Patterns
Replace Pattern
Bulk Cleanup
await codemap.scripts.delete('audit', 'old');
await codemap.scripts.create({ category: 'audit', name: 'new' });Bulk Cleanup
const toDelete = ['temp1', 'temp2', 'experimental'];
for (const name of toDelete) {
await codemap.scripts.delete('utility', name);
}Pro Tips
Delete before recreating - Script names must be unique within category
Utility scripts auto-purge - Utility category scripts are automatically deleted on session close
Check references - For audit scripts, remove from audit-rules.json first
Utility scripts auto-purge - Utility category scripts are automatically deleted on session close
Check references - For audit scripts, remove from audit-rules.json first
Best Practices
List before deleting - Verify script exists with
Document deletions - Note why scripts were removed for team awareness
Test after deletion - Verify dependent processes still work
script_list firstDocument deletions - Note why scripts were removed for team awareness
Test after deletion - Verify dependent processes still work
Common Mistakes
❌ Mistake: Deleting without checking existence
✅ Instead: Check first
await codemap.scripts.delete('audit', 'maybe-exists');✅ Instead: Check first
const scripts = await codemap.scripts.list('audit');
if (scripts.some(s => s.name === 'maybe-exists')) {
await codemap.scripts.delete('audit', 'maybe-exists');
}