The aim of this study was to synthesize a highly efficient organic-inorganic nanocomposite. In this research, the carbon nanotube/magnetite/polyaniline nanocomposite was successfully prepared through a facile route. Monodisperse magnetite nanospheres were prepared through the coprecipitation route, and polyaniline nanolayer as a modified shell with a high surface area was synthesized by an in situ growth route and characterized by Fourier transform infrared spectroscopy, scanning electron microscopy, X-ray diffraction, and energy-dispersive X-ray spectroscopy. The prepared nanocomposite was immobilized on a stainless-steel wire for the fabrication of the solid-phase microextraction fiber. The combination of headspace solid-phase microextraction using carbon nanotube/magnetite/polyaniline nanocomposite fiber with gas chromatography and mass spectrometry can achieve a low limit of detection and can be applied to determine phenolic compounds in water samples. The effects of the extraction and desorption parameters including extraction temperature and time, ionic strength, stirring rate, pH, and desorption temperature and time have been studied. Under the optimum conditions, the dynamic linear range was 0.01-500 ng/mL and the limits of detection of phenol, 4-chlorophenol, 2,6-dichlorophenol, and 2,4,6-trichlorophenol were the lowest (0.008 ng/mL) for three times. The coefficient of determination of all calibration curves was more than 0.990.