“Access” is an unfortunate word. As far as I can understand the actual rules on IRS publication 969, when you are covered by Medicare you can’t contribute, but you certainly can spend the money that’s already in your HSA.
This question about when do you have to stop contributing to the HSA because of Medicare is tricky. The point is that if you put money in the HSA when it is not allowed, the IRS considers that an “excess contribution” which gets penalized severely.
The key question is on what date a contribution would be classified as an “excess contribution” by the IRS. Is it the day you fill out the forms to apply for Medicare? Is it 6 months before that day? Is it the day the CMS accepts your application? Is it the day your Medicare insurance would actually start paying your medical bills?
I’ve concluded that the IRS means the last of those choices: they don’t allow you to contribute to the HSA for the time starting on the day your Medicare coverage would pay your bills, and I’ll show their actual statement below so you can judge for yourself what the rule is, because I’m not an accountant, lawyer, or government employee.
The CMS documents confuse this, because sometimes they use the phrase “enrolled in Medicare” to mean actively covered by the Medicare insurance, and other times they say “enroll” to mean “sign up” for coverage, coverage which may start in the future or which may begin retroactively by as much as 6 months before you signed up depending on your age when you sign up. That makes it seem to say that you’re not allowed to contribute to the HSA starting 6 months before you sign up for Medicare, but that’s not the actual IRS rule.
It appears to me the definitive rule comes from the IRS, because they are the ones who penalize HSA contributions when they are not allowed. Their rules are in publication 969.
Specifically, in https://www.irs.gov/publications/p969#en_US_2022_publink1000204063 in the section “Contributions to an HSA” subsection “Enrolled in Medicare” it states the following:
Beginning with the first month you are enrolled in Medicare, your contribution limit is zero. This rule applies to periods of retroactive Medicare coverage. So, if you delayed applying for Medicare and later your enrollment is backdated, any contributions to your HSA made during the period of retroactive coverage are considered excess. See Excess contributions, later.
You turned age 65 in July 2022 and enrolled in Medicare. You had an HDHP with self-only coverage and are eligible for an additional contribution of $1,000. Your contribution limit is $2,325 ($4,650 × 6 ÷ 12).
Given this (you can contribute the 6 months before the coverage started at age 65), I deduce that you can’t contribute to the HSA for the period where the Medicare coverage can actually pay for your medical expenses. That’s not the date on which you sign up. If you sign up before turning 65 it should be the first day of the month during which you turn 65. If you sign up after turning 65, the Medicare coverage is started retroactively, back to age 65 or back 6 months, whichever covers fewer months. It’s that last part that leads people to say stop contributing 6 months before Medicare starts, even though that’s not strictly the rule, it does stay safe from the IRS “excess contributions” rule.