Aboard the Theodore Roosevelt, a steady stream of military officials from the region have arrived to see the situation for themselves. A few weeks ago the Saudi defense minister, Deputy Crown Prince Mohammed bin Salman bin Abdulaziz al-Saud, got a standard tour of the flight deck and viewings of fighter jets screaming into the air, but Navy officials also took him into the combat direction center, a classified room deep in the carrier where operations specialists track Iran using an array of high-tech equipment.

Officers on the Roosevelt said there was less Iranian activity in the gulf in the weeks leading up to the conclusion of the nuclear deal in July, but all the officers said the slowdown was most likely because of Ramadan. After the deal was signed — and Ramadan ended — the officers said Iranian activity in the gulf picked up as Iran deployed more warships off the Iranian coast and increased its fighter jet flights.

“I don’t think things are any different now than they were before” the nuclear pact was signed, Rear Adm. Roy Kelley, the commander of the strike group aboard the Theodore Roosevelt, said in an interview on the ship’s bridge. “We have interactions every day with Iran. Fifty percent of the Persian Gulf coastline is Iran, so when they see us here, they come and check us out.”

He added that “for the most part, they’re professional.”

A few minutes later, an announcement sounded throughout the aircraft carrier: “Gun Quarters....Set Conditions Thunder” — something unknown was nearing the carrier, which, Captain Hewlett said, usually means an Iranian ship or aircraft.

It was in fact an Iranian ship, but it did not get close, and soon there was the all clear.

The constant watchfulness can make for heightened nerves. In April, just two days after the Roosevelt arrived in the Persian Gulf to relieve the aircraft carrier Carl Vinson, military officials ordered the ship to turn around and head to the waters off the coast of Yemen to block an Iranian convoy suspected of transporting weapons to Houthi fighters there. The Roosevelt, escorted by the guided missile cruiser Normandy, was soon passing through the Strait of Hormuz into the Arabian Sea and then south to the Arabian Peninsula.

On board, sailors realized that the world was watching to see who would blink first. “Us arriving and then turning around so soon was unusual,” said Cmdr. Andrew Strickland, the head of the Combat Direction Center on the Roosevelt. In the combat center, where much of the time is spent watching Iran, suddenly tactical officers were watching themselves — on television news reports about the drama unfolding as the Roosevelt moved to block the Iranian convoy. “It was definitely weird to suddenly be seeing your own ship on CNN,” said Lt. William Thomas, a tactical action officer who works in the combat center.

For the Obama administration, it was important to signal to skeptics that even though the United States was in the final stages of negotiating the nuclear deal with Iran, the administration would continue to back its regional allies against Iran — particularly Saudi Arabia, which was in the middle of a bombing campaign against the Houthis in Yemen that Saudi officials said was necessary to try to restore the ousted American-backed Yemeni government.