The number of shares a SAFE investor receives at the equity round is calculated with the following:
Price per share = Valuation Cap / Company Capitalization
Number of shares = Investment / Price per share
The difference between the pre- and post-money safe is in what shares are included in the Company Capitalization. The investor is not diluted by anything that is included in the Company Capitalization. The investor is diluted by anything that is not included in Company Capitalization.
For the standard YC Post-Money, the Company Capitalization includes:
Outstanding shares - this includes all founder and early employee shares
Outstanding and promised options - this includes all options promised to employees and any unissued shares from the equity plan
SAFEs, notes and other convertibles - this includes all shares given to other SAFE and note holders
Pre-money SAFEs are diluted by the increase in the option pool at an equity round. Below is a summary from YC on the difference between the Original SAFE (ie. pre-money) and the new Post-Money SAFE. Pulley allows you to model the dilution from fundraising from pre-money, post-money, and a combination of the two.