IF crash chilling bottle/barrel and add the sugar when cool then
- Though its not a hard and fast rule and you can warm the brew back up in advance if you like..
My reason behind suggesting to bottle/ barrel cool is while cooler the sediment that has dropped out may be more inclined to remain as sediment as you rack/drain off, where if warmer the sediment may be more prone to disturbance? this is after all the feature of chilling the brew your trying to exploit
Just be aware that Beer bottled cold will soon warm up to yeast friendly fermentation temps to condition your brew, beer in a pressure barrel will take longer to warm up due to its larger thermal mass.
So simply monitor you beer after packaged, and when its warm (18c+? check lowest temp suggested for fermentation on your kit?) start your 2-3weeks conditioning period
You DONT want to bottle/barrel, warm up, Then add sugar.. That would be a VERY BAD IDEA, post fermentation you want to limit the beers risk of contact with 02 as much as possible so bottle/barrel AND prime in the single hit
if you google 'priming charge calculator' you will find a few offerings hosted by brew communities all over the world and they are intended to help you calculate a precise priming charge to condition your beers to a specific target of co2 concentration.
Some are simple others more involved - go check em out but dont feel obliged to use them.
tbh i have never used one and simply add a level teaspoon(3g) of white sugar to each 450-550ml('pint') bottle.
But if after a precise condition target for your brew then the highest temp the brew sat at fermenting will dictate the maximum level of co2 that is contained already in the brew. It dissolved as it bubbled up during fermentation.
This indicates the additional condition required by adding the priming charge. If a crash chil temp is used it will suggest the brew contains a lot more co2 than it does as little or no extra co2 will get absorbed while its chilling as the yeast have finished creating it even though the colder brew has a much higher capacity for co2 absorption.