Confucianism, as its founder taught, is not a religion in the traditional sense. It is an ethical code. Chinese culture was steeped in the religion of animism, a belief that gods and spirits dwell in natural formations. Along with an animistic world view, there was a belief in ancestor worship. The spirits of the dead needed to be honored and cared for by the living family members.However, in his teachings, Confucius avoided spiritual issues. He can be categorized as an agnostic who believed in spirits and the supernatural but was not interested in them. He was humanistic and rationalistic in his outlook. "His position on matters of faith was this: whatever seemed contrary to common sense in popular tradition and whatever did not serve any discover able social purpose, he regarded coldly." The answer to the cultural and social problems was found in humanity itself, not in anything supernatural. Confucius beliefs were edited by his later disciples:)
I hope this helped:) it took forever:)