FluidAudio: Agent for Claude Code

.claude/agents/code-search-ast-grep.md

code-search-ast-grep is an agent for Claude Code from FluidInference/FluidAudio. It costs 0 tokens per session (1,141 once invoked), scanned A, original, Apache-2.0.

A code-search helper for finding text and code structures across files. It uses ast-grep, a tool that understands programming syntax rather than matching text alone.

In plain words
What is it for?
Use it to search syntax patterns, function definitions, and other code structures in languages such as JavaScript, TypeScript, Python, and Rust.
Why use it?
It helps locate matching functions or patterns when ordinary text search is too broad or misses equivalent code.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; names the TodoWrite tool.

This is FluidInference/FluidAudio's own configuration. It tells Claude Code how to work on FluidAudio itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything FluidAudio configures →

About the project

FluidAudio is a Swift SDK that runs local audio AI models on Apple devices for speech recognition, text-to-speech, voice activity detection, and identifying who is speaking. It is intended for developers building iOS and macOS apps with low-latency audio processing. The catalogue add-ons provide workflows for using the SDK.

FluidInference/FluidAudio · 3,265 stars · on GitHub · docs.fluidinference.com

Reuse

Borrowing it

Nothing to install: this file belongs to FluidInference/FluidAudio. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/FluidInference/FluidAudio/main/.claude/agents/code-search-ast-grep.md
Clone the repo
git clone --depth 1 https://github.com/FluidInference/FluidAudio

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-search-ast-grep

README.md
[![agentmods](https://agentmods.dev/badge/agents/fluidinference/fluidaudio/code-search-ast-grep/github.svg)](https://agentmods.dev/agents/fluidinference/fluidaudio/code-search-ast-grep)
Your own site
<a href="https://agentmods.dev/agents/fluidinference/fluidaudio/code-search-ast-grep"><img src="https://agentmods.dev/badge/agents/fluidinference/fluidaudio/code-search-ast-grep/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-search-ast-grep

Your own site · 80×15
<a href="https://agentmods.dev/agents/fluidinference/fluidaudio/code-search-ast-grep"><img src="https://agentmods.dev/badge/agents/fluidinference/fluidaudio/code-search-ast-grep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,141 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01141
Opus 5.5 $0.00000 $0.00456
Sonnet 5.5 $0.00000 $0.00228
Haiku 4.5 $0.00000 $0.00114

Measured 2mo ago against content hash 00435e4147f3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 2mo 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.

.claude/agents/code-search-ast-grep.md · 77 lines

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:

  1. 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"

  2. 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
  3. 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)
  4. 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
  5. 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:

  1. Parse the search request to understand intent
  2. Determine the target language(s) and file types
  3. Construct the appropriate ast-grep pattern or rule
  4. Execute the search with proper flags and filters
  5. Process and format the results
  6. 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.

Changes

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.

  1. 2mo ago First seen · 77 lines · 0 tokens per session scan A 00435e4147f3

Subscribe to this mod's changes

code-search-ast-grep is an agent published in the GitHub repository FluidInference/FluidAudio (3,265 stars, last pushed 4d ago), 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.

Related

code-search-ast-grep compared with agents from other repositories

code-search-ast-grep next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-search-ast-grepFluidInference/FluidAudioAgent3.3k4d agoApache-2.0A0Claude Code
performance-reviewerNagarjuna2997/ios-agent-skillAgent408d agoMITA61Claude Code
swift-debuggerNagarjuna2997/ios-agent-skillAgent408d agoMITA61Claude Code
ios-debugging-expertpatrickserrano/lacquerAgent54d agoMITA338Claude Code
ios-performance-optimizerpatrickserrano/lacquerAgent54d agoMITA0Claude Code
apple-platform-builderrhyean88/apple-platform-build-tools-claude-code-pluginAgent423d agoMITA69Claude Code
Bug Fix — By Screentqtuan1201/TTBaseUIKitAgent233mo agoMITA29Claude Code