Two channels report the working context
Together they cover every way a session moves between checkouts. Automatic. The session reports the directory it is working in, read at the start of the session and again after every turn. When the agent switches checkouts natively, for example Claude Code’s EnterWorktree tool, the next report uses the new directory. Acd inside a shell tool does not move it, because the session’s own directory stays where it was launched.
Declared by the agent. The agent runs one command from inside a checkout:
AGENTS.md block on Codex. You can also tell a session “declare your working context” at any time.
The command identifies the session on its own. For Claude Code, the session id is in the command’s environment. For Codex, the command finds the codex process among its own ancestors and reads the session from it; with several Codex sessions active and no way to tell them apart, it refuses rather than guess, and --agent codex --session-id <id> names one exactly.
From branch to pull request
With GitHub connected under Settings → Integrations, LangWatch maps every branch a session reported to the pull requests whose head is that branch. The mapping works in both time directions: a pull request opened after the session went quiet is still found, and connecting GitHub backfills recent branches. LangWatch reads pull request status (open, merged, closed) live from GitHub whenever you look, and never stores it.Limits, exactly
- A session keeps the first repository it reported. Later declarations for other branches of the same repository attribute in full, and the session’s pull requests reflect every branch it declared. A declaration for a different repository does not move the session’s row off the first repository.
- Work outside any checkout attaches to no repository. For example, a session reviewing with
ghcommands from a home directory reports no repository, so its cost appears in usage but on no pull request. - One declaration cannot be split. A single turn that touches two repositories attributes to the one the agent declared last.