Prosecution and defense lawyers yesterday spent a full day in U.S. court here questioning staff members from the Federal Correctional Institution at Butner, N.C., about a secret, 3 1/2-page document seized last July from John W. Hinckley Jr., accused of the attempted assassination of President Reagan.

During a hearing before Judge Barrington D. Parker, witnesses were instructed not to discuss the contents of the document, which was handwritten by Hinckley on a white sheet of paper and found folded in an envelope in his cell.

A Butner correctional officer, Donald Meece, testified that he had seen the document and that it related to Hinckley's case and "also to the security of Mr. Hinckley and the security of others."

It also was disclosed during yesterday's hearing that Hinckley, 26, began to keep a diary shortly after the March 30 shooting entitled "The Diary of a Person We All Know." Meece said that he had read thediary, written on lined notebook paper, and described it as a daily log of such one- and two-line entries as "Today's a boring day" or "Went to the gym."

Hinckley frequently fidgeted with pens and paper during the hearing on his lawyers' efforts to suppress the government's use of the document at his upcoming trial. He tried to hide a small smile behind his right hand as Meece described the diary entries and Hinckley occasionally grinned during other testimony. His parents were present in the courtroom for the hearing, which was conducted under the extraordinarily tight security measures that have become routine each time Hinckley appears in the federal courthourse.

Yesterday was Hinckley's first appearance in court since his attorneys declared that they intend to argue that he was insane at the time that he shot Reagan and three others and thus should not be held criminally responsible for his act.

Hinckley's defense lawyers, Vincent J. Fuller and Gregory B. Craig, said that the court should prohibit the government from using the document as evidence against Hinckley, contending that it was taken in violation of his constitutional protections against unreasonable searches and seizures.

Those protections, the courts have said, do extend to prisoners, with some limitations generally related to security. Hinckley's lawyers claim that he had a right to expect that his personal papers would not be read by prison guards.

Government prosecutors contend, however, that Hinckley had been informed that his written materials, except those clearly marked as within the "attorney-client" privacy protections, would be examined during extensive and frequent searches of his cell, known as "shakedowns."

Correctional officers testified that shakedowns are conducted to search for contraband, such as drugs, inmate escape plans and any indications, such as writings, of suicidal tendencies. A minimum of one shakedown a day was conducted at Hinckley's cell at Butner after he ingested an overdose of Tylenol, an aspirin substitute, on May 27, in an apparent attempt to harm himself.

Correctional officers testified for the government that the document was found in an overstuffed envelope that did not indicate it would be protected from disclosure by his client-attorney relationship.

Parker is expected to continue hearing testimony about the document today. Hinckley's trial now is scheduled to begin Nov. 30.