In the death poem or jisei, the essential idea was that at one’s final moment of life, one’s reflection on death (one’s own usually but also death in general) could be especially lucid and meaningful and therefore also constituted an important observation about life. The poem was considered a gift to one’s loved ones, students, and friends. The tradition began with zen monks, but was also popular with poets, whose poems were often just as solemn as those of monks, or entirely flippant and humorous. The poems are often full of symbols of death, such as the full moon, the western sky, the song of the cuckoo, and images of the season in which the writer died.
Here’s another poem by James.