codemap_script_delete

Delete a user-defined script. Removes the script file from disk.

scriptdeletecleanup

Parameters

NameTypeRequiredDescription
categorystringaudit | build | orient | close | utility✅ RequiredScript category
namestring✅ RequiredScript 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
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
Best Practices
List before deleting - Verify script exists with script_list first
Document deletions - Note why scripts were removed for team awareness
Test after deletion - Verify dependent processes still work
⚠️Common Mistakes
Mistake: Deleting without checking existence
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');
}