counsel-edit-mode can be added to the ivy actions for `counsel-ag' by adding (counsel-edit-mode-setup-ivy) to your init file. ;