GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - VincentHardouin/opencode-snip: OpenCode plugin that prefixes shell commands with snip to reduce LLM token consumption

BranchesTags
Open more actions menu

Latest commit

 

History

38 Commits
38 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.opencode/plugins
.opencode/plugins
 
 
src
src
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
renovate.json
renovate.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

opencode-snip

OpenCode plugin that automatically prefixes shell commands with snip to reduce LLM token consumption by 60-90%.

What is snip?

snip is a CLI proxy that filters shell output before it reaches your LLM context window.

Command Before After Savings
go test ./... 689 tokens 16 tokens 97.7%
git log 371 tokens 53 tokens 85.7%
cargo test 591 tokens 5 tokens 99.2%

Installation

1. Install snip

brew install edouard-claude/tap/snip
# or
go install github.com/edouard-claude/snip/cmd/snip@latest

2. Configure OpenCode

Add the plugin to your OpenCode config (~/.config/opencode/opencode.json):

{
  "$schema": "https://opencode.ai/config.json",
  "plugins": ["opencode-snip@latest"]
}

The plugin targets OpenCode v2. On OpenCode v1, use opencode-snip@2.

How It Works

The plugin uses the tool execute.before hook to forward each shell command to snip hook, the same rewrite engine snip uses for Claude Code and other agents (tested with snip v0.25.2):

  • only commands snip has a filter for are rewritten to snip run -- <command>, each segment of &&, ||, ; chains separately
  • commands whose output feeds a pipe or a file redirection, heredocs, shell blocks and command substitutions are left untouched
  • if snip hook fails, the command runs unchanged

Development

This package uses semantic-release for automated releases. Commit messages should follow the Conventional Commits format:

  • fix: → patch release
  • feat: → minor release
  • feat!:, fix!: → major release

License

MIT

About

OpenCode plugin that prefixes shell commands with snip to reduce LLM token consumption

Resources

Readme
MIT license
Activity

Stars

165 stars

Watchers

1 watching

Forks

22 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.