The Claude CLI now supports contextual file injection, allowing you to seamlessly reference and discuss local code directly within your chat sessions.
> impact
We've shipped an AI-powered contextual file injection feature for the Claude CLI. By modifying the `claude.sh` script, the container can now parse user input for a special syntax: `@path/to/file`. When detected, the script automatically reads the content of the specified file from the mounted host volume and injects it directly into the prompt before sending it to the Claude API. This creates a seamless bridge between your local file system and your conversation with Claude.
The primary motivation was to eliminate the cumbersome and inefficient workflow of manually copy-pasting code into the terminal. Previously, discussing local files with Claude was a stateless, disjointed experience that required users to constantly switch contexts. This friction limited the tool's utility as a serious development assistant. We saw an opportunity to make the shell context-aware, transforming it into a more intuitive and powerful interface.
This update fundamentally changes the `claude-container` from a simple chat shell into an interactive local code assistant. Developers can now ask for code reviews, generate documentation, or debug issues by simply referencing files on their machine. The impact is a significantly faster and more integrated workflow, allowing Claude to function as a true pair programmer with direct access to your project's context, boosting productivity and making complex coding discussions effortless.
> Try this now
try this
# 1. On your host machine, create a sample Python file.
# This file will be made available to the Claude container.
echo 'def calculate_sum(a, b):
# A simple function to sum two numbers
return a + b' > calculator.py
# 2. Run the claude-container, mounting your current directory
# to the `/app` volume inside the container.
docker run -it --rm -v $(pwd):/app 9oelM/claude-container
# 3. Once inside the Claude CLI, you can reference the local file
# using the new `@` syntax. The path is relative to the container's mount point.
# Let's ask Claude to add documentation to our function.
> Add a comprehensive docstring to the function in this file: @/app/calculator.py
# Expected outcome:
# Claude will receive the full content of `calculator.py` along with your request.
# It will then respond with the refactored Python code, including a detailed
# docstring explaining the function, its parameters, and what it returns.