feat: base-branch diff, token budget, repo tree#1
Merged
Conversation
Three new features for richer LLM session context: - `--base <branch>`: shows commits ahead of base and the cumulative diff (git diff base...HEAD), plus TODOs extracted from that diff. Gracefully skips if the ref doesn't exist. - `--tokens <n>`: token budget (0 = unlimited). Truncates BranchDiff first (largest field), then trims Commits/BranchCommits to stay under budget. Uses the ~4 chars/token heuristic. - `--tree`: includes a condensed repo file tree (tracked + untracked non-ignored files via git ls-files). Collapses directories beyond --depth (default 3) with a file count. All three features are covered by TDD tests written before implementation. Also adds `mustGit` test helper and disables commit signing in tempGitRepo for the CI environment. https://claude.ai/code/session_01S4dxye9bnFuf4uEVZr8Edr
- README: add --base, --tree, --depth, --tokens to synopsis, examples, and flags table; update description blurb - CLAUDE.md: add tree.go and truncate.go to package layout; add new flags to run examples; update data flow and output format descriptions https://claude.ai/code/session_01S4dxye9bnFuf4uEVZr8Edr
6b268a8 to
a9a896e
Compare
Sets user.name and user.email in the local git config at the start of every session, so commits are always attributed to Zack Penka regardless of the global Claude identity configured in the environment. https://claude.ai/code/session_01S4dxye9bnFuf4uEVZr8Edr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three new features for richer LLM session context:
--base <branch>: shows commits ahead of base and the cumulative diff(git diff base...HEAD), plus TODOs extracted from that diff. Gracefully
skips if the ref doesn't exist.
--tokens <n>: token budget (0 = unlimited). Truncates BranchDiff first(largest field), then trims Commits/BranchCommits to stay under budget.
Uses the ~4 chars/token heuristic.
--tree: includes a condensed repo file tree (tracked + untrackednon-ignored files via git ls-files). Collapses directories beyond
--depth (default 3) with a file count.
All three features are covered by TDD tests written before implementation.
Also adds
mustGittest helper and disables commit signing in tempGitRepofor the CI environment.
https://claude.ai/code/session_01S4dxye9bnFuf4uEVZr8Edr