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

# Claude Code examples

> Use Claude Code with Yelu for repository exploration, implementation, review, automation, and reusable project instructions.

These examples assume Claude Code is connected to Yelu as described in the [Claude Code setup guide](/en/guides/claude-code). Run commands from the repository root so Claude Code receives the right project context.

## Confirm the active gateway

```bash macOS / Windows / WSL theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude --version
claude doctor
claude --model claude-sonnet-4-6
```

Inside the session, run `/status`. Confirm that the base URL is `https://api.yelu.ai` before sharing repository context.

## Explore without editing

Plan mode lets Claude inspect the repository and propose work without immediately modifying files:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude --model claude-sonnet-4-6 --permission-mode plan \
  "Map this repository. Explain the runtime entry points, data flow, test strategy, and the three highest-risk areas. Cite file paths for every conclusion."
```

Use this first when joining an unfamiliar codebase or scoping a migration.

## Implement a focused change

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude --model claude-sonnet-4-6 \
  "Add request timeouts to the outbound API client. Preserve the public interface, add tests for timeout and cancellation behavior, run the relevant test suite, and summarize every changed file."
```

Claude Code asks for permission when a command exceeds the active permission policy. Review commands and diffs before approving them.

## Review uncommitted changes

Pipe the diff into a non-interactive review. The command works in macOS, PowerShell, Git Bash, and WSL when `git` and `claude` are on `PATH`:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
git diff --no-ext-diff | claude -p \
  "Review this diff for correctness, security, regressions, and missing tests. Return findings ordered by severity with file and line references. Do not rewrite the code."
```

## Produce machine-readable output

Use print mode for scripts and CI:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude -p --model claude-sonnet-4-6 --output-format json \
  "Inspect the repository and return a concise release-readiness assessment with blockers, warnings, and passed checks."
```

Treat model output as untrusted input even when the command returns JSON. Validate required fields before another tool consumes it.

## Continue a session

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude --continue
```

To select an older conversation instead, use:

```bash Terminal theme={"theme":{"light":"github-light","dark":"github-dark"}}
claude --resume
```

## Add project instructions

Create a reviewed `CLAUDE.md` in the repository root when the team wants consistent behavior:

```markdown CLAUDE.md theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Project instructions

## Commands
- Install dependencies: `npm ci`
- Run unit tests: `npm test`
- Run lint: `npm run lint`
- Run type checks: `npm run typecheck`

## Change policy
- Keep public APIs backward compatible unless the task explicitly changes the contract.
- Add or update tests for every behavior change.
- Never edit generated files or commit secrets.
- Ask before adding a production dependency or changing database schema.
- Run the smallest relevant checks first, then the full suite before completion.
```

Project instructions are code: review them, keep them specific, and update them when commands or architecture change.

## Windows notes

* In native PowerShell, launch Claude from the terminal where `ANTHROPIC_AUTH_TOKEN` is set.
* In WSL 2, run Claude and Git inside WSL and keep the repository in the Linux filesystem.
* If shell commands behave differently across systems, tell Claude which shell and runtime the project supports.

<Warning>
  Never approve destructive commands, credential access, deployments, or production data changes solely because the model requested them. Verify scope, target, and rollback first.
</Warning>
