pub struct ContainerMountSpec {
pub claude_config_host_dir: Option<String>,
pub staged_login_config_dir: Option<String>,
pub workspace_host_dir: Option<String>,
pub memory_host_dir: Option<String>,
pub mcp_config_host_dir: Option<String>,
pub github_hooks_host_dir: Option<String>,
pub aws_config_host_dir: Option<String>,
pub aws_tools_host_dir: Option<String>,
pub limits: ContainerLimits,
}Expand description
Host directories a container agent needs mounted to be able to work.
Both were missing entirely before 2026-09-02, which is why container agents
could never authenticate and always started with an empty /workspace. See
docs/reports/REPORT_CONTAINER_AGENT_CREDENTIALS_AND_WORKSPACE_2026_09_02.md.
Fields§
§claude_config_host_dir: Option<String>The folder holding the container’s own copy of the bound account’s login: its .credentials.json is
bind-mounted into the container, so the CLI there signs in and refreshes from it (see [agent_home_mounts]
for why it is that one file and not the whole dir). It is never the account’s own folder: a container that
holds the account’s own file could empty it for every other container and every host CLI on the account.
Filled by the start of the container from Self::staged_login_config_dir (see keychain_credentials).
None keeps the old behavior (an empty per-agent named volume), which is correct only for an agent with
no bound oauth account.
staged_login_config_dir: Option<String>The bound account’s own resolved Claude config dir on the host: whatever CLAUDE_CONFIG_DIR the identity
resolver produced for this agent, never the operator’s global ~/.claude. The start of the container stages
the account’s login (from its file, or on macOS from the Keychain) as a copy for this container alone, and
fills Self::claude_config_host_dir with the staging folder. None for an agent with no bound account
login, and for one on an API key.
workspace_host_dir: Option<String>The agent’s working directory on the host, bind-mounted at
CONTAINER_WORKSPACE_DIR. None/empty leaves /workspace empty, which
is what shipped before this existed.
memory_host_dir: Option<String>The agent’s Personal Memory folder on the host, bind-mounted where Claude reads memory in the container.
mcp_config_host_dir: Option<String>The folder holding the agent’s MCP config when it lives outside the working directory (#3680):
bind-mounted read-only at CONTAINER_MCP_CONFIG_DIR so no launch writes it into a user’s
project, and a rewrite is visible without recreating the container.
github_hooks_host_dir: Option<String>AgentMux’s git hooks (push scan, commit trailers) on the host, mounted read-only at
crate::identity::github_tokens::CONTAINER_HOOKS_DIR where container agents get git through AgentMux.
aws_config_host_dir: Option<String>The AWS config folder (identity::aws_broker::container) and the tools folder (::tools), both read-only; in the drift check only when set, so not sharing never rebuilds.
aws_tools_host_dir: Option<String>§limits: ContainerLimitsThe agent’s own CPU and memory limits (the app-wide setting and the default fill in what it leaves unset).
Implementations§
Source§impl ContainerMountSpec
impl ContainerMountSpec
Sourcepub fn bound_host_dirs(&self) -> Vec<String>
pub fn bound_host_dirs(&self) -> Vec<String>
The host side of every folder this spec binds into the container, besides the container’s own copy of the login.
Sourcepub fn for_agent(env_vars: &HashMap<String, String>, working_dir: &str) -> Self
pub fn for_agent(env_vars: &HashMap<String, String>, working_dir: &str) -> Self
What an agent started with env_vars in working_dir gets mounted: its bound
account’s credentials, its workspace, and, for an agent with a Claude config dir,
its Personal Memory. A ~/... working dir (what agent.open records for an agent with
none of its own) is expanded here, against the AgentMux home an isolated instance
overrides: Docker takes only an absolute bind source.
Trait Implementations§
Source§impl Clone for ContainerMountSpec
impl Clone for ContainerMountSpec
Source§fn clone(&self) -> ContainerMountSpec
fn clone(&self) -> ContainerMountSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ContainerMountSpec
impl Debug for ContainerMountSpec
Source§impl Default for ContainerMountSpec
impl Default for ContainerMountSpec
Source§fn default() -> ContainerMountSpec
fn default() -> ContainerMountSpec
impl Eq for ContainerMountSpec
Source§impl PartialEq for ContainerMountSpec
impl PartialEq for ContainerMountSpec
impl StructuralPartialEq for ContainerMountSpec
Auto Trait Implementations§
impl Freeze for ContainerMountSpec
impl RefUnwindSafe for ContainerMountSpec
impl Send for ContainerMountSpec
impl Sync for ContainerMountSpec
impl Unpin for ContainerMountSpec
impl UnsafeUnpin for ContainerMountSpec
impl UnwindSafe for ContainerMountSpec
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more