Repository navigation
feat(claude-code): verified organic embedding for data-returning built-ins - #181
Open
saichandrapandraju wants to merge 2 commits into
Open
saichandrapandraju wants to merge 2 commits into
saichandrapandraju wants to merge 2 commits into
Conversation
…built-ins Make the common built-ins embed organically out of the box, based on shapes captured from a live Claude Code 2.1.x run rather than guessed: - Read -> file.content (nested string): explicit shape map (kept). - Bash -> stdout, WebFetch -> result (top-level strings): already handled by the generic fallback -- no explicit entry needed. - WebSearch -> results (a list of result strings): new handling; the payload rides the last result. _embed_dict now embeds into a list-of-strings leaf. Drop the previously guessed Bash/Grep/Glob entries: Bash is covered by the fallback identically, and Grep/Glob are not exposed in the tested build so their shapes are unverified -- the fallback still embeds them if their result is a top-level string, else they degrade to the additionalContext note. The README gains a "targeting built-in tools" table and notes the set is version/config dependent (confirm names via a baseline run's recorded calls). Shapes verified via a live run; embedding unit-tested against them. The top-level-string fallback path (now covering WebFetch) is already E2E-proven by the Bash/Read gateway runs. 334 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: saichandrapandraju <saichandrapandraju@gmail.com>
saichandrapandraju
added this pull request to stack #178
October 15, 2026 14:12
This branch has not been deployed
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.
Stacked on #180. Make the common built-ins embed organically (not just fall back to a note), using shapes captured from a live Claude Code 2.1.x run.
Verified shapes → handling
Readfile.content(nested string)Bashstdout(top-level string)WebFetchresult(top-level string)WebSearchresults(list of strings)_embed_dictembeds into a list-of-strings leaf (rides the last result)Changes
_CONTENT_PATHnow holds only verified, non-top-level shapes:Read(nested) andWebSearch(list)._embed_dicthandles a list-of-strings leaf (forWebSearch.results).Bash/Grep/Globentries:Bashis covered identically by the generic fallback;Grep/Globaren't exposed in the tested build, so their shapes are unverified — the fallback still embeds them if their result is a top-level string, else they degrade gracefully toadditionalContext.Verification
Shapes were captured from a live
claude -prun (a full-dump PostToolUse probe); embedding is unit-tested against those exact shapes. The top-level-string fallback path (now coveringWebFetch) is already E2E-proven by theBash/Readgateway runs — same code, different field.WebSearch's new list path is unit-tested. 334 tests pass; ruff + pyright clean.Sequence
#171 → #177 → #180 → this → [#3 input-poisoning] → #179 (subagents, rebased last).🤖 Generated with Claude Code