The boy said Will Cornick also showed him a large kitchen knife before he killed Mrs Maguire moments later at Corpus Christi Catholic College, in Leeds, in April 2014, Wakefield Coroner's Court heard.
In a statement read to the court, the teenager explained that he and Cornick were working in the room next to where Mrs Maguire was just before the incident.
He told police officers how Cornick got a large knife out of his bag and showed it to him.
The boy said Cornick asked "if I wanted to touch it to see how sharp it was".
In his statement, the teenager said Cornick then tried to conceal the knife up his sleeve, but said it was "too visible, too obvious" and changed his mind, putting it in a pocket in his blazer.
The boy said Cornick then left to go into the next door room where Mrs Maguire was teaching some other pupils.
He said: "He just winked and smiled at me as he left the room."
The boy said he did not know what happened after that until he heard noises next door.
He said he did not know why he did not immediately report that Cornick had a knife.
The boy said: "I was in shock. I did not really know what to do.
"I know I should have told someone, but in the room I was in there wasn't any teachers supervising us."
The jury has heard how Cornick told a number of children on the morning of the tragedy what he was planning to do to Mrs Maguire and two teachers.
Nick Armstrong, the barrister representing Mrs Maguire's husband - Don - and their four children, has explained to the jury how one of the key issues for the inquest is why none of these children reported what they had been told.
Cornick, who was 15 years old at the time of the incident, admitted murdering Mrs Maguire. He was jailed for life and ordered to serve a minimum of 20 years in custody.