[Feature][Design proposal] `/ask` command like in Aider via adding to settings.json += "read-only" VS "writable" commands
Feature request
Please add /ask command like in Aider, that allows to Ask AI things without it altering system.
Design proposal
Integrating this idea with Agentic nature of Claude Code may require adding new feature: ability to define which commands are allowed to run in "readonly" "immutable" mode.
As "claude code" is tool giving ability power users to configure it to their needs, it should be flexible design allowing them to configure/customize claude code accordingly.
While keeping backwards compatibility with settings.json => .permissions.{allow,deny},
I propose to add to settings.json .permissions.allow-readonly or .permissions.allow-immutable ,
therefore allowing users to define which commands in their opinion are not altering state of system, allowing "readonly /ask" queries to run.
Appendix
Below generated more info that maybe helpful if you would be processing this issue e.g. together with Claude Code
References from Aider Implementation
This feature request is inspired by aider's /ask command, which has proven to be a valuable tool for code exploration without modification. Here are key references from the aider repository:
Core Implementation
- Ask mode implementation:
aider/coders/ask_coder.py- Simple class that extends base Coder with ask-specific behavior - System prompts:
aider/coders/ask_prompts.py- Instructs AI to "Act as an expert code analyst" and explicitly prevents file modifications - Command documentation:
aider/website/docs/usage/commands.md:26- Official documentation of the/askcommand
Key Design Principles from Aider
- Guaranteed non-destructive: Ask mode never modifies files, providing a safe space for code exploration
- Dual usage pattern:
/ask <question>- Single question in ask mode, then return to previous mode/ask- Switch to ask mode permanently (until mode change)
- Context preservation: Conversations in ask mode carry over when switching to code mode
- Workflow integration: Designed to work seamlessly with
/codecommand for discuss-then-implement workflow
Usage Patterns (from aider/website/docs/usage/modes.md:52-66)
- Users discuss implementation approaches in ask mode
- Once consensus is reached, switch to code mode (e.g.
/codeor/edit) - All context from ask mode discussion informs the code changes
Evolution of the Feature
- Initial implementation: Commit 3a1fc35f - Added
/askand/chat-modecommands - Mode switching enhancement: Commit 1a84c109 - Allow
/askwithout arguments to switch modes - Autocompletion support: Commit 4e03f416 - Added tab completion for
/ask,/code, and/architect - Output optimization: Version 0.83.0 - Improved ask mode to elide unchanging code in responses
Similar Features in Aider
/read-onlycommand - Add files for reference only / mark which files are to be read-only, preventing modifications/chat-modecommand - General mode switching capability- Multiple chat modes:
code,ask,architect,help- Each with specific permissions and behaviors
Why This Matters for Claude Code
The success of aider's /ask command demonstrates the value of having a dedicated read-only exploration mode. With Claude Code's agent-based architecture and powerful tool system, implementing a similar feature with configurable read-only permissions would provide:
- Safety: Users can explore and understand code without risk of unintended modifications
- Flexibility: Power users can configure which tools are available in read-only mode
- Workflow efficiency: Natural progression from exploration to implementation, similar to aider's ask/code workflow
The proposed .permissions.allow-readonly configuration would align well with Claude Code's existing permission system while adding this valuable capability.