A Briton arrested in the Channel Tunnel as he entered the UK in 2003 had socks with traces of explosives in his luggage, the Old Bailey was told.
The prosecution said the socks had been modified to make them ideal for cleaning a mortar bomb.
A search of Andrew Rowe's former flat in west London also uncovered a notebook with 20 pages of notes on how to use a mortar, the court was told.
Mr Rowe, 34, of Maida Vale, denies four charges made under the Terrorism Act.
Three allege he had articles for use in terrorism and another charges him with making a record of information for use in terrorism.
Mr Rowe converted to Islam in the mid-1990s, called himself Yusuf Abdullah and began to travel abroad a lot, the court heard.
He married in 1997 and had four children, but the couple later separated.
Mr Rowe was seen to visit the home of his estranged family in Birmingham in summer 2003, months before his arrest.
A search of the property uncovered a piece of paper with details of a secret code substituting words like police, target and weapons for mobile phone model numbers, the court heard.
This made it "possible to communicate in an innocent message which only spoke about mobile telephones," said prosecutor Mark Ellison.
Mr Rowe had been staying in a hotel in Frankfurt, Germany, from 14 to 23 October after withdrawing thousands of pounds from bank accounts, the Old Bailey heard.
He was arrested as he left the French side of the Channel Tunnel but it was not until a week later that the pair of walking socks, tied to a pyjama cord, came under suspicion.
Very dirty, they were sent for analysis which found traces of TNT consistent with that from a mortar shell, the prosecution said.
The notepad found in the west London flat had 20 pages of handwritten notes on how to aim and fire an 82mm Russian-made mortar, a type of bomb fired from a tube.
Mr Ellison told the Old Bailey an army expert would be called to show "the sock ball, modified in that way, would be ideal as a cleaner of bung to be put in the top of the mortar tube."
The trial continues.