You are running inside Codemux, an Agentic Development Environment (ADE).
Detect: test -n "$CODEMUX"
When working on the Codemux repository itself:
- Start with
WORKFLOW.mdanddocs/INDEX.md - Read relevant canonical docs before assuming project state
- Treat
docs/as the maintained project docs system - If docs feel stale, use
docs/reference/DOCS_REINDEX.md
Never use xdg-open, open, or system browsers. Use these instead:
| Command | Description |
|---|---|
codemux browser open <url> |
Navigate the browser pane to a URL |
codemux browser snapshot --dom |
List all interactive elements with CSS selectors |
codemux browser snapshot |
Get the accessibility tree |
codemux browser click "<selector>" |
Click an element by CSS selector |
codemux browser fill "<selector>" "<text>" |
Type into an input field |
codemux browser screenshot |
Capture screenshot (base64 PNG) |
codemux browser console-logs |
Get browser console output |
codemux browser create |
Create a new browser pane |
The user sees the browser pane live while you control it.
Workflow: Always snapshot before interacting.
codemux browser open http://localhost:3000
codemux browser snapshot --dom # See what's on the page
codemux browser click "#submit" # Interact with a known element- Standard git commands work normally
- Changes appear live in the Codemux sidebar Changes panel
- Use conventional commit format (feat:, fix:, docs:, etc.)
- AI commit message generator available in the UI
When you finish a task or need user attention, the user gets notified via Codemux's notification system.
| Command | Description |
|---|---|
codemux memory show |
Show project memory |
codemux memory set --goal "..." |
Set current goal |
codemux memory add decision "..." |
Record a decision |
codemux index build |
Build code search index |
codemux index search "<query>" |
Search indexed code |
Set automatically in all Codemux terminals:
| Variable | Value | Purpose |
|---|---|---|
CODEMUX |
1 |
Detect Codemux environment |
CODEMUX_VERSION |
0.1.0 |
Codemux version |
CODEMUX_WORKSPACE_ID |
workspace ID | Current workspace |
CODEMUX_BROWSER_CMD |
codemux browser |
Browser command prefix |
BROWSER |
codemux browser open |
Standard URL handler override |
Codemux launches Claude Code with:
claude --dangerously-skip-permissions --system-prompt "$CODEMUX_AGENT_CONTEXT" "your task description"--dangerously-skip-permissions— Runs Claude Code in autonomous mode without interactive permission prompts--system-prompt "$CODEMUX_AGENT_CONTEXT"— Injects context telling Claude Code to use Codemux's browser commands instead of system browsers- The final argument is the user's task description from workspace creation
This environment variable is set on all Codemux terminal sessions. It contains instructions for agents about using Codemux's built-in browser commands. The --system-prompt flag references it so Claude Code receives this context at launch.
Users can edit agent presets in Settings > Presets, but should keep the --system-prompt "$CODEMUX_AGENT_CONTEXT" flag for best results.
Codemux registers hooks in ~/.claude/settings.json on startup to track Claude Code's status in real-time. Three events are registered:
UserPromptSubmit— Agent started workingStop— Agent finishedPermissionRequest— Agent needs input
The hooks call ~/.codemux/hooks/notify.sh, which sends an HTTP request to Codemux's local hook server. This powers the agent status indicators (amber/red/green dots in the sidebar and tab bar).
If you see Claude Code settings errors, check ~/.claude/settings.json for Codemux entries under the hooks key. Codemux only modifies the hooks section and preserves all other settings.
The hooks are safe when Codemux isn't running — the notification script checks for required environment variables and silently exits if they're not set.
- Never open system browsers — use
codemux browser - Never launch GUI apps — use Codemux built-in tools
- The user can see everything you do in real-time
- When asked to "test in browser" or "check the website", use
codemux browser open <url> - Get a snapshot before interacting so you know what elements exist
- Use explicit selectors — don't guess element presence
- Never write website/marketing documentation in this repo — the public docs site (https://docs.codemux.org) lives in
~/projects/codemux-sitev2/(Next.js + Fumadocs). New or updated doc pages go incontent/docs/of that repo as.mdxfiles.
codemux --help # List all subcommands
codemux browser --help # Browser subcommands
codemux capabilities # JSON listing of all commandsAll commands are also available via the Unix socket API at $XDG_RUNTIME_DIR/codemux.sock.