PhD at same location as undergraduate?
The problem is, my undergraduate institution is number one in the field I am doing, and in the graduate field I hope to pursue.


Here's a well-known story:

Richard Feynman did his undergrad studies at MIT. Near the end of his studies there, he approached John Slater (the head of physics at that time) asking to stay on as a PhD candidate. Slate asked him why, and Feynman's response was:

"I want to go to MIT because it is the best school in the country."

Slater then said: "That's why you should go to some other school. You should find out how the rest of the world is."

(Paraphrased from "Surely you're joking...")



Here's a personal story:

When I was applying for graduate schools, everyone is applying everywhere, and in particular most of my cohort also applied for the graduate school program where I did my undergraduate degree. Now, most of them do not really want to stay another four or five or six years there---entirely understandable as the town is not very exciting, and after four years of undergraduate studies there one typically cannot wait to go away for a while. So the department is often reluctant to admit their own students for fear of "wasting an offer". 

So I was slightly surprised when I got a phone call from my then undergraduate thesis advisor inquiring about my intentions, after laying out the above "facts". This being rather early in the process and before I had received any concrete offers, I responded in a way that is mostly truthful but also (I thought) calibrated to not ruin my prospects of getting some/any offer! So I equivocated that only an offer from one other institution would seriously tempt me away, and in the case I get offers both from that other institution, and my then current one, I would have to think harder before making up my mind. But the chances are 50-50 absent any significant differences in the offer. 

My thesis advisor then asked me whether I am out of my mind, and why I would consider going anywhere else when he is the best in the world there is. 

I stayed, and I am not sorry for it. (Well, at the very least, I still have a job.) 



Having been in hiring discussions: I have never heard the esteem of any candidate lowered solely because he or she studied for both the undergraduate and graduate degrees at the same place. Concerns about "leaving one's comfort zone" and about "lack of connections" are more often raised in the context of


Having postdoctoral research that closely mirrors doctoral research (no growth).
Having a very small set of collaborators, one of whom is the doctoral advisor (no connections). 


By the time most of us finished our undergraduate degrees, we are significantly less mature than we are after we finished our PhDs. No reasonable person would judge you on one decision you make when you are so young. Besides, if you really are the type that cannot venture far from your comfort zone, it will show up (probably more clearly) elsewhere in your CV. 

So your consideration should really be: will I learn if I stay? Will I grow if I stay? Can I count on myself to reach out and make more connections should I stay? Will I perform excellent research if I stay? 
Your decision should ultimately rest on your expected growth as an individual (both scientifically and otherwise) and not on unreliable perceptions from "the community".