Matthew F. Shannon, Mayor Marion Barry's special assistant for labor and religious affairs, will leave his post at the end of the week to take a federal job, Shannon said yesterday.

Shannon said he would leave the District government of Friday to take a job as assistant counsel for the Federal Home Loan Bank Board here.

Shannon's departure is the second within the last three weeks by one of Barry's top aides. D. C. Dpartment of Employment Services Director William Ford previously announced that he was resigning to take a position with the Agency for International Development.

Shannon's move also comes at a time when Barr's relationships with organized labor -- to which Shannon served as liaison -- are at a crisis point. Unions representing the city's employes are demanding a 9.1 percent pay increase, while Barry is offering only 5 percent.

A knowledgeable District Building source said the District government's current labor problems played some role in Shannon's decision to leave, with Shannon disapproving of the mayor's hard-line approach. Barry said at a press conference yesterday that Shannon had been considering the move to the federial bank board for several months, but said he had not yet officially been informed of Shannon's decision to quit.

Last year Shannon served for several months as acting director of the Department of Employment Services, then called the Department of Labor. Barry made hm a special assistant after hiring the departing Ford to head the agency.