feat: Auto-added shell context via go-template string#110
Merged
Conversation
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.
This one is cool! I always try to be as token-efficient as possible. I think that inference cost will be significantly more expensive post-ai-bubble.
If not, being able to solve a problem in the least amount of tokens possible is an indicator on how concentrated the task has been. This philosophy is what keeps me focusing on clai in addition to codex and claude, which I do use on the regular as well.
It's an exercise in learning how to best utilize LLMs to achieve some goal.
With this in mind! I found myself repeatedly prompting LLMs to use
pwdanddatetools, and to fetch certain files tosetup context. Then it struck me that I can simply add this to the initial query instead. This lead to appending certain
fixed data. But then I thought I might as well expand on this with templates: which I did.
So this PR introduces fully configurable context fetches, with arguments.
Example suggestions (in addition to the current default):
AGENTS.mdinto the prompt instead of relying on LLM to fetch itfind /path/toskills -maxdepth 1 -type f -exec cat {} +As we're using go templates + shell commands, it's very powerful. The timeout is configurable as well, so it could be a long
running thing (if needed).
Features:
-add-shell-context=<shellContextTemplate>/-asc=<shellContextTemplate>to auto-attach some shell context<claiConfigDir>/shellContextsclai setup -> 4shell_contextfielddefaultclai setupto use the generic table tool to homogenize look and feelTo try it out: