How-To Guides

Practical guides for getting things done with gnaw.

  • Install gnaw โ€” A complete installation guide for gnaw on different operating systems.
  • Interactive selection in the TUI โ€” Use the gnaw TUI to browse a repo, filter with substring and glob search, trim to a token budget, pick a template, and copy the result.
  • Shrink a prompt with compression โ€” Use gnaw's syntax-aware compression to cut token count by stripping bodies, tests, and doc comments while keeping signatures.
  • Pipe a file list into gnaw โ€” Feed gnaw a newline-delimited list of paths on stdin โ€” from git, fd, or ripgrep โ€” to build a prompt from exactly those files, no walk and no globbing.
  • Use gnaw as an MCP server โ€” Run gnaw's MCP server so Claude Code, Claude Desktop, Cursor, or any MCP client can call codebase extraction as a tool during a session.
  • Split a big repo across files โ€” Use --split-size to slice an oversized prompt into multiple token-budgeted parts you can paste one at a time.
  • Scan for leaked secrets โ€” Use --secret-scan to catch API keys, tokens, and private keys before they end up pasted into a chat.
  • Enable shell completion โ€” Turn on tab-completion for gnaw's flags, enum values, template names, and paths in bash, zsh, or fish.