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
.claude/agents
Mentire-search.md+4/-3
.codex/agents
Mentire-search.toml+4/-3
skills/search
MSKILL.md+41/-4
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
- By default results are scoped to the current repository; add
--all-repos(orrepo:*) to search every repo the user can access --case-sensitiveonly applies with--code--limitis the total result count for code search (not per page)--author,--branch, and--dateare checkpoint filters — do not combine them with--code- Present results as file paths with matching snippets; do not dump raw JSON unless asked
Code Search Heuristics
- Search for distinctive tokens: function names, error strings, config keys — not natural-language descriptions
- Prefer exact identifiers over partial words; add
--case-sensitivewhen the identifier casing matters (e.g.HttpClientvshttpclient) - Scope with
--repowhen the user names a repo; otherwise start with the current repo and widen with--all-reposif nothing hits - If a query is too broad, add a second distinctive term or increase specificity before raising
--limit
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:
- Tell the user code search requires admin or insider access
- If the target repo is checked out locally, search it with local tools (ripgrep, grep) instead
- For cross-repo questions, run a checkpoint search (
entire search "<query>" --json, optionallyrepo:*) to find prior work that touches the code in question
Search Heuristics
- Start with the user's domain terms, feature name, error text, file name, or ticket ID 4 unmodified lines
Failure Modes
- If search says authentication is required, tell the user to run
entire login - If code search says it is not available or access is denied, it is limited to admins and insiders — use the Code Search Fallback above rather than retrying
- If there are no matches, say that clearly and mention the filters or query terms you tried
- If the user really wants the current session, switch to
session-handoffinstead of searching checkpoints