During the Covid-19 pandemic, technologies such as contact tracing and risk assessment algorithms are widely used. While debates are heated about the optimal algorithm designs with respect to their effectiveness and ethics, little is known about how the algorithms are deployed, experienced, challenged, and reshaped in society. Combining in-depth interviews, media articles, and policy documents, this study examines how Health Code, the Chinese contact tracing and risk assessment algorithm, is assembled, disassembled, and reassembled in society. I argue for a conceptualization of algorithms as sociotechnical assemblages with the involvement of diverse human and non-human actors, which are constantly in action. I first explore the intensive and invisible work and infrastructures that enable Health Code to be enacted. However, these assembly attempts are consistently challenged in differing situations and destabilized Health Code from time to time. Health Code reassembles under the diverse yet unintended engagements of social actors, local networks, and power relations, which creates multiple Health Codes at different periods of time and social localities. I also examine how people game and bypass the algorithm’s surveillance as forms of everyday resistance. These findings go beyond the current technical debates and bring a more dynamic, nuanced, and realistic depicture of algorithms’ operation and power. Lastly, I explore how algorithms contribute to a new dialectical relationship between state and society, and how this relationship reshapes the mechanism of surveillance, inequality, and citizenship in this digital age.