How They Use AI  |  Newest

<< Home  |  Tech

Increased determinism and token efficiency in AI workflows

AreaTech
AI usedClaude Code
Sourcer/ClaudeCode
Posted2026-09-24

The move

Use dynamic context injection to embed CLI command output directly into AI skill prompts.

Steps

  1. Define a skill file with the required Bash tools enabled.
  2. Insert a command using the !`command` syntax at the start of a line.
  3. Append || true to the command to ensure the skill loads even if the command returns a non-zero exit code.
  4. Invoke the skill with the necessary arguments to trigger the injection.
  5. 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.

Sources



Last updated November 26, 2026.