# Chain of commands

You cannot "insert" new command into Cypress command chain (opens new window) from outside.

Cypress throws an error if you try to add more commands from outside

Instead, you should be able to add commands from other Cypress commands, like cy.then (opens new window):

cy.log('first').then(() => {
  // insert more commands
  // before the "LOG third" command
  cy.log('second')
})
cy.log('third')

Cypress inserts new commands correctly

Read the blog post Cypress Cannot Add Out-Of-Band Commands (opens new window).