Aiming to maximize the lifetime of time-driven multi-sink wireless sensor networks, employing inter-flow network coding theory as the underlying methodology, a coding-aware cross-path anycast routing protocol called CodeMesh is proposed. Firstly, the coding condition of unicast flows in multi-hop wireless environment is analyzed, and the coding rules under multi-sink anycast network model are presented and proved. Secondly, the concept of multi-flow encoding cluster is proposed followed by the demonstration of the theorems of determining the number and member of encoding cluster. Furthermore, a routing metric integrating the link quality, load balancing and coding gains is defined. Particularly, it quantifies the unified cost of coding and non-coding path. Finally, an anycast coded routing is designed which has the characteristics of both reactive source routing and proactive routing. CodeMesh takes full advantages of the rich computing and communication resources of sink nodes. Additionally, it embeds the routing optimization, refactoring, update and maintenance all in the process of periodical data gathering, which significantly lowers the routing overhead. The results of testbed based experiments indicate that, CodeMesh can effectively find a path with maximum coding opportunities for each node, thereby reduces transmissions, improves transmission efficiency, balances the load and energy consumption, and thus prolongs the survival time of whole network.