Might be easier to identify if we knew your rough location...I'm guessing you aren't in U.S.-? Also something in photo for size relationship (or just measure it).
It's probably there for the substrate rather than to pester your snake, but I'm just guessing. I'm in the U.S. (mid-South) & use natural branches for my snakes: now &
then I find there are wood-boring beetles in them...I'll find little trails of fine sawdust (like on the black hides where it shows up easily) & they're harmless to the snake,
assuming (?) that's what yours is too. (my local ones look different from yours)