TIL: One escape sequence makes my terminal follow my AI agent into a worktree A developer discovered that using the OSC 7 escape sequence allows their terminal to automatically track the current directory when an AI agent like Claude Code switches to a different worktree, eliminating the need for manual navigation. The thing that made me grin today: I tell Claude Code https://claude.com/claude-code to “work in a the agent jumps into a fresh checkout, and my Escape sequences aren’t just colors. OSC — Operating System Command — is the family that sends side-channel messages to your terminal: window title, clipboard, and the one here, the current directory OSC 7 https://en.wikipedia.org/wiki/ANSI escape code OSC Operating System Command sequences :