On May 21, 1896, Brahms' lifelong friend and champion, Clara Schumann, passed away in Frankfurt am Main. Brahms, who considered Clara to be the "greatest wealth" in his life, was so devastated that he bungled his travel arrangements and missed the funeral in Bonn. Upon his return to Ischl, where he spent his summers, Brahms' friends noticed an unsettling change in his appearance. Physicians at first told the composer that he had jaundice, though they secretly believed he was suffering from liver cancer, the disease that had killed his father. When Brahms left Ischl to "take the cure" at Karlsbad, it is possible, though unlikely, that he was unaware of the seriousness of his condition; he rarely admitted to having an illness, even if he knew it was the truth.
In was in this atmosphere that Brahms composed the Eleven Chorale Preludes, his first music for the organ since 1857. It is possible that some of the settings may have originated before 1896; most of Brahms' work on the set, however, took place during that year. Brahms may have known, if only subconsciously, that he might not live to see another summer; this may have influenced his decision to set, twice each, the chorales "Herzlich tut ich verlangen nach einem sel'gen End" (I sincerely wish for a happy end) and "O Welt, ich muss dich lassen" (O world, I must leave you"). Indeed, the second of the two "O Welt" settings contains the last notes the composer ever wrote.
Brahms' mature art pervades the Chorale Preludes, which feature the same sort of motivic density found in the late piano pieces, at the same time paying homage to Baroque-era counterpoint. In the first Prelude, "Mein Jesu, der du mich," the chorale melody sounds in the pedals, each verse preceded by a fugal episode. Because the material of the fugal passages is derived from the melody of the ensuing verse, these passages act as anticipations as well as variations. Brahms uses a similar procedure in No. 5, "Schmücke dich, o liebe Seele," in which the sixteenth-note accompanimental pattern is derived directly from the first two measures of the chorale tune.
In Nos. 9 and 10, both based on "Herzlich tut ich verlangen," Brahms employs the tune "O sacred head now wounded," presented in a highly decorative fashion in the soprano register in No. 9 and more straightforwardly in the pedals in No. 10, accompanied by constant sixteenth-note figuration. Both settings of "O Welt, ich muss dich lassen," Nos. 3 and 11, are in F major. The first, with its buoyant alternation of triple and quadruple meters, features decorative additions to the melody, which is occasionally echoed in the bass line. In the second, the individual phrases of the melody are separated by brief interludes, as if Brahms were taking a deep, hesitant breath between each line.