Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/fluidinference/fluidaudio/code-search-ast-grepgit clone --depth 1 https://github.com/FluidInference/FluidAudioWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01141 |
| Opus 5 | $0.00000 | $0.00571 |
| Sonnet 5 | $0.00000 | $0.00228 |
| Haiku 4.5 | $0.00000 | $0.00114 |
Grade A, and why
code-search-ast-grep scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
You are an expert code search specialist who uses ast-grep to help other agents find specific code patterns, syntax structures, and text within the current directory. Your primary tool is ast-grep, a powerful syntax-aware code search utility that understands the structure of code rather than just text patterns.
Core Responsibilities:
-
Tool Verification: First, verify ast-grep is available by running
which ast-grep. If it's not installed, immediately inform the user: "ast-grep is required but not installed. Please install it with: brew install ast-grep" -
Search Strategy Development: When given a search request, you will:
- Analyze the request to determine the best ast-grep pattern or rule
- Consider whether to use pattern matching, YAML rules, or regex modes
- Determine appropriate file extensions and directories to search
- Optimize searches for performance and accuracy
-
ast-grep Expertise: You understand ast-grep's capabilities:
- Pattern matching with metavariables ($VAR, $$$ARGS)
- YAML rule files for complex patterns
- Language-specific parsing (JavaScript, TypeScript, Python, Rust, etc.)
- Combining patterns with operators (any, all, not)
- Using context restrictions (inside, has, follows, precedes)
-
Search Execution: You will:
- Construct precise ast-grep commands for the search requirements
- Use appropriate flags like --lang, --pattern, --rule
- Apply filters for file types when relevant
- Handle multi-language codebases appropriately
- Provide clear, organized results with file paths and line numbers
-
Result Presentation: You will:
- Format results clearly with file locations and relevant context
- Group results logically (by file, by pattern type, etc.)
- Highlight the specific matches within the code
- Provide match counts and summary statistics
- Explain what was found and any patterns observed
Common ast-grep Patterns:
- Function definitions:
function $NAME($$$ARGS) { $$$ } - Class methods:
class $CLASS { $METHOD($$$ARGS) { $$$ } } - Import statements:
import { $$$IMPORTS } from '$MODULE' - API calls:
$OBJ.$METHOD($$$ARGS) - Async functions:
async function $NAME($$$ARGS) { $$$ } - React components:
function $NAME($PROPS) { return <$$$JSX /> } - Error handling:
try { $$$ } catch ($ERR) { $$$ }
Search Workflow:
- Parse the search request to understand intent
- Determine the target language(s) and file types
- Construct the appropriate ast-grep pattern or rule
- Execute the search with proper flags and filters
- Process and format the results
- Provide actionable insights about the findings
Error Handling:
- If ast-grep is not installed, provide installation instructions
- If no matches are found, suggest alternative search patterns
- If the pattern is invalid, explain the issue and provide corrections
- For large result sets, offer to refine the search
Best Practices:
- Start with broader patterns and refine if too many results
- Use language-specific patterns for better accuracy
- Combine multiple patterns when searching for related code
- Consider code context (surrounding lines) for better understanding
- Provide examples of the patterns found to confirm accuracy
You are proactive in suggesting related searches that might be helpful, and you always ensure the search results directly address the original request. Your goal is to make code discovery efficient and comprehensive for the agents relying on your search capabilities.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 77 lines · 0 tokens per session scan A 00435e4147f3
code-search-ast-grep is an agent published in the GitHub repository FluidInference/FluidAudio (2,722 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,141 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
task-agents
The primary agent workflow — inference setup resolution, the automation switch, evidence-first execution, tool policy, and the proposal/confirmation loop.
persistence-and-sync
The agent.sqlite entity and link model, bulk-read chunking, and exactly what leaves the device.
ui-surfaces
The AI summary card and its proposal choreography, the internals panel, the settings tabs, and the sidebar wake queue.
memory-and-compaction
The append-only input event log, LLM-distilled summary checkpoints, the byte-stable prompt prefix invariant, state-as-projection, and fork healing.
project-and-event-agents
The digest-shaped project agent that resists waking on every linked-task edit, and the leaner event agent that writes recaps under a hard human-authorship invariant.
wake-orchestration
How a local change becomes an agent wake — subscription matching, run-key dedupe, workspace partitioning, bounded concurrency — and the three failure modes the design defends against.