If you have trouble falling asleep, here's something new to try. When you curl up in bed tonight, bring along a copy of the local municipal code to read.

Slogging through the lawyerly fine print will not only make your eyelids heavy, it could help you unearth some surprising discoveries.

I learned the other day that if you earn an income working at home -- anything from lacing lanyards for a craft sale to consulting on paramilitary projects for Halliburton -- most East Bay cities require you to have a home occupation permit and a business license.

There are a few exemptions, such as nonprofit organizations and youngsters under 18, but they are as rare as burned kernels in a bucket of popcorn.

Every community is slightly different, but Walnut Creek reflects the norm: $50 for an occupation permit and graduated licensing fees based on gross receipts, beginning with dollar one. The lowest fee is $23, then it swells into the thousands, depending on how successful you are at peddling lanyards. The license must be renewed each year.

If the ordinance seems absolute, well, it is. By law, even a retired music teacher who charges neighbor kids for piano lessons must file papers with City Hall. If you alter slacks and skirts in your home to earn some fun money, the city says you are a business.

"If you're doing anything that's business-oriented, you're required to have a license," said Assistant City Manager Lorrie Tinfow. "I don't know if most people know this." She added that the ordinance has been around since 1914, so don't blame her.

Mayor Cindy Silva knows the rules. She's done consulting work and freelance writing out of her home for years. "I have an occupation permit and a business license," she said. "Mine is pinned to a bulletin board."

Concord, Antioch, Danville and San Ramon are among many communities that have similar ordinances. (Curiously, Lafayette does not.) Even day laborers seeking work outside Home Depot are supposed to be licensed, which seems as likely as flying saucers landing at Heather Farm.

"They're independent contractors," said Concord business license agent Mike Snow. "If they're hiring themselves out, then, yes, they need a license."

Enforcement, obviously, can be a challenge.

Both Walnut Creek and Concord count on honesty -- self-reporting, as officials call it -- but the city also looks for violators in business statements filed with the county, newspaper advertising and neighborhood fliers.

Concord Mayor Laura Hoffmeister said that in recent years, as California city budgets have shrunk, Concord has begun cross-checking information with the state.

Every independent contractor whose income is reported on a 1099 tax form is identifiable through a shared database.

"Isn't technology wonderful?" she said.

The rationale for these ordinances boils down to this: Each new business adds to the service burdens on a city -- road maintenance, parking and law enforcement -- and someone has to pay for them. Besides, every new business is found money.

"It's all about revenue," Tinfow said. "I'm being direct, but that's what our ordinance says."

So, for those who think the government has its hands in your pockets, it's worse than you feared. It also extends its tentacles into your home office.

Don't take my word. Read your municipal code when you hop into bed tonight.

It's a good way to learn about your city's laws. And it's a surefire way to fall asleep.

Contact Tom Barnidge at tbarnidge@bayareanewsgroup.com