In the Star Trek universe, Klingon and Romulans have cloaking technology. They can make their ships almost entirely undetectable using this technology. If there are several ships that are cloaked and in relatively close proximity (say, in a fleet), is there anything that allows them to avoid each other without keeping open communication channels?
According to Memory Alpha:
A cloaking device is a form of stealth technology that uses selective bending of light (and other forms of energy) to render a starship or other object completely invisible to the electromagnetic spectrum and most sensors.
So it appears that it primarily operates within the electromagnetic spectrum, preventing the ship from being detected via visible light, infrared, and other spectral frequencies. No where in the article, or in any movie or TV show I've seen, is there any mention of a cloaking device that hides the mass of the ship. In other words, the gravitational effect of the ship should still be detectable. This is potentially the basis for the gravitic sensor nets used by border outposts to detect cloaked ships (I admit that I am speculating based on the name gravitic).
Ships may not be as massive as a planet or asteroid, but they will still have a gravitational field (however small) just as all things with mass do. These relatively small fields will likely only be detectable at close distances, so if cloaked ships got near enough to one another they would likely have sensor readings telling them there are small fluctuations in the surrounding gravitational field, warning them to potential collisions.
For cinematic purposes, battle scenes generally depict ships as being nearer to each other than they actually are, so the audience isn't squinting to see that enemy dot a few kilometers away. In reality, the distances involved would make accidental collisions highly unlikely. On the off chance that two ships did get dangerously close to one another they should be able to avoid a collision given sensitive enough gravitational field sensors.
I think it's reasonable to assume that the species possessing cloaking technology also have the ability to detect their own cloaking technology. Therefore, a cloaked Klingon ship would not be invisible to other cloaked Klingon ships, and during a fleet action there would be no more danger of collision than any other uncloaked fleet.
Presumably the ships of a cloaked fleet can coordinate their relative positions by intership communication. There is no suggestion that cloaking interferes with, for example, subspace communications.
First of all, as various people note in the comments above, it's extremely unlikely that two cloaked ships would collide at close range by accident, because Space is Big (even though Star Trek does a somewhat randomly variable job of demonstrating this).
However, it's also demonstrated repeatedly that cloaking technology is imperfect. At a distance, it works fairly well, unless people are expecting a cloaked ship, in which case, there are various tricks they can use to detect it. Presumably, those tricks work even better up close, suggesting that a cloaked ship actually on a collision course with another one might well be detectable (if only as an anomalous concentration of unexpected radiation).
Going all the way back to "Where No Man Has Gone Before", when Enterprise is approaching the then-unexpected barrier at the galaxy's edge, the ship's sensors cannot "see" it, but the navigational deflectors, while ineffective, insist they're pushing against something. Again, one can imagine something similar would happen with the close-approach of one cloaked ship to another.