As you need to collect your luggage, you will be exiting the "air-side" of the airport and hence need a Visa. The fact that you don't plan to exit the airport complex does not matter.
As answered here, India does not require a Visa if you only stay air-side (which is what happens if your luggage is checked all the way through to your final destination).
If you need to collect your luggage, you will have to pass through immigration (Source: map on official website and this writeup) and as Afghanistan ordinary passport holders are not exempt from visa requirements, you will need a visa.
You may be able to request the transfer desk to issue you a boarding pass and collect your luggage for you (as said by some people in linked question), but shouldn't rely on it. To be safe just get a Visa.
UPDATE: I have been browsing a few forums and people have recounted stories of how the transfer desk staff collected and checked-in their luggage when they arrived without a Visa (this, this and this). So it seems that it may be possible. I Think you can get in touch with your airlines (The one that flies you from Delhi-US) and ask them if they have any such arrangement at Delhi.