Codebuff

code-searcher

v0.0.6
Published Oct 27, 2025

Usage Statistics
v0.0.6

Definition

const agentDefinition = {
id: "code-searcher",
displayName: "Code Searcher",
publisher: "codebuff",
version: "0.0.6",
model: "anthropic/claude-sonnet-4.5",
toolNames: [
"code_search",
"set_output"
],
spawnableAgents: [],
inputSchema: {
params: {
type: "object",
required: [
"searchQueries"
],
properties: {
searchQueries: {
type: "array",
items: {
type: "object",
required: [
"pattern"
],
properties: {
cwd: {
type: "string",
description: "Optional working directory to search within, relative to the project root. Defaults to searching the entire project"
},
flags: {
type: "string",
description: "Optional ripgrep flags to customize the search (e.g., \"-i\" for case-insensitive, \"-g *.ts -g *.js\" for TypeScript and JavaScript files only, \"-g !*.test.ts\" to exclude Typescript test files, \"-A 3\" for 3 lines after match, \"-B 2\" for 2 lines before match, --no-ignore to include files in ignored by .gitignore)."
},
pattern: {
type: "string",
description: "The pattern to search for"
},
maxResults: {
type: "number",
description: "Maximum number of results to return per file. Defaults to 15. There is also a global limit of 250 results across all files"
}
}
},
description: "Array of code search queries to execute"
}
}
}
},
includeMessageHistory: false,
outputMode: "structured_output",
spawnerPrompt: `Mechanically runs multiple code search queries (using ripgrep line-oriented search) and returns all results`,
systemPrompt: ``,
instructionsPrompt: ``,
stepPrompt: ``,
handleSteps: function* ({ params }) {
const searchQueries = params?.searchQueries ?? [], toolResults = [];
for (const query of searchQueries) {
const { toolResult } = yield {
toolName: "code_search",
input: {
pattern: query.pattern,
flags: query.flags,
cwd: query.cwd,
maxResults: query.maxResults
}
};
if (toolResult)
toolResults.push(...toolResult.filter((result) => result.type === "json").map((result) => result.value));
}
yield {
toolName: "set_output",
input: {
results: toolResults
}
};
},
mcpServers: {},
inheritParentSystemPrompt: false
}