A court has heard that Aklakar Rahman, 38, had made repeated attempts to wound or kill prison officers.