Skip to main content

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

OptionDescription
-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
--yoloDisable 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, --quietSuppress output
-- <args>Pass everything after -- directly to claude (e.g. -- --resume)

[!WARNING] --yolo runs 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 (see ERA_CODE_CLAUDE_BIN below) unless you have configured a filesystem/network sandbox.

[!NOTE] When passthrough args are given, they take full control of the claude invocation: --model and --persona are not appended (a --persona typo 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

  1. Checks initialization - If Era is not initialized, offers to run era-code init first
  2. Syncs configuration - Updates CLAUDE.md, .claude/ symlinks, .claude/settings.json, and .mcp.json (see the Claude Code guide)
  3. 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
  4. Builds directives - Compiles your directive files into DIRECTIVES.md
  5. Checks for upgrades - Offers to upgrade era-code (skipped in quiet mode)
  6. Enforces auth - Era and Tools authentication, MCP credential env
  7. Forwards observability - Starts a background Loki port-forward for the active environment and sets observability env vars
  8. Launches Claude Code - Spawns claude in 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 add denyRead paths (~/.ssh, cloud credentials, .env). Configure the sandbox before pairing ERA_CODE_CLAUDE_BIN=happy with --yolo.

Environment

The claude command sets:

  • ERA_CODE_MANAGED=1 - Indicates Era is managing the session
  • ERA_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_NAMESPACES or ERA_ENVIRONMENTS)
  • CLOUDSDK_CORE_PROJECT when the active environment declares a GCP project
  • ERA_DECISION_API_URL (defaults to http://localhost:8787 unless already set) and ERA_TOOLS_AUTH_TOKEN for 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.

HookClaude Code eventWhat it does
era-code hook governancePreToolUse (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-startSessionStartQuietly 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.