The habaki (鎺) is a piece of metal encircling the base of the blade of a Japanese sword. It has the double purpose of locking the tsuba (guard) in place, and to maintain the weapon in its saya (scabbard).
The importance of the habaki is seen in drawing the katana from the scabbard. It is drawn by grasping the scabbard near the top and pressing the guard with the thumb to emerge the blade just enough to unwedge the habaki from inside the scabbard in a process called koiguchi no kirikata (鯉口の切り方) "cutting the koiguchi". The blade, being freed, can be drawn out very quickly. This is known as koiguchi o kiru (鯉口を切る), nukitsuke (抜き付け), or tanka o kiru (啖呵を切る) "clearing the tanka".
The habaki will cause normal wear and tear inside the scabbard, and either a shim or a total replacement of the scabbard may be needed to remedy the issue as it will become too loose over time. Removing the habaki and oiling it after cutting or once every few months is recommended.