Merge pull request #33 from entireio/add-code-search-instructions · Entire

Merge pull request #33 from entireio/add-code-search-instructions

79682cb→main·

evisdren·1w ago·3 files·+49 added/-10 removed

Add code search instructions to search skill and agents

Changes

3

1
2
3
3
4
5
6
12 unmodified lines

19
20
21
22
23
22
23
24
25
26

---
name: entire-search
description: Search Entire checkpoint history and transcripts with `entire search --json`. Use proactively when the user asks about previous work, commits, sessions, prompts, or historical context in this repository.
description: Search Entire checkpoint history and transcripts with `entire search --json`, or code content across repositories with `entire search --code --json`. Use proactively when the user asks about previous work, commits, sessions, prompts, historical context in this repository, or where code lives in other repositories.
tools: Bash
model: haiku
---
12 unmodified lines

1. Turn the task into one or more focused `entire search --json` queries.
2. Always use machine-readable output via `entire search --json`.
3. Use inline filters like `author:`, `date:`, `branch:`, and `repo:` when they improve precision.
4. If results are broad, rerun `entire search --json` with a narrower query instead of switching tools.
5. Summarize the strongest matches with the relevant commit, session, file, and prompt details available in the results.
4. For code content searches across repositories, add `--code` and refine with `--repo`, `--all-repos`, `--limit`, or `--case-sensitive`. Do not combine `--author`, `--branch`, or `--date` with `--code`. Query with distinctive tokens like function names, error strings, or config keys. Code search is limited to admins and insiders: if it fails with "not yet available" or an access error, do not retry — say so, search locally checked-out repos with `rg`/`grep` instead, and use checkpoint search (`entire search --json`, optionally `repo:*`) for cross-repo questions.
5. If results are broad, rerun `entire search --json` with a narrower query instead of switching tools.
6. Summarize the strongest matches with the relevant commit, session, file, and prompt details available in the results.

Keep answers concise and evidence-based.

M.claude/agents/entire-search.md+4/-3

1
2
3
3
4
5
6
9 unmodified lines

16
17
18
19
20
19
20
21
22
23
24

# ENTIRE-MANAGED SEARCH SUBAGENT v1
name = "entire-search"
description = "Search Entire checkpoint history and transcripts with `entire search --json`. Use when the user asks about previous work, commits, sessions, prompts, or historical context in this repository."
description = "Search Entire checkpoint history and transcripts with `entire search --json`, or code content across repositories with `entire search --code --json`. Use when the user asks about previous work, commits, sessions, prompts, historical context in this repository, or where code lives in other repositories."
sandbox_mode = "read-only"
model_reasoning_effort = "medium"
developer_instructions = """
9 unmodified lines

Keep answers concise and evidence-based.
"""

M.codex/agents/entire-search.toml+4/-3

---
name: search
description: Use when the user wants to find prior work, checkpoints, or agent conversations by topic, repo, branch, author, or recent time window
description: Use when the user wants to find prior work, checkpoints, or agent conversations by topic, repo, branch, author, or recent time window, or to search code content across repositories
---

# Search Checkpoints
# Search Checkpoints and Code

Use `entire search` to find relevant checkpoints before guessing from memory.
Use `entire search` to find relevant checkpoints before guessing from memory, or `entire search --code` to search code content across repositories.

## Response Format

11 unmodified lines

- The user asks things like "have we done this before?", "search past work", "find the previous implementation", or "look for checkpoints about X"
- You need prior context from another branch, repo, author, or recent time period
- You want likely matches first, then a deeper transcript read only for the best hit
- The user wants to find code across repositories they have access to, e.g. "where is X implemented?", "find usages of Y in our other repos" — use code search (`--code`)

Do not use this for the current active session. Use `session-handoff` for that.
Do not use this for the current active session. Use `session-handoff` for that. For searching files in the current working copy, prefer local tools (grep, ripgrep) over code search.

## Process

25 unmodified lines

entire explain --checkpoint <checkpoint-id> --raw-transcript --no-pager

Code Search

Add --code to search code content instead of checkpoints:

entire search "<query>" --code --json

Scope and refine with flags:

entire search "<query>" --code --json --repo owner/name --limit 20 --case-sensitive

Code Search Heuristics

Code Search Fallback

Code search is currently limited to admins and users on the insider list. If a --code search fails with "not yet available" or an access/permission error, do not retry — fall back:

  1. Tell the user code search requires admin or insider access
  2. If the target repo is checked out locally, search it with local tools (ripgrep, grep) instead
  3. For cross-repo questions, run a checkpoint search (entire search "<query>" --json, optionally repo:*) to find prior work that touches the code in question

Search Heuristics

Failure Modes