You open the garden shed door and spot a banded snake sliding under the woodpile. Your first thought might be, what is it doing here, and should I worry?
In California, a snake near a shed can mean a few different things, and some popular guesses are wrong. Here is what the sighting can tell you, what it cannot, and how to respond safely.
A snake by a shed does not explain itself

Sheds and woodpiles create the kind of nooks wildlife loves. Gaps under floors, spaces between logs, and shaded corners stay cooler in summer and offer cover from birds of prey and other predators.
A snake resting there is making use of shelter, and it may also be passing through on a hunt.
That is a reasonable explanation, but it is not a firm conclusion. The spot alone cannot tell you what drew the snake in, what it has been eating, or whether it will stay.
A snake can show up simply because the cover was handy on its route.
It also cannot tell you what kind of snake you are looking at. California is home to many native snake species, and California Department of Fish and Wildlife notes that seven of them are rattlesnakes.
A banded or glossy snake glimpsed for a second may be a California kingsnake, but a quick look from a distance is not a reliable ID. Calling it a kingsnake based on where it was sitting would be a guess.
Rattlesnakes can also use cover around yards and under woodpiles, as CDFW guidance on snakes describes. So a shed-side snake fits several stories at once, which is exactly why the location can’t settle the question.
Think of the sighting as a clue that your yard has useful habitat, not as a message. The rest of this article separates what is plausible from what is proven, and shows what to do next.
California kingsnakes eat a varied diet

Picture a snake that is not picky. California kingsnakes are nonvenomous and squeeze their prey rather than biting with venom.
They are generalists, which means they eat whatever suitable animals they come across, including lizards, birds, eggs, rodents, and other snakes, as the Los Angeles Zoo describes.
A peer-reviewed study of their feeding habits gives a clearer picture. Drawing on 2,662 museum specimens and other records, Wiseman and colleagues found that mammals and snakes each made up 29% of recorded prey items.
So rodents and other mammals are one important category, but they are far from the whole menu.
Those numbers describe kingsnakes as a species, collected from across their range over many years. They do not describe the snake under your shed.
One animal might be eating lizards all season, while another might favor eggs or mice.
That is the practical meaning of the study. It tells you what kingsnakes tend to eat in general, and it cannot tell you what a single snake in a single garden is hunting this week.
It is also a reminder that these snakes adapt to what is available. A kingsnake using your woodpile may be following lizards along a sunny wall just as easily as following mice.
A kingsnake sighting is not proof of rats or rattlesnakes

Two questions come up right away. Do I have rats?
Are there rattlesnakes nearby? A kingsnake sighting does not answer either one.
Rodents are among the animals kingsnakes may eat, but so are lizards, birds, and eggs. A snake passing a shed does not prove mice or rats are living there, and it does not measure how many there might be.
If you want to know about rodents, you have to look for rodent signs directly.
Rattlesnakes are a similar story. In the diet study, rattlesnakes made up just 7% of the prey items Wiseman and colleagues recorded.
That shows kingsnakes sometimes eat rattlesnakes. It does not show that seeing one in your yard means a rattlesnake is close by.
It is also wrong to expect the snake to fix either issue. UC IPM explains that the number of rattlesnakes eaten by predators is not large enough to solve a homeowner’s rattlesnake problem, and it does not recommend relocating kingsnakes for that purpose.
So enjoy the visit from a distance if you like, but do not count on the snake as pest control or as an early warning system. Treat it as one animal passing through, and let direct evidence guide any other decisions.
Do not approach a snake to identify it

Getting close for a better look is the riskiest way to find out what you have. Markings can be hard to read in shadow, and a harmless snake and a rattlesnake can look surprisingly alike at a glance.
Where the snake is sitting gives no help with its species.
The safest move is simple. Keep people and pets back, and give the snake room to leave on its own.
Do not touch it, corner it, handle it, or try to move it. CDFW advises against handling snakes, and its snake guidance points the same direction.
Skip the idea of poking at the woodpile or reaching into the gap under the shed. Hidden cover is where people get surprised, and a frightened animal of any species may defend itself.
Killing a snake is also unsafe and unnecessary.
If you cannot tell what it is, treat it as unknown and stay away. Walk the dog on a leash near the area and keep children inside the yard’s open spaces for now.
Snakes often move along within hours.
If a potentially dangerous snake is inside your home or creates an immediate concern, call a qualified local wildlife or snake-removal professional. UC IPM’s rattlesnake page also supports leaving removal to people trained for it.
Check for rodent signs separately

If the snake has you wondering about rats, put the snake aside and look for the real thing. Rodents leave a trail of evidence.
Watch for droppings along walls and under shelves, gnaw marks on wood, wiring, or storage bins, and nests made of shredded paper, fabric, or plant material.
Do this from the outside and from open, visible areas. Do not reach into hidden spaces, and do not tear apart a woodpile right now.
A snake may still be using that cover, and a quick cleanup is not worth a bite or a scare.
If you do find signs, UC IPM’s guidance on rats centers on taking away what rodents need. Reduce food and shelter, secure openings they use to get in, and store food and garbage in sealed containers.
That includes pet food, birdseed, and fallen fruit, which are easy to overlook in a California yard.
Look closely at the shed itself. Gaps around doors, vents, and pipes can be closed so rodents cannot slip inside.
Storing items off the floor in tubs with lids also removes nesting material.
If you find nothing, that is useful too. No droppings, gnawing, or nests means the snake’s visit did not point to a rodent problem, and you can leave the shed as it is.
Avoid risky or ineffective quick fixes

When something slithers into view, the urge to do something fast is strong. Most of the fast fixes either don’t work or cause harm.
Start with rodenticides. Putting out poison because you saw a snake is a poor trade.
UC IPM warns that rodenticides can harm people, pets, and nontarget wildlife. That can include the very animals that share your yard, such as birds of prey and other predators that eat poisoned rodents.
Snake repellents are no better. UC IPM says no plants repel snakes, and sulfur and mothballs do not work.
Spreading them around the shed adds smell and chemicals without moving a snake.
A calmer plan is easy to follow. Keep your distance, keep pets and children back, and let the snake leave.
If you suspect rodents, look for droppings, gnaw marks, or nests, then act on what you actually find.
Your shed will always offer shelter to something. The best response is patience and a little evidence, and a snake that slips away on its own is usually the end of the story.