headquarters (on the battlefield)
Original meaning: the place where the commander's banner was set up, i.e., the military headquarters. Now mainly a historical term.
In the Warring States period, 旗本 referred to the headquarters where the commander was stationed.
direct retainer of a shogun; hatamoto
In the Edo period, a hatamoto was a samurai who served the shogun directly and had the right to an audience. The term is well-known in historical contexts.
In the Edo period, hatamoto were direct retainers of the shogun.
I heard that his ancestor was a hatamoto.
Literally 'banner origin' or 'under the banner'. Originally referred to the place where the commander's banner was set up (headquarters), and later came to mean the direct retainers who gathered there.