Agentic-brownfield-coding bashless
git clone https://github.com/ralfstrobel/agentic-brownfield-coding
T=$(mktemp -d) && git clone --depth=1 https://github.com/ralfstrobel/agentic-brownfield-coding "$T" && mkdir -p ~/.claude/skills && cp -r "$T/claude-plugins/abc-init/skills/bashless" ~/.claude/skills/ralfstrobel-agentic-brownfield-coding-bashless && rm -rf "$T"
claude-plugins/abc-init/skills/bashless/SKILL.mdClaude Code Bashless Setup
Your goal is to amend an existing Claude Code project setup so that the agent no longer uses the built-in
Bash tool. Instead, all essential CLI capabilities are exposed as structured MCP tools
via a local MCP stdio server. This forces the agent to use purpose-built tools with explicit parameters
rather than being attracted to unstructured shell access.
Additional user arguments: $ARGUMENTS
Language hint: Always create all generated script content and comments in English, while continuing to speak to the user in the language of their choice.
Workflow
- Begin execution by creating a formal task list for progress tracking using the
tool. Create a task for each of the following phases (##) and sub-phases (###). Do not duplicate the contents in the description, only reference this skill (TaskCreate
) and the workflow item.abc-init:bashless - Create a dependency chain between all tasks using
, settingTaskUpdate
to the predecessor task.addBlockedBy - Work through the
usingTaskList
to mark tasks as in_progress and completed as you go.TaskUpdate
Phase 1: Reconnaissance
Catalogue shell commands and MCP tools the agent will require during autonomous code development for this project. Assume the project has already been initialized with artifacts for Claude Code and existing technology is documented.
1a — Shell Commands
Spawn an
Agentof type Plan to scan the following locations for explicit and implicit references to CLI commands:
- The project's
and any sub-directoryCLAUDE.md
filesCLAUDE.md - The project's
directory, particularly sub-directories.claude
,commands/
andrules/agents/ - Top-level documentation files (e.g.
,README.md
,CONTRIBUTING.md
)docs/
Pay special attention to the following aspects:
- Execution wrappers — How commands are executed in general: directly, via Docker, NPX, Makefile, etc.
- Test runners — How are automated tests executed (e.g.
,pytest
,jest
,siesta
,phpunit
)go test - Linters/formatters — How is code quality ensured (e.g.
,eslint
,ruff
)phpcs - Build tools — Are builds executed manually and if so how (e.g.
,make
,npm run build
)cargo build - Framework CLIs — Project-specific console commands (e.g.
,artisan
,manage.py
,nx
/laravel
)symfony
Use
TaskCreate and TaskUpdate to add additional blocking tasks for files that need to be updated in Phase 3c below.
1b — MCP Tools
Spawn an
Agentof type general-purpose to summarize available MCP tools:
- Read
at the project root (if it exists) to identify existing project-registered servers..mcp.json - Use the
tool to query: "+mcp__" with high max_results to fetch schemas for all available MCP tools.ToolSearch - Return a full tool list, grouped by server (name pattern "mcp__<server>__"), with very short description per tool.
- Highlight tools suitable for codebase exploration (e.g. IDE search tools, Code Index, symbol/semantic search).
- Highlight tools that can read or edit files and could make the agent ignore the native
/Read
/Write
tools.Edit
Phase 2: User Interview
Use
AskUserQuestion during the following interview process to keep the conversation structured.
Offer pre-defined choice options where possible based on reconnaissance findings.
2a — Git Write Permissions
Ask the user to which degree the agent should be able to participate in Git code submission:
- Read-only — The user reviews all code changes in the IDE and makes commits manually.
The agent only receives tools to explore and modify the current working tree
(
,git_status
,git_diff
,git_rm
).git_mv - Commit — The user reviews and amends finished commits by the agent and pushes them manually.
The agent receives read tools plus
.git_commit - Full — The agent can interact with git fully autonomously.
All of the above plus
,git_branch
andgit_checkout
. If chosen, ask the user a follow-up question whether push to certain branches should be prohibited.git_push
2b — CLI Tool Selection
Present the proposed list of project CLI tools to the user. For each tool, show:
- CLI application name
- Example command
- Proposed MCP tool name (e.g.
,git_log
) and parametersnpm_test
Detect or ask the user whether a sandboxed execution wrapper is available on the system (e.g.
bubblewrap on Linux, sandbox-exec on macOS).
- If sandboxing is available, suggest adding available read-only filesystem utilities (
,diff
).jq - If sandboxing is unavailable but the user has explicitly requested such tools, warn against the resulting security risks and offer to help with the installation of a respective sandboxing tool. If the user explicitly insists on proceeding with an unsandboxed setup, note this for Phase 3a and the debriefing.
Ask the user to:
- Confirm, remove, or add tools
- Suggest additional project-specific commands not detected automatically
2c — Codebase Exploration Tools
Determine whether you have access to MCP tools for codebase exploration (from reconnaissance phase 1b).
- If such tools exist: Ask the user whether they also wish to disable the native
andGlob
built-in tools, since the MCP alternatives may be superior in efficiency and speed.Grep - If no such tools exist: Inform the user that
andGlob
will remain enabled as they are essential for codebase navigation withoutGrep
.Bash
2d — MCP Tool Pruning
Explain to the user that many MCP servers expose a large number of tools indiscriminately, so disabling undesired and unnecessary tools helps the agent make better tool call decisions.
For each MCP server identified during reconnaissance phase 1b with more than ~5 tools:
- Present a table of available tools with their short descriptions, grouped by server.
- Ask the user to identify the tools they actively want to keep — or alternatively, tools they want to remove.
Recommendations:
- Advise to keep search/find tools (especially indexed/semantic/structural/symbolic search).
- Advise against redundant tools (overlapping functions) that make tool-choice less obvious.
- Warn about tools that can execute external actions such as IDE run configurations.
Important: Always recommend deactivation of tools that can read or edit/refactor files! These tools can tempt the agent to ignore native
Read/Write/Edit tools
which are important for the enforcement of rules, hooks and permission checks.
2e — Sandbox Configuration
Check whether the current
.claude/settings.json contains a sandbox configuration block.
- If it does: Explain that the sandbox only restricts the
tool and has no effect whenBash
is disabled. Ask the user whether the sandbox block should be removed to reduce configuration noise.Bash - If it does not: Skip this question.
Phase 3: Generate Artifacts
3a — CLI MCP Server
- Copy the template to
and make it executable (<project-dir>/.claude/mcp/bash-commands.sh
).chmod +x - Adjust the command execution wrappers to match the project's execution environment.
- Uncomment and adapt the
wrapper based on the target operating system, independent of whether a sandboxing tool is actually installed, ensuring the function is available.run_local_sandboxed- Use
for all tools that locally execute arbitrary code or filesystem operations.run_local_sandboxed - Only fall back to
(unsandboxed) if the user explicitly insisted on doing so in phase 2b. Document this decision with an inline comment.run_local
- Use
- The template already contains working implementations of the git read tools.
Based on the git permission level chosen in Phase 2a, uncomment the corresponding write tools:
- Commit: Uncomment
andgit_add
in both the tool definitions and the handler.git_commit - Full: Also uncomment
.git_push
- Commit: Uncomment
- Replace
with JSON tool entries for the project-specific CLI tools confirmed in Phase 2b. Use the commented project tool example in the template as a guide.{{TOOL-DEFINITIONS}} - Replace
with matching case branches for each project-specific tool added in step 5.{{TOOL-HANDLERS}} - Create or update
at the project root, registering the server:.mcp.json
If{ "mcpServers": { "bash": { "type": "stdio", "command": ".claude/mcp/bash-commands.sh" } } }
already exists, merge the new entry without removing existing servers..mcp.json
3b — Ensure Git Index Coverage for Created Files
Inspect the
.claude/hooks/ directory (and the hooks section in .claude/settings.json) for any
PostToolUse hook that matches the Write tool and automatically runs git add.
If such a mechanism already exists, skip the rest of this step.
- Explain to the user that our structured git tools cannot work on untracked files.
Therefore, it must be ensured that
is called automatically whenever new files are created.git add - Use
to offer the following options or accept other user instructions:AskUserQuestion- Amend existing hook — For each
hook script that exists and already handlesPostToolUse
events.Write - Create minimal hook — Create a new hook script
,.claude/hooks/post-write.sh
- Amend existing hook — For each
- Write the missing logic to the chosen script, using the template as inspiration.
- Register a new hook script as a
with matcherPostToolUse
and make the script executable.Write
3c — Update Agent Instructions
Review all
CLAUDE.md and .claude/ files catalogued in Phase 1 for references to CLI commands.
For each file that mentions specific shell commands:
- Replace references to bare shell commands with references to the corresponding MCP tool names,
e.g. "use the
tool" instead of "runmcp__bash__pytest
".pytest - Where rules reference the
tool by name, remove or rephrase those references.Bash
3d — Update Settings
Modify
.claude/settings.json to disable the Bash tool (and optionally Glob/Grep) and prune MCP tools:
- Ensure
is present in the settings."enableAllProjectMcpServers": true - Add
to the"mcp__bash__*"
array (create it if it does not exist).permissions.allow - Add
to the"Bash"
array (create it if it does not exist).permissions.deny - If the user chose to disable
andGlob
in Phase 2c, also addGrep
and"Glob"
to"Grep"
.permissions.deny - Add every MCP tool the user explicitly or implicitly chose to remove in Phase 2d to
. Use the wildcard pattern only if the user wants to exclude all tools from a server (e.g.permissions.deny
)."mcp__<server>__*"- Wildcard entries can only remove entire servers, pattern matching inside tool names is not supported.
- Deny entries always win over allow entries, so excluding an entire server but allowing individual tools is not possible.
- Add every MCP server as
to"mcp__<server>__*"
if it has a corresponding tool deny list.permissions.allow - If the user chose to remove the sandbox block in Phase 2e, delete the entire
key.sandbox - If a
orPreToolUse
hook referencesPostToolUse
in its matcher, notify the user that this is now obsolete.Bash
Phase 4: Debriefing & Disclaimers
- Present a summary table of everything created or modified (file path, change type, purpose).
- Explain that this is a restrictive configuration change. Specifically:
- MCP Tool Coverage: The generated server only wraps the tools identified during the interview. If the agent needs additional CLI capabilities later, developers must add new tool definitions and handlers to the MCP server script. Look out for agent complaints or hallucinations due to missing tools.
- Git Tools: The git tools provide basic access. Complex git workflows (interactive rebase, etc.) still require human intervention.
- MCP Tool Security: Unlike the
sandbox, the MCP server executes commands without any external containment. Each tool added to it represents an explicitly granted capability — developers are responsible for ensuring that no tool indirectly grants access beyond the project context. For example,Bash
is preferred overgit rm
not only because it stages changes transparently, but also because it is bounded by the git index and cannot reach outside the repository. Be particularly cautious with tools that invoke Docker or other container runtimes, as these can expose host filesystem mounts and network interfaces to the agent.rm - Glob/Grep: If these were disabled, ensure the alternative MCP exploration tools adequately cover the agent's search needs. Monitor whether the agent struggles to navigate the codebase.
- MCP Tool Pruning: The denied tools are completely hidden from the agent.
If the agent later seems unable to perform an expected task, check whether a required tool was accidentally denied.
The deny list can be refined in
for individual developers without affecting the shared config.settings.local.json - Hooks: Promote the idea that hooks can also be used to integrate CLI command execution into agentic workflows and should be preferred when possible, as this is more reliable than agent tool calls.
- Restart Required: New tools and hooks are only picked up after restarting Claude Code.