--- title: 'DF8401: Cannot Change Command Id' description: 'Cannot change the id of a command. Use register() to add new commands' --- ## Message > Cannot change the id of a command. Use register() to add new commands ## Cause The `update` handle returned by `ctx.commands.register(cmd)` received a patch with an `id` key. Command ids are immutable post-registration. ## Fix - Drop `id` from the patch object. - To register a new command, call `ctx.commands.register(newCmd)`. ## Source - [`packages/hub/src/node/host-commands.ts`](https://github.com/devframes/devframe/blob/main/packages/hub/src/node/host-commands.ts): `DevframeCommandsHost.register()` returns a `update` callable that throws when `'id' in patch`.