On one hand, some studies suggest that messy spaces can stimulate creativity. A 2013 study from the University of Minnesota showed that people working in messy rooms were more likely to come up with creative ideas than those in tidy offices. This may mean that a chaotic environment helps to think differently and come up with new ideas.
On the other hand, there are also studies that say messy places do not affect how well you can think. Research shows that the amount of clutter in a workspace has no effect on things like planning, attention, and problem-solving. This means that, although a messy environment may promote creativity, it does not directly impact how well you think.
Ultimately, it seems that the effect of a messy workplace depends on personal preference. Some people are inspired by clutter, while others work better in a tidy space. It is important to discover which environment suits you best, as there is no clear answer to whether clutter affects creativity or cognitive ability.