coding.sh init
Set up capture hooks and the MCP server for every detected agent. Every option of coding.sh init, from its own --help.
coding.sh init [options]
Set up capture hooks and the MCP server for every detected agent
Options
-a, --agent <AGENT> Only this agent (repeatable, or a comma list: a,b)
--scope <SCOPE> Install into user or project config (default: user)
--mcp Register the coding.sh MCP server too (--no-mcp to skip) (default: true)
--import Import each agent's past sessions so the viewer opens on your history (--no-import to skip) (default: true)
--proxy Also route Claude Code and Codex model calls through the local proxy, and start it
--force Install hooks even when the agent already has coding.sh hooks in the other scope; with --proxy, replace a base URL or provider you set instead of chaining through it
-y, --yes Answer yes to confirmation prompts. An agent passes it only once the user approves
--dry-run Print the plan (agents, files, blockers) without writing anything
--diff With --dry-run, also print the full diff of every planned edit
--remote <URL> Also send new sessions to a team's coding.sh serve at this URL (an http sink named team)
--key <KEY> With --remote, the server's ingest key, csh_ik_… (also CODING_SH_INGEST_KEY)
--remote-mode <MODE> With --remote: metadata sends no prompts, code or tool output; full sends them (default: metadata)
Examples
coding.sh init
coding.sh init --agent claude-code --yes
coding.sh init --no-import
Notes
Copies the hook to ~/.coding.sh/bin (hook.sh, and hook.mjs for what it hands on) and points each agent at it: /bin/sh hook.sh outside Windows, node hook.mjs on Windows. Run init again to move hooks from an older version to hook.sh.
Then imports the sessions each agent already keeps on this machine, for up to 8 seconds (CODING_SH_INIT_IMPORT_BUDGET_MS changes it). The rest imports in the background and shows up in the viewer as it lands. Running init again reads only new or changed transcripts.
--remote checks that the server takes the key before writing anything, then adds the sink to ~/.coding.sh/config.toml (mode 600). Run it again to change the URL, key or mode.
Registers the MCP server with Claude Code, Codex, Cursor, OpenCode and Gemini CLI (user scope only).
--proxy sets ANTHROPIC_BASE_URL in Claude Code's settings.json and a coding-sh model provider in Codex's config.toml. A base URL the agent already used (a gateway, CLIProxyAPI, your own Codex provider) becomes the proxy's upstream instead of being replaced. The hook restarts a stopped proxy when a session starts.
Every edited file is backed up to ~/.coding.sh/backups first; uninstall reverts it.