NY 40 originally extended south to East Greenbush and north to Comstock when it was assigned as part of the 1930 renumbering of state highways in New York. The route was truncated south to NY 149 in Hartford in the early 1940s and north to U.S. Route 4 in North Greenbush in the late 1950s. It was re-extended northward to its current northern terminus in the 1960s, but also truncated northward to its current southern terminus in the early 1970s. In 1980, ownership and maintenance of the portion of NY 40 south of NY 142 and outside of Troy was transferred from the state of New York to Rensselaer County as part of a highway maintenance swap. This section of the route is co-designated and co-signed as County Route 145 (CR 145) and has no reference markers.