# feat\(mcp\): expose thread workspace inventory · PR \#8685 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/8685)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: closed

Source repository: pingdotgg/t3code

Source branch: agents/mcp-workspaces/inventory

Target branch: t3code/codex-turn-mapping

Head commit: 718558bfe90355b4e072ef0279d4115d6f8e10fc

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/8685)

[Commits](https://git.cafe/pingdotgg/t3code/pull/8685/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/8685/diffs?format=markdown)

## Description

---

An agent can otherwise see only the branch and worktree path recorded on its thread, which does not establish whether Git agrees, which physical checkouts exist, or which live threads own them.

This change enriches `t3_worktree_status` with separate recorded and actual state, and adds bounded `t3_worktree_list` discovery. A dedicated Git inventory path reports canonical repository common-directory and physical worktree-root identities, including detached and stale registrations, without changing the existing paginated `vcs.listRefs` wire/cache shape.

Results are current-project scoped and read-only. Pages are sliced before status I/O; nested and symlinked recorded paths are resolved through actual Git identity; independent nested repositories are not misattributed; ordinary typed inventory failures make binding counts explicitly incomplete while interruption and defects propagate.

Focused validation:

- 241 lower-layer tests across real Git inventory, MCP status/list, registration, Claude exposure, contracts, client-runtime cache compatibility, and presentation
- `vp run --filter t3 typecheck`
- `vp run --filter @t3tools/contracts typecheck`
- `vp run --filter @t3tools/shared typecheck`
- `vp run --filter @t3tools/client-runtime typecheck`
- Targeted `vp lint`, `vp fmt --check`, and `git diff --check`

Review base: `t3code/codex-turn-mapping` at `415ed0f73b97f1655b6282492f81d0b2bba3a9cc`. Native stack: [#8685](https://github.com/pingdotgg/t3code/pull/8685) → [#8680](https://github.com/pingdotgg/t3code/pull/8680). This discovery layer does not add lifecycle pruning, revival, or cleanup.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

