I agree with Alex's answer that you should use the more advanced and awesome magit package.
The longer story about why egg doesn't work the way you want is this: The way egg is written it cannot operate on remote files with TRAMP because egg.el uses the call-process
function, whereas magit uses start-file-process
which is supported as described in the Remote Processes section of the TRAMP manual:
5.4 Integration with other Emacs packages.
tramp supports running processes on a remote host. This allows to
exploit Emacs packages without modification for remote file names.
[...]
process-file and start-file-process work on the remote host when the
variable default-directory is remote:
(let ((default-directory "/ssh:remote.host:"))
(start-file-process "grep" (get-buffer-create "*grep*")
"/bin/sh" "-c" "grep -e tramp *"))