  We prove that if a right-angled Artin group $A_\Gamma$ is abstractly
commensurable to a group splitting non-trivially as an amalgam or HNN-extension
over $\mathbb{Z}^n$, then $A_\Gamma$ must itself split non-trivially over
$\mathbb{Z}^k$ for some $k\le n$. Consequently, if two right-angled Artin
groups $A_\Gamma$ and $A_\Delta$ are commensurable and $\Gamma$ has no
separating $k$-cliques for any $k\le n$ then neither does $\Delta$, so
"smallest size of separating clique" is a commensurability invariant. We also
discuss some implications for issues of quasi-isometry. Using similar methods
we also prove that for $n\ge 4$ the braid group $B_n$ is not abstractly
commensurable to any group that splits non-trivially over a "free group-free"
subgroup, and the same holds for $n\ge 3$ for the loop braid group $LB_n$. Our
approach makes heavy use of the Bieri--Neumann--Strebel invariant.
