あげく follows a verb in the た-form, or a noun with , and says that a long or trying process ended badly: "after all that", "in the end". The kanji spelling is ; kana is at least as common. It is at home in speech and in writing.
、。
After agonizing over it, I ended up not buying anything.
、。
After a long debate, the plan was cancelled.
、。
After being kept waiting for hours, I didn't get to see them.
The first half has to be drawn out – repeated, prolonged or painful – and words like , or often say so. A after あげく changes nothing: means the same as .
The second half is what already happened, so it is not a plan, a wish or a request.
- × よく考えたあげく、行ってください → よく考えてから、行ってください
あげく or 末に
also means "after a long process", and its result can be good. あげく carries the speaker's regret or frustration, so a happy ending needs 末に.
、。
After all that hard work, I passed.
、。
After pushing myself too hard, I ended up ruining my health.
- × 努力したあげく、合格した → 努力した末に、合格した
says "in the end" without either connotation.
adds the last and worst thing in a list of troubles: "and on top of all that".
、、。
He was late, forgot his work, and on top of all that fell asleep in the meeting.