It's boom time for grant writers. Cities across the country are lining up to collect their share of the $787 billion federal stimulus package, and they're finding that getting hold of the money is a lot more complicated than most of them had anticipated. "This has been the most difficult thing to get our heads around," says Bret Bell, public information director for the city of Savannah, Georgia. "You don't apply directly to the White House for this money. You're talking about 10 to 12 different agencies, all with different requirements." Anybody with the expertise to help cut through the confusion and pry money loose is precious right now.

Despite all the attention given to "shovel-ready" infrastructure projects, there are scores of different programs being funded by the stimulus, formally known as the American Recovery and Reinvestment Act. The programs range across the fields of health, education, energy, housing and Internet technology. And the local share is coming out of at least five separate spigots at the same time.

Most of the stimulus money will pass through states -- including money that the states will get to divide as they see fit, but also some that will devolve to local governments by formula. There's money being handed out on a regional basis, through metropolitan planning organizations. And beyond all this, there are ways for grant-savvy cities and counties to seek support directly from the feds, through both formulas and competitive grant applications.

It's clear that the recovery package is focused on helping states first, but cities have the chance to be entrepreneurial about securing funds on their own. Local officials are trying to tweak their wish lists to fit brand-new criteria, meet tight application deadlines and then deal with new post-grant reporting requirements, all at a time when budgets for their existing programs are shrinking. "You need to run while you're learning," says Carolyn Coleman, chief lobbyist for the National League of Cities.

In many cases, there's just no precedent for aspiring recipients to look at. Block grants for energy efficiency, for example, were approved by Congress in 2007 but never funded until now. That's a brand-new $3 billion program being handled by a federal Department of Energy office that until last year had a $56 million budget and a skeleton staff of 20. That office has to ramp up quickly to distribute vast sums of grant money.

Even with established programs, states and localities have had to wait on guidance from myriad federal agencies whose instructions don't always make the job simpler. The stimulus instructions handed down from HUD alone are an inch thick, covering seven different programs.

Some cities still seem puzzled about what to do, but others have been gearing up for months, preparing color-coded spreadsheets for projects they want to move to the head of the line. Mayors are setting up task forces and appointing "recovery czars" to make sure local departments get their grant-seeking acts together. In Columbia, South Carolina, Mayor Bob Coble has turned his office into a "stimulus war room," taking down souvenir photos and decorating his walls with charts and maps highlighting potential projects. "Money isn't going to fall into our laps," says Jenny Payne, management and financial services coordinator in Savannah. "We have to work together to get it."

Many local governments are diligently combing through regulations in hopes of finding a few specific funding streams for which they might be a good match. Others are doing the opposite: applying for everything under the sun, on the principle that it can't hurt to ask. Bridgeport, Connecticut, has put in for $1 billion worth of public works projects, even though the state as a whole is only going to get about $600 million from the feds for infrastructure.

The biggest worry among big-city mayors may be that they will get stiffed by state governments unwilling to move the money down the pipeline. They may be worrying for a reason. Missouri's initial list of $750 million in infrastructure projects included nothing for St. Louis, while Washington State's first slicing of the pie cut out Seattle, which Mayor Greg Nickels termed "mystifying." A draft list of projects from the North Carolina Department of Transportation included only two in the Charlotte metropolitan area, and none in the city itself. "I'm convinced Charlotte gets the short end of the stick," says Mayor Pat McCrory.

Meanwhile, local officials are suddenly spending much more of their time in Washington and in their state capitals. San Francisco Mayor Gavin Newsom has told his department heads to "set aside whatever responsibilities you have" and go to Washington to troll for dollars. For some cities, the trolling has paid off. President Obama signed the stimulus bill into law on February 17. By the end of the month, Salt Lake City Mayor Ralph Becker had brought in $31.5 million for transit assistance, $26.5 million for surface transportation and $1.5 million for energy-efficiency projects. Becker then held a conference call with other Utah mayors to offer them tips on how to go about getting more funds for their cities.

On a much smaller scale, the city of Hesperia, California, which has a population of less than 80,000, has been concerned that it might be short-changed by the greater San Bernardino metropolitan region to which it belongs. Shortly after the stimulus was signed into law, a delegation from Hesperia decided to undertake a lobbying trip to Washington. They secured new funding for a previously authorized highway interchange, and argued their case to Congress and the administration for stimulus funding to provide wastewater treatment, create an emergency training center and build a new fire station. "Since we've come back, we're monitoring every Web site known to man to see what we can qualify for," says Kim Summers, assistant to the city manager. "The last thing you want to find out is that there was money you were eligible for, and you missed it."

There is something of a lottery aspect to determining who will end up with the stimulus dollars, but as some of these examples show, cities can make their own luck. It's not only a matter of hiring the right lobbyist. Because of the breakneck pace at which federal and state departments are obligating funds, premiums will inevitably be placed on projects that can be sold as part of long-range plans.

Savannah, for example, has multi-year plans in place for sewage and drainage. Typically, the city pays for design and implementation in stages. Now that so many dollars are suddenly at hand, having plans on the books "gives us the opportunity to take the design and say we're ready to go," says Savannah's Payne.

In most cases, city officials recognize that, as great as current economic needs may be, the stimulus is no cure-all for local budget problems. States are allowed to use a share of stimulus funds to shore up general revenue accounts, but locals don't have that option. So for them, the windfall is mostly about capital projects. Philadelphia, for instance, is facing a $1 billion shortfall in its five-year budget, but the city is primarily shooting for single-shot projects such as an energy-efficiency grant for the art museum and money to purchase and rehabilitate a specific set of blighted homes. "We're not relying on the stimulus to close the hole in our general fund budget," says City Manager Camille Barnett, "either in fiscal year 2010 or the five-year plan."

Toledo, Ohio, Mayor Carty Finkbeiner, taking the long view, likes to point out that his city still benefits from projects approved by the federal Works Progress Administration in the 1930s in an effort to bring short-term benefits to the local economy. WPA funds built much of the city zoo and the University of Toledo. Finkbeiner insists that even short-term capital infusions need to be assessed for their long-term impact. As he puts it, "The stimulus money can't be going into projects where five or 10 years from now people ask, "Why in the world did we get into that?'"