Skip to content

Files, mentions, and context

The app scopes prompts, files, diffs, and history to the active worktree.

Every terminal or chat session belongs to a worktree. That worktree provides:

  • Commands run from the worktree directory.
  • Diffs compare against the worktree’s recorded target branch.
  • Session history scopes to the task.
  • Worktree-aware sc commands resolve the worktree from the CLI process’s current directory.

Copy context from another task into the prompt, link it, or handle it in a separate worktree.

In native chat sessions, type @ to mention a file and point the agent at it. Examples:

Review @src/auth/session.ts and explain why the timeout test is flaky.
Update @src/content/docs/docs/cli-local-api.md to include the new worktree commands.

Edits to the prompt preserve mentions as explicit references.

Paste text or attach files to supply material outside the repository, such as error logs, PR comments, product notes, or a reproduction transcript. Large pasted text may be staged as provider context rather than left inline when the selected Chat UI adapter supports it.

  • The exact error and stack trace.
  • The command that produced it.
  • The relevant environment detail.
  • The expected behavior.
  • The recent change that might be related.

In a Shared Context branch group, FEATURE.md records the objective, scope, constraints, affected repositories, and cross-repository contracts. AGENTS.md and CLAUDE.md direct sessions to that context, and the group-level context/ folder can hold supporting material that belongs to the feature rather than one repository.

Useful shared context includes:

  • A spec or acceptance criteria.
  • A cross-cutting API or data contract.
  • The affected repositories and why each one participates.
  • A review or rollout order.

New groups materialize child worktrees lazily. Mention or open a child file only after that repository participates in the group. For the full branch-group and sc worktree ensure-child flow, see Shared context.

When the agent finishes, open the review view to inspect the resulting diff.

For visual web feedback, use browser annotations to select page elements, add comments, and send the batch to a Chat UI tab.