In 1069 CE Zhang was suggested to the Emperor and given a place in the capital's government, but not long after he ran into disagreement with the prime minister and retired to his home Hengqu, where he spent his time studying and teaching. This was likely the most productive period of his life for developing and spreading his own philosophical views. In 1076 CE he finished his most significant work, Correcting Ignorance, and presented it to his disciples. Later in 1076 CE he was summoned back to the capital and restored to a high ranked position. However, in the winter he became sick and was forced to resign again. He never reached his home town of Hengqu, dying on the road in 1077. Zhang was enshrined in the Confucian temple in 1241 for his work. Many of Zhang's writings have been lost. Zhu Xi collected selections of Zhang's writings in his anthology of Song Study of the Way known as Reflections on Things at Hand :zh:近思錄. His most important surviving works are probably his commentary on the Changes and Correcting Ignorance.