Skip to main content

Module startup_files

Module startup_files 

Source
Expand description

The files a Claude Code session reads by itself at startup, listed for the “Given to the agent” card (SPEC_LAUNCH_CONTEXT_WORKSPACE_RULE_AND_STARTUP_FILES_2026_09_30.md §4, phase LC2). Before this the card showed only what the SessionStart hook carried, while the CLI had also loaded the user’s CLAUDE.md, every CLAUDE.md up the folder tree (the hand-maintained ~/.agentmux/agents/CLAUDE.md among them), their @imports, the skill listing and the MCP servers.

This mirrors Claude Code’s documented loading rules: it is what the CLI should have read, not proof that it did.

Structs§

StartupFile
One startup item.

Enums§

Owner
Who writes a file: AgentMux, the user (a file in the agent’s own workspace that AgentMux doesn’t manage), or someone else (outside the workspace and not written by AgentMux, e.g. the hand-maintained shared agents/CLAUDE.md).

Functions§

claude_startup_files
Claude’s startup files for a session in cwd, in the order the CLI loads them: the user’s CLAUDE.md (in config_dir, else ~/.claude), then each folder from the filesystem root down to cwd (its CLAUDE.md, .claude/CLAUDE.md, CLAUDE.local.md), each file followed by what it imports; then the skill listing and the MCP servers of cwd.
claude_startup_files_with_ancestors
host_startup_files
claude_startup_files for a host agent. In a folder a container agent can write (mcp_folder_rule), the CLI is started with AgentMux’s own MCP config and not the folder’s .mcp.json, so the servers listed are that config’s.
workspace_startup_files
The startup files of a container agent’s workspace, which the container can write: only files that resolve (symlinks and @ imports followed) to somewhere inside the workspace are read, so nothing it plants there makes srv read another path on the host.