claude
Launch Claude Code with Era-managed settings.
era-code claude is the Claude Code counterpart to era-code start. It runs the same provisioning pipeline — project validation, MCP selection and credentials, directives build, auth enforcement, observability forwarding — and then spawns claude instead of opencode.
Usage
era-code claude [options]
era-code claude [options] -- <claude args>
Options
| Option | Description |
|---|---|
-m, --model <model> | Model to use (an anthropic/ prefix is stripped automatically, so OpenCode-style model ids work) |
-p, --persona <name> | Era persona to load via Claude Code's --append-system-prompt |
--yolo | Disable permission prompts — appends --dangerously-skip-permissions (equivalent to Happy's --yolo). Composes with --model/--persona; skipped if an equivalent flag is already passed after -- |
-q, --quiet | Suppress output |
-- <args> | Pass everything after -- directly to claude (e.g. -- --resume) |
[!WARNING]
--yoloruns every tool call — bash, file writes, network — without confirmation. Only use it in a directory you trust, and never pair it with an unsandboxed remote-control wrapper (seeERA_CODE_CLAUDE_BINbelow) unless you have configured a filesystem/network sandbox.
[!NOTE] When passthrough args are given, they take full control of the
claudeinvocation:--modeland--personaare not appended (a--personatypo still errors with the available list).
Examples
Launch with defaults
era-code claude
Use a specific model
era-code claude --model claude-sonnet-4-20250514
# OpenCode-style ids also work — the prefix is stripped
era-code claude --model anthropic/claude-sonnet-4-20250514
Load an Era persona
era-code claude --persona cli-templates
Both cli-templates and persona-cli-templates are accepted. The persona's agent body (from ~/.era/era-code/claude/agents/persona-<name>.md, frontmatter stripped) is injected via --append-system-prompt. A typo errors with the list of installed personas.
If the project's git remote matches a registered Era persona, the launcher prints a tip with the exact --persona flag to use — personas are opt-in for Claude Code, never auto-injected.
Resume a previous session
era-code claude -- --resume
What It Does
- Checks initialization - If Era is not initialized, offers to run
era-code initfirst - Syncs configuration - Updates
CLAUDE.md,.claude/symlinks,.claude/settings.json, and.mcp.json(see the Claude Code guide) - Resolves MCP servers - Reads your selections from the manifest; token-auth servers with no stored credential are disabled with a one-line warning instead of failing on connect
- Builds directives - Compiles your directive files into
DIRECTIVES.md - Checks for upgrades - Offers to upgrade era-code (skipped in quiet mode)
- Enforces auth - Era and Tools authentication, MCP credential env
- Forwards observability - Starts a background Loki port-forward for the active environment and sets observability env vars
- Launches Claude Code - Spawns
claudein the project directory
[!NOTE] Unlike
era-code start, no Meridian proxy is involved — Claude Code authenticates with Claude Max natively.
If the launch binary is not installed, the command prints install instructions and exits.
Launch binary
By default era-code claude spawns claude. Set ERA_CODE_CLAUDE_BIN to launch through a wrapper that itself spawns claude — Era runs its full provisioning first, then passes --model, the persona system prompt, --dangerously-skip-permissions, and any -- passthrough args straight through to the wrapper.
The intended use is Happy ("Claude Code On the Go"), which adds mobile/remote control:
# Provision Era config, then launch Happy with mobile control + no permission prompts
ERA_CODE_CLAUDE_BIN=happy era-code claude --yolo --persona cli-templates
Happy passes through all claude flags, so --model/--persona/--dangerously-skip-permissions work unchanged. Happy's own --yolo sugar maps to the same --dangerously-skip-permissions, so a single --yolo on era-code claude covers either binary.
[!WARNING] Happy's OS-level sandbox is opt-in and off until you run
happy sandbox configure. Even once configured its filesystem read access is deny-list only — your whole file store stays readable unless you adddenyReadpaths (~/.ssh, cloud credentials,.env). Configure the sandbox before pairingERA_CODE_CLAUDE_BIN=happywith--yolo.
Environment
The claude command sets:
ERA_CODE_MANAGED=1- Indicates Era is managing the sessionERA_CODE_AGENT_URL- Era platform agent URL from settings- MCP credentials (e.g.
NOTION_TOKEN,LINEAR_API_KEY,SLACK_USER_TOKEN) from~/.config/era-code/credentials.json - Observability defaults for the active environment (
GCLOUD_PROJECT,LOKI_URL,KUBE_NAMESPACESorERA_ENVIRONMENTS) CLOUDSDK_CORE_PROJECTwhen the active environment declares a GCP projectERA_DECISION_API_URL(defaults tohttp://localhost:8787unless already set) andERA_TOOLS_AUTH_TOKENfor tools.era.computer services
Hook Subcommands (internal)
Era wires Claude Code's hook system to a hidden era-code hook <type> command in .claude/settings.json. You never run these by hand — Claude Code invokes them, passing the hook payload on stdin.
| Hook | Claude Code event | What it does |
|---|---|---|
era-code hook governance | PreToolUse (matcher: Bash, 10s timeout) | Evaluates the Bash command against Era governance rules and emits a structured permission deny when a rule matches |
era-code hook session-start | SessionStart | Quietly recompiles project directives so every session starts with a fresh .era/memory/DIRECTIVES.md |
The governance hook runs the same rule engine as the OpenCode era-governance plugin: hardcoded safety denials (privilege escalation, system destruction, secret extraction, private keys) plus default deny rules for kubectl/helm/gcloud/docker/gh/git, overridable via the .era/governance.yaml hierarchy. Compound commands (&&, ||, ;, |, $(...), backticks) are tokenized and every segment is evaluated, so anchored rules cannot be bypassed.
[!IMPORTANT] Hooks fail open and always exit 0. Unparseable input, non-Bash tools, or a crash inside the hook never block the session — a broken hook must never brick Claude Code.
See the Claude Code guide for the full harness comparison and setup details.