Bill Shorten has been sent a warning shot to fix the way he operates and consult his colleagues more during an extended debate on metadata in the Labor caucus on Tuesday.

Caucus agreed to pass the government's metadata retention bill subject to an amendment to better protect journalists and their sources, which is still to be negotiated between Attorney-General George Brandis and media chiefs.

Rising Labor talent Ed Husic took Mr Shorten to task in the regular meeting of Labor MPs saying he wished the consultation process for controversial new data retention laws had been done differently.