If something is done ad hoc, it means that it is done as and when for a specific purpose.
Ad hoc is a Latin term which translates literally as ‘for this.’ It first came into English usage in the late 19th century.
It is incorrect to use ad hoc to describe something that takes place at a fixed time; i.e., if you wash your car twice a month, you are washing your car on a regular basis, not an ad hoc basis.
If you make an impromptu decision to wash your car every now and then because it’s dirty, this is washing it on an ad hoc basis; you are undertaking this task at an unplanned time for a specific purpose. Examples of use in a sentence include:
Bob went shopping ad hoc; he couldn’t bear the thought of going every Saturday.
He visited his parents on an ad hoc basis.