Carbylamine reaction: Aliphatic and aromatic primary amines,when heated with chloroform $(CHCl_3)$ and ethanolic potassium hydroxide $(KOH)$,form isocyanides or carbylamines,which are foul-smelling substances.
Secondary and tertiary amines do not undergo this reaction.
This reaction is known as the carbylamine reaction or isocyanide test and is used as a diagnostic test for primary amines.
General reaction:
$R-NH_2 + CHCl_3 + 3KOH \xrightarrow{\Delta} R-NC + 3KCl + 3H_2O$
Example with methanamine:
$CH_3NH_2 + CHCl_3 + 3KOH \xrightarrow{\Delta} CH_3-NC + 3KCl + 3H_2O$
Example with aniline:
$C_6H_5NH_2 + CHCl_3 + 3KOH \xrightarrow{\Delta} C_6H_5-NC + 3KCl + 3H_2O$