Small Aircraft
Flight Crew Instrument; Flight Crew Private
Flight Crew Last 90 Days 22; Flight Crew Total 321; Flight Crew Type 321
Communication Breakdown; Distraction
Deviation / Discrepancy - Procedural Published Material / Policy
Flight Crew Returned To Clearance
Human Factors; Environment - Non Weather Related
I was departing ZZZ for ZZZ1 at approximately XA:15. I had filed an IFR flight plan. ZZZ Tower was closed due shortened hours related to COVID.  In the XXL run-up; I picked up my IFR flight plan clearance from Approach. Approach gave me my clearance and I wrote it down.  I plugged it into my FMS but failed to put in the squawk code in the transponder (I was squawking 1200).  This may have been because I usually receive my clearance by CD at ZZZ on the ramp and this was the first time I had to call Approach from the run-up. Or maybe I just missed it when inputting due to the fact it is in my checklist to be done prior to leaving the ramp.Once the airspace was clear and I was ready to depart; I called back Approach for release and departed after calling my position on CTAF.  There was no traffic within 10 miles of the airport at departure time.  About 30 seconds after departure; I called the given Approach frequency in my clearance to check in.  I was acknowledged; and asked to squawk my code and was given a direct heading to my IAP. It was then I realized I hadn't put in my code on the ground.  I imputed it and confirmed my position with ATC.  The flight was uneventful and landed XX minutes later at ZZZ1.I recognize my oversight in failing to input my squawk code was in part due to my reliance on always receiving my clearance while on the ramp; rather than in this case at my usual airport; but one where I had not departed with the Tower closed; so my checklist SOP was not reliable.After the flight; I contacted my regular flight instructor to discuss how best to verify inputs in this situation as my own checklist is clearly insufficient when CD is closed. We are going to go over such during my next lesson in two weeks. I have updated my SOP and will now triple check my clearance has been imputed with the squawk code before leaving any given run-up.
Pilot reported forgetting to set the correct code in the transponder due to not talking to Clearance Delivery; but rather the overlying TRACON since the Tower was closed due to COVID-19.