Generally, commissions as purchases are added to the basis (cost) of the stock (securities).
When selling, it is usually subtracted from the sales price.
https://www.irs.gov/instructions/i1040sd
https://www.irs.gov/pub/irs-pdf/f8949.pdf
**Disclaimer: Effort has been made to offer correct information; but due to the discussion forum limitations, the poster disclaims any legal responsibility for the accuracy of the poster's response**