EnterWorktree tool estimate · request

Stored count_tokens request for EnterWorktree tool estimate.

Record provenance

Measurement
estimate-tool-EnterWorktree
Record ID
7ccd26a6b15bb259a02e5a3cc277c179100cc2af64112179f43e4cf3a8547178
Exact artifact
raw/count-tokens/7ccd26a6b15bb259a02e5a3cc277c179100cc2af64112179f43e4cf3a8547178.request.json
JSON
{
  "id": "7ccd26a6b15bb259a02e5a3cc277c179100cc2af64112179f43e4cf3a8547178",
  "label": "estimate-tool-EnterWorktree",
  "generatedAt": "2026-06-09T00:30:01.552Z",
  "url": "https://api.anthropic.com/v1/messages/count_tokens?beta=true",
  "headers": {
    "anthropic-beta": "claude-code-20250219,context-1m-2025-08-07,interleaved-thinking-2025-05-14,context-management-2025-06-27,prompt-caching-scope-2026-01-05,mid-conversation-system-2026-04-07,advisor-tool-2026-03-01,effort-2025-11-24,token-counting-2024-11-01",
    "anthropic-version": "2023-06-01",
    "content-type": "application/json",
    "x-api-key": "<redacted>"
  },
  "body": {
    "model": "claude-opus-4-8",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "<system-reminder>\nAs you answer the user's questions, you can use the following context:\n# currentDate\nToday's date is 2026-06-08.\n\n      IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.\n</system-reminder>\n\n"
          },
          {
            "type": "text",
            "text": "say hi",
            "cache_control": {
              "type": "ephemeral"
            }
          },
          {
            "type": "text",
            "text": "{\"description\":\"Use this tool ONLY when explicitly instructed to work in a worktree — either by the user directly, or by project instructions (CLAUDE.md / memory). This tool creates an isolated git worktree and switches the current session into it.\\n\\n## When to Use\\n\\n- The user explicitly says \\\"worktree\\\" (e.g., \\\"start a worktree\\\", \\\"work in a worktree\\\", \\\"create a worktree\\\", \\\"use a worktree\\\")\\n- CLAUDE.md or memory instructions direct you to work in a worktree for the current task\\n\\n## When NOT to Use\\n\\n- The user asks to create a branch, switch branches, or work on a different branch — use git commands instead\\n- The user asks to fix a bug or work on a feature — use normal git workflow unless worktrees are explicitly requested by the user or project instructions\\n- Never use this tool unless \\\"worktree\\\" is explicitly mentioned by the user or in CLAUDE.md / memory instructions\\n\\n## Requirements\\n\\n- Must be in a git repository, OR have WorktreeCreate/WorktreeRemove hooks configured in settings.json\\n- Must not already be in a worktree session when creating a new worktree (`name`); switching into another existing worktree via `path` is allowed\\n\\n## Behavior\\n\\n- In a git repository: creates a new git worktree inside `.claude/worktrees/` on a new branch. The base ref is governed by the `worktree.baseRef` setting: `fresh` (default) branches from origin/<default-branch>; `head` branches from your current local HEAD\\n- Outside a git repository: delegates to WorktreeCreate/WorktreeRemove hooks for VCS-agnostic isolation\\n- Switches the session's working directory to the new worktree\\n- Use ExitWorktree to leave the worktree mid-session (keep or remove). On session exit, if still in the worktree, the user will be prompted to keep or remove it\\n\\n## Entering an existing worktree\\n\\nPass `path` instead of `name` to switch the session into a worktree that already exists (e.g., one you just created with `git worktree add`). The path must appear in `git worktree list` for the current repository — paths that are not registered worktrees of this repo are rejected. ExitWorktree will not remove a worktree entered this way; use `action: \\\"keep\\\"` to return to the original directory.\\n\\nSwitching with `path` also works when the session is already in a worktree (the previous worktree is left on disk, untouched, and only the new one is tracked for exit-time cleanup), and from agents whose working directory was pinned at launch (subagent isolation or explicit cwd). In both cases the target must be a worktree under `.claude/worktrees/` of the same repository, and from a pinned agent the switch only affects this agent, not the parent session. After a further switch, previously-visited worktrees are no longer writable — re-issue EnterWorktree with `path` to return to one.\\n\\n## Parameters\\n\\n- `name` (optional): A name for a new worktree. If neither `name` nor `path` is provided, a random name is generated.\\n- `path` (optional): Path to an existing worktree of the current repository to enter instead of creating one. Mutually exclusive with `name`.\\n\",\"input_schema\":{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"additionalProperties\":false,\"properties\":{\"name\":{\"description\":\"Optional name for a new worktree. Each \\\"/\\\"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided. Mutually exclusive with `path`.\",\"type\":\"string\"},\"path\":{\"description\":\"Path to an existing worktree of the current repository to switch into instead of creating a new one. Must appear in `git worktree list` for the current repo. Mutually exclusive with `name`.\",\"type\":\"string\"}},\"type\":\"object\"},\"name\":\"EnterWorktree\"}"
          }
        ]
      },
      {
        "role": "system",
        "content": "The following skills are available for use with the Skill tool:\n\n- deep-research: \n- update-config: \n- keybindings-help: \n- verify: \n- code-review: \n- simplify: \n- fewer-permission-prompts: \n- loop: \n- claude-api: \n- run: \n- init: \n- review: \n- security-review: "
      }
    ],
    "thinking": {
      "type": "adaptive"
    },
    "output_config": {
      "effort": "high"
    },
    "system": [
      {
        "type": "text",
        "text": "x-anthropic-billing-header: cc_version=2.1.168.c27; cc_entrypoint=sdk-ts; cch=e5b75;"
      },
      {
        "type": "text",
        "text": "You are a Claude agent, built on Anthropic's Claude Agent SDK.",
        "cache_control": {
          "type": "ephemeral"
        }
      }
    ]
  },
  "bodyCanonicalSha256": "c3706411c0025393d5d6905ceef37e2f4ddb9d5e2a1ac0120ce0c55bb7472a68"
}