  We study the problems of finding a shortest synchronizing word and its length
for a given prefix code. This is done in two different settings: when the code
is defined by an arbitrary decoder recognizing its star and when the code is
defined by its literal decoder (whose size is polynomially equivalent to the
total length of all words in the code). For the first case for every
$\varepsilon > 0$ we prove $n^{1 - \varepsilon}$-inapproximability for
recognizable binary maximal prefix codes, $\Theta(\log n)$-inapproximability
for finite binary maximal prefix codes and $n^{\frac{1}{2} -
\varepsilon}$-inapproximability for finite binary prefix codes. By
$c$-inapproximability here we mean the non-existence of a $c$-approximation
polynomial time algorithm under the assumption P $\ne$ NP, and by $n$ the
number of states of the decoder in the input. For the second case, we propose
approximation and exact algorithms and conjecture that for finite maximal
prefix codes the problem can be solved in polynomial time. We also study the
related problems of finding a shortest mortal and a shortest avoiding word.
