59API

← Voltar aos guias

Configure Claude Code for a Monorepo Without the Noise

Claude Code · EN · 2026-10-30

Configuring Claude Code for a large monorepo starts with making the repository understandable: where a change belongs, which rules apply, and how to verify it. This walkthrough uses a pnpm workspace with apps/web, apps/api, and packages/ui. The web app uses Vitest and depends on the shared UI package. Adapt the paths and commands to your repository.

1. Establish a working baseline

Create a branch and check the working tree before starting Claude Code. Run git status --short, then the relevant existing checks. For a web task, try pnpm --filter @acme/web typecheck and pnpm --filter @acme/web exec vitest run. Record existing failures so the assistant can distinguish them from regressions.

Check package names in package.json; pnpm filters use those names. Identify generated directories, the lockfile policy, and any required code generation. These details prevent a small feature from becoming an accidental repository cleanup.

2. Connect Claude Code to 59API

59API offers inexpensive, pay-as-you-go access compatible with Claude Code, making it useful for repeated investigation and test cycles. It provides native official-quality models without model downgrades. Claude Sonnet 5.5 is one concrete option to evaluate against your team's coding tasks.

In a local shell, set export ANTHROPIC_BASE_URL=https://api.59api.com and export ANTHROPIC_AUTH_TOKEN="$FIFTYNINE_API_KEY", where FIFTYNINE_API_KEY already contains your 59API key. Keep credentials outside the repository. Check for competing authentication settings if requests use the wrong account.

Use the exact model identifier supplied by 59API when selecting a model; a display name is not necessarily an API identifier. Start Claude Code with claude from the repository root and confirm that a small request succeeds before beginning a substantial task.

3. Write a short root CLAUDE.md

Create CLAUDE.md at the repository root. Treat it as an operating guide: describe the package boundaries and provide commands the assistant can execute. Include these facts:

Keep long architectural references in separate documents and point to them. A concise guide is easier to maintain and leaves more context available for the actual work.

4. Put package rules beside the code

Add apps/web/CLAUDE.md for frontend conventions and packages/ui/CLAUDE.md for component requirements. Claude Code discovers instructions by directory scope, with nested instructions loading as it reads files in those areas. Put repository-wide rules at the root and local details near their owners.

For example, the UI guide might require accessible names for interactive controls and tests for keyboard behavior. The web guide might identify the routing directory and the approved API client. Avoid copying the root instructions into every package: duplicated rules eventually disagree.

5. Configure permissions around routine work

Use .claude/settings.json for shared project settings and .claude/settings.local.json for personal overrides. Review local settings before relying on them, and keep personal credentials out of both files.

Begin with interactive approvals. After observing the commands your workflow needs, add narrow permission rules for routine tests and checks. Keep publication, deployment, and destructive operations subject to review. A broad shell allowance gives much more access than a test command requires.

6. Run one bounded change through verification

Give Claude Code a concrete task: “Fix the cart quantity validation in apps/web. Read the applicable CLAUDE.md files, inspect the relevant tests, and propose a plan before editing. Change shared packages only if necessary. Run the focused test and web typecheck, then report the files changed and any remaining failures.”

Review the plan for package boundaries. After implementation, inspect git diff --stat and git diff. If shared UI code changed, run its tests and the relevant consumer checks. For broader changes, use your workspace task graph and CI's affected-project checks.

Compare 59API's current rates against representative sessions, including retries and verification. Sign up for 59API to try this workflow with pay-as-you-go billing; its referral rebate can also reduce costs when you introduce teammates.

Preços · Docs

Pronto para começar?

Conecte Claude e GPT em minutos pelos menores preços, sem cortes. Cadastre-se e obtenha sua chave API.

Cadastro grátis