MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / worktreeIndexAdvice

Function worktreeIndexAdvice

src/sync/worktree.ts:216–220  ·  view source on GitHub ↗

* The way out of a borrowed index: one built in the worktree itself. A person * at the CLI is told to build it. An agent is told the user can: indexing is * the user's decision, and the server instructions tell the agent not to run * `codegraph init` itself, so a tool result must not tell it to.

(audience: 'user' | 'agent')

Source from the content-addressed store, hash-verified

214 * `codegraph init` itself, so a tool result must not tell it to.
215 */
216function worktreeIndexAdvice(audience: 'user' | 'agent'): string {
217 return audience === 'agent'
218 ? 'The user can run "codegraph init" in this worktree for a worktree-local index.'
219 : 'Run "codegraph init" in this worktree for a worktree-local index.';
220}
221
222/**
223 * One-line-per-fact warning describing a detected mismatch: `codegraph status`

Callers 2

worktreeMismatchWarningFunction · 0.85
worktreeMismatchNoticeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected