How specialised should research prior to tenure be? When establishing yourself as a researcher, the importance of independence from your PhD supervisor and focusing on a niche area (to establish popularity in a particular sub-field) are fairly well-established. For longevity of research career the polar opposite criteria of collaboration and breadth have been suggested.

Defining the terms field and subfield etc. is important, so taking the following hypothetical example:


Subfield - PhD research uses a common computational method applied to a number of closely related problems. 
Related Subfield - Other PhD students in the group apply the same method to different problems.
Field - Computational methods related to PhD yet distinct applied to any problem in the super field
Superfield - Broad area of research encompassing theoretical, computational and experimental work, eg superconductors, photonics, etc.


After PhD and prior to tenure, how specialised should one aim to be and how closely related to the PhD should the specialty be?

If given the choice, is it best to focus exclusively on a related subfield topic (generally project based research typical of most post doc positions), or take on another topic in the field, or to develop breadth by researching multiple related sub field topics in collaboration with other groups?
This answer warns against being too narrow; see aeismail's answer for reasons not to be too broad.

The precise answer is going to depend on your institution and your field.  But as a first order approximation, you must establish yourself as an independent intellectual leader in a broad enough research area to attract good tenure letters.  An obscure subsubfield beloved by only ten researchers probably isn't going to be enough, because not all of those people will be credible references — well-known, active, full professors (preferably with named positions and Academy memberships) at top-ranked US departments (assuming you're at a US institution) who are not your advisor (and preferably are not your coauthors or from your PhD department either).

So your question becomes:


How large a field do you need to consider to include a sufficient number of viable tenure writers?
How you establish a world-class reputation within that field?


As a general rule in my field, you should move as far away from your PhD thesis as possible while still being visible and productive.  But other fields may have different expectations.