Attachment modes: MCP or CLI
You choose how your agent reaches a mount: through the tools of one MCP server, or through its shell. Both modes read the same files. They differ only in how the agent searches, calls source tools, and saves notes.
Use MCP mode unless your agent has a shell and you want fewer tool schemas in its context.
MCP mode
Section titled “MCP mode”MCP mode is the default. stash attach adds a server named stash to each
harness:
stash attach opsThe agent gets a search tool, a note tool when the mount has [extraction],
and the tools of each MCP or Gateway source. Stash saves each result file that
fits the result and cache limits, while the tool returns a compact view.
See the stash mcp reference for the tools and
their inputs.
CLI mode
Section titled “CLI mode”In CLI mode, Stash adds no MCP server. The agent uses its shell:
ls /tmp/ops-context/cat /tmp/ops-context/_sources/incidents.mdgrep -rl "checkout latency" /tmp/ops-context/agentcore-memory/incidents/stash search ops "checkout latency" --path "/agentcore-memory/incidents/*"stash tool call ops ticketing/get_ticket --input '{"id": "INC-4412"}'jq '.comments | length' /tmp/ops-context/mcp/ticketing/_tools_results/get_ticket/*/content/1.jsonstash note save ops --topic "INC-4412 mitigation plan" < plan.mdAttach with --no-mcp:
stash attach ops --no-mcpThe steering block names the CLI commands and the schema file of each source
tool. See the references for
stash search,
stash tool call, and
stash note save.
Choose a mode
Section titled “Choose a mode”| MCP mode | CLI mode | |
|---|---|---|
| Agent tools | Stash search, notes, and source tools | No Stash tools |
| Agent requirements | A file reader | A shell and a file reader |
| Calls | MCP tool calls | stash commands |
| Good fit | An agent that prefers tools or has no shell | A coding agent with a shell |
Use a mode with a Strands agent
Section titled “Use a mode with a Strands agent”StrandsStash uses MCP mode by default. Turn off its mcp option for CLI
mode, and give the agent a shell.
See Strands Agents for the Python and TypeScript setup.
Switch modes
Section titled “Switch modes”Run attach again for the same mount:
stash attach ops --no-mcpstash attach opsStash updates its steering block and MCP entry. It keeps the rest of each file. Start a new agent session so the harness reads the new steering.
What attach installs
Section titled “What attach installs”Both modes install a generated steering block and harness hooks.
The steering block tells the agent where the mount is and how to use it. Stash
keeps every byte outside its markers. The
stash attach reference lists the steering,
hook, and MCP files for each harness.
The steering also tells the agent to use filters, limits, and queries so each
tool returns only what the task needs.
The hooks warm the mount at session start and capture each completed turn.
They also ask for notes when the mount has [extraction]. The
stash hook reference owns the event behavior,
output, and exit codes.
A Strands agent gets the same steering and session context through
StrandsStash. It does not need harness files.
Note requests
Section titled “Note requests”With [extraction], Claude Code and Codex can ask for a note after a tool
call. Kiro can ask at the end of a turn. The agent can continue when there is
nothing to record.
See The local store for note extraction and
stash hook for the request threshold and
harness output.