In his new book on the Reagan years, former budget director David A. Stockman quotes frequently from the confessions to writer William Greider that almost cost Stockman his job five years ago.

Greider, then an assistant managing editor of The Washington Post, held tape-recorded discussions with Stockman in 1981 as the Reagan economic program was taking shape.

Greider later wrote an article in the Atlantic, "The Education of David Stockman," recounting Stockman's doubts about the Reagan program. The article stirred a sensation, and Stockman narrowly escaped dismissal as director of the Office of Management and Budget.

Stockman said at the time that the article resulted from "an honest, but rather large misunderstanding." He said then that he did not think Greider would use verbatim quotations in the article.

Greider said there was no misunderstanding and that he had told Stockman he would publish an article about their conversations. Greider had informed Stockman in fall 1981 that he had started to write the article.

In his book, Stockman says he and Greider had "gotten so absorbed in the argument" over policy that "we hadn't clarified the ground rules about quotations."

In an interview yesterday, Stockman said he "assumed" that Greider would check with him before using any direct quotations, "but I can't say he ever agreed to that or we ever talked about it. I just assumed since this was an ongoing thing, when the time finally came to write it, I would have that."

Greider said yesterday that Stockman "never made any complaint to me before or since. He knew what was going to happen, and I think I did honorably by the sort of agreement we made."

Last August, when he began writing his book, Stockman asked Greider if he could review transcripts of their tape-recorded talks. Greider said he had not shown them to anyone since the Atlantic article and gave Stockman permission to use them in his book.

Stockman uses the quotations to document his reservations at the time about the direction of Reagan's fiscal program.