Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

context

Assemble task-relevant context from search results and git history. Searches for code matching your query, then expands results with temporally coupled files (files that change together in git history). Outputs a context bundle optimized for feeding to AI agents or for understanding a task’s scope.

Usage

bobbin context <QUERY> [OPTIONS]

Examples

bobbin context "fix the login bug"                   # Default: 500 line budget
bobbin context "refactor auth" --budget 1000          # Larger context budget
bobbin context "add tests" --content full             # Include full code content
bobbin context "auth" --content none                  # Paths/metadata only
bobbin context "auth" --depth 0                       # No coupling expansion
bobbin context "auth" --repo myproject --json         # JSON output for a specific repo

Options

FlagShortDescription
--budget <LINES>-bMaximum lines of content to include (default: 500)
--content <MODE>-cContent mode: full, preview (default for terminal), none
--depth <N>-dCoupling expansion depth, 0 = no coupling (default: 1)
--max-coupled <N>Max coupled files per seed file (default: 3)
--limit <N>-nMax initial search results (default: 20)
--coupling-threshold <F>Min coupling score threshold (default: 0.1)
--repo <NAME>-rFilter to a specific repository

Context Bundle

The context bundle includes:

  • Direct matches: Code chunks matching your query, ranked by relevance
  • Coupled files: Files with shared commit history to the direct matches
  • Budget tracking: How many lines were used out of the budget
  • File metadata: Paths, chunk types, line ranges, relevance scores