Skip to main content

Local Agents — Claude Code & Codex

FleetQ can run agents on the Claude Code and Codex command-line tools instead of a cloud LLM API. The CLIs are detected on the host machine (or through the bridge) and runs cost zero credits. This page explains what a local agent is allowed to do and how to fix the most common errors.

How Claude Code is controlled

When FleetQ starts Claude Code directly on its own host, the run starts with --permission-mode dontAsk and a per-run --settings allow/deny list. In dontAsk mode, Claude Code refuses every tool call that is not explicitly allowed, so this list is the agent's whole toolbox:

  • Read, Glob and Grep are always allowed.
  • Edit and Write are allowed only inside the run's working directory.
  • Bash is allowed unless the agent's shell access is turned off (allow_shell = false). There is no switch for this in the agent form yet; set it through the REST API with PUT /api/v1/agents/{id} and {"config": {"allow_shell": false}}.
  • Bash(sudo:*) is always denied.
  • MCP servers attached to the run are allowed as mcp__<server>, unless the tool is on the agent's deny list — then it is denied.
  • Lasting per-agent grants (see below) are merged in.
Example --settings payload
{
  "permissions": {
    "allow": [
      "Read", "Glob", "Grep", "Bash",
      "Edit(//path/to/workdir/**)",
      "Write(//path/to/workdir/**)",
      "mcp__github"
    ],
    "deny": [
      "Bash(sudo:*)",
      "mcp__slack"
    ]
  }
}
This allow/deny list and the approvals below apply only to Claude Code running directly on the FleetQ host. Runs that go through the bridge do not receive this list: they follow the Claude Code CLI settings on the bridge machine, so restrict tools there. The hosted VPS runner, available to super-admins only, is also a separate path and is not covered by this list.

Approvals for refused tool calls

When Claude Code, run directly on the FleetQ host, refuses a tool call because it is not on the allow list, FleetQ turns the refusal into a pending approval request (target type claude_code_permission). At most 10 requests are created per run. The request holds only the permission rule and the tool name — never the raw command or tool arguments.

Approving a request saves a lasting allow rule in the agent's claude_code_permissions, so the next run may use that tool. An allow rule never lifts sudo, a deny rule, a denied MCP server or allow_shell = false. See Approvals & Human Tasks.

Shell command rules (Allow / Ask / Block)

Each agent can have a list of shell command rules, one per line, in the form allow|ask|block: command prefix. The longest matching prefix wins, chained commands (&&, ;, |) are checked part by part, and the strictest result counts: Block, then Ask, then Allow.

An agent without its own rules gets these defaults:

  • ask: git push
  • ask: rm -rf
  • block: sudo
Command rules are saved and validated, but they are not yet enforced in any run (Claude Code or Codex). Today, turn shell access off with allow_shell = false and use the permission list above to limit what a Claude Code agent can run.

Codex

Codex agents run as codex exec --json --full-auto under Codex's own sandbox. The Claude Code allow/deny lists and the approvals for refused tool calls described above do not apply to Codex runs.

Troubleshooting

Claude Code rejected the selected model

The run fails with an error like Local agent 'Claude Code' cannot use the model '...': Claude Code says it does not exist or this account has no access to it. Older CLI versions may instead exit with Local agent 'Claude Code' failed (exit code N): ... and output that mentions the model. Either way, the installed claude CLI, or the account it is signed in with, does not accept the model set on the agent.

To fix it, open the agent, click the Edit Agent (pencil) button, set Provider to Claude Code (Local) and pick one of these models:

  • claude-sonnet-4-5 — Claude Sonnet 4.5
  • claude-opus-4-6 — Claude Opus 4.6
  • claude-haiku-4-5 — Claude Haiku 4.5
  • sonnet — Claude Sonnet (latest)
  • opus — Claude Opus (latest)
  • haiku — Claude Haiku (latest)

Aliases such as sonnet, opus and haiku follow the latest model available to the installed CLI. If a model is still rejected, update the claude CLI on the host and check that its account has access to that model.

Next step

Start from a ready-made agent template, then run it on FleetQ Cloud or your own server.