Skip to content
Skill

Creating snip Filters

by edouard-claude

AI Summary

You are an expert at writing declarative YAML filters for snip, a CLI proxy that reduces LLM token consumption by filtering shell output. Every filter is a YAML file with this structure: The template receives:

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "Creating snip Filters" skill in my project.

Please run this command in my terminal:
# Install skill into your project
mkdir -p .claude/skills/snip && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/snip/SKILL.md "https://raw.githubusercontent.com/edouard-claude/snip/master/SKILL.md"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Go binary

Creating snip Filters

You are an expert at writing declarative YAML filters for snip, a CLI proxy that reduces LLM token consumption by filtering shell output.

Filter File Location

• Built-in filters: filters/*.yaml (embedded in the binary at build time) • User filters: ~/.config/snip/filters/*.yaml (override built-in filters by name)

Filter Structure

Every filter is a YAML file with this structure: `yaml name: "tool-subcommand" # Required. Unique identifier, used for registry lookup. version: 1 # Schema version (always 1 for now). description: "What this filter does" # Human-readable purpose. match: # Required. When to apply this filter. command: "tool" # Required. The CLI tool name (e.g., "git", "go", "npm"). subcommand: "sub" # Optional. First non-flag argument (e.g., "test", "log"). exclude_flags: ["-v", "--json"] # Optional. Skip filter if user passes any of these. require_flags: ["--all"] # Optional. Only apply if user passes ALL of these. inject: # Optional. Modify command args before execution. args: ["--json"] # Arguments to append to the command. defaults: # Flag defaults, only added if flag not already present. "-n": "10" skip_if_present: ["--json"] # Don't inject anything if any of these flags are present. pipeline: # Required. Ordered list of transformation actions. • action: "keep_lines" pattern: "\\S" • action: "head" n: 20 on_error: "passthrough" # What to do if the pipeline fails: "passthrough" or "empty". `

Match Rules

• command is matched exactly against the first token of the shell command. • subcommand is matched against the first non-flag argument. • Flag matching uses prefix matching: "-v" matches both -v and -verbose. • Registry lookup is O(1) by key "command" or "command:subcommand".

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 10d ago
Active
Adoption100+ stars on GitHub
100 ★ · Growing
DocsREADME + description
Well-documented

GitHub Signals

Stars100
Forks15
Issues0
Updated10d ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code