How to remove overlay hashtag and trailing menu from the parent overlay
If you remove the "#overlay=node/25/edit%3Fdestination%3Dnode" part from the module, you disable the overlay for that page.

if that is what you want to do, then you need to implement hook_admin_paths_alter() in a module, using code similar to the following one (change "mymodule" with the effective short name of the module):

function mymodule_admin_paths_alter(&amp;$paths) {
  $paths['node/*/edit'] = FALSE;
}


The result returned from hook_admin_paths() is used from the Overlay module to decide when a page is rendered in an overlay. The implementation of that hook done by the Node module is the following one:

function node_admin_paths() {
  if (variable_get('node_admin_theme')) {
    $paths = array(
      'node/*/edit' =&gt; TRUE, 
      'node/*/delete' =&gt; TRUE, 
      'node/*/revisions' =&gt; TRUE, 
      'node/*/revisions/*/revert' =&gt; TRUE, 
      'node/*/revisions/*/delete' =&gt; TRUE, 
      'node/add' =&gt; TRUE, 
      'node/add/*' =&gt; TRUE,
    );
    return $paths;
  }
}


The module that implements the hook I reported in the first code snippet should be enabled when the  Overlay module is enabled; alternatively, that hook implementation should check if the Overlay module is enabled.

function mymodule_admin_paths_alter(&amp;$paths) {
  if (module_exists("overlay")) {
    $paths['node/*/edit'] = FALSE;
  }
}


The information returned from hook_admin_paths() could be used from another module to render those pages in a different way, such as using an administrative theme; if the purpose is just to avoid the overlay is used to render that page, then the module should change the information returned by hook_admin_paths() only when the Overlay module is enabled.