<< Home | Tech
Increased determinism and token efficiency in AI workflows
| Area | Tech |
| AI used | Claude Code |
| Source | r/ClaudeCode |
| Posted | 2026-09-24 |
The move
Use dynamic context injection to embed CLI command output directly into AI skill prompts.Steps
- Define a skill file with the required Bash tools enabled.
- Insert a command using the !`command` syntax at the start of a line.
- Append || true to the command to ensure the skill loads even if the command returns a non-zero exit code.
- Invoke the skill with the necessary arguments to trigger the injection.
- Verify the expanded context by checking the session .jsonl file in ~/.claude/projects/.
Prompt for your AI
Create a skill file that uses dynamic context injection: --- name: [skill_name] description: "[description]" allowed-tools: Bash([tool1], [tool2]) --- !`[shell_command_here] || true` [additional_instructions]
What happened
The user developed a system to manage work backlogs using Claude Code. By using the !`command` syntax, they inject the output of shell commands directly into the AI's context. This forces the AI to follow specific instructions or data retrieved from the file system, reducing reliance on the AI's interpretation.Watch out
Commands must be pre-approved in your permission settings or the skill will abort. Ensure commands are secure as they execute without further prompts.Give it to your agent
Read https://howtheyuse.ai/p/increased-determinism-and-token-efficiency-in-ai-workflows.md and help me do this.