> ## Documentation Index
> Fetch the complete documentation index at: https://docs.envlink.projectinwork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Let Claude Code lease, build in and clean up envlink environments, interactively or headless with only envctl allowed.

With the [skill installed](/agents/setup), Claude Code uses envctl when a task calls for it. Two more things help.

## Allow envctl without prompting

Add envctl to the project's allowed commands in `.claude/settings.json`, so Claude doesn't stop to ask before each lease or build:

```json .claude/settings.json theme={null}
{
  "permissions": {
    "allow": ["Bash(envctl:*)"]
  }
}
```

## Run it headless

For a scripted run, a scheduled job or CI, use `claude -p` and allow only envctl and read-only tools:

```bash theme={null}
claude -p "Run the tests in ./billing on an envlink build box and summarise any failures. Delete the box when done." \
  --allowedTools "Bash(envctl:*)" "Read" "Grep" "Glob" \
  --output-format stream-json --verbose
```

In the live demo's recording, Claude Code did this unaided: it leased a box, built a Go app, read the report it produced and deleted its lease in 94 seconds.

## Without the skill

A few lines in `CLAUDE.md` work too:

```markdown CLAUDE.md theme={null}
This machine is connected to envlink. Run builds and tests remotely, not locally:
- `envctl env create linux-build --share src=. --label task=<id>` leases a build box and prints its name.
- `envctl exec <name> -- sh -c 'cd /work && <command>'` runs a command there; the exit code is the remote one.
- Results written to /work/out come back in `.remote/<name>/out/`.
- `envctl env delete <name>` releases it when you're done.
Never read or send anything under secrets/ or any .env file.
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.