WordPress Rewrites – How can I pass a variable to Custom Post Type?

You can use add_rewrite_endpoint, which will add a query var and generate the necessary rewrite rules:

function wpd_cid_endpoint() {
    add_rewrite_endpoint( 'cid', EP_PERMALINK );
}
add_action( 'init', 'wpd_cid_endpoint' );

Don’t forget to flush rewrite rules after changing rules. You can do this quickly by visiting the Settings > Permalinks page in admin.