# Claude Code

Claude Code works in the terminal or as a desktop app and gets skills, rules, and MCP through mp agent install.

> Source: https://www.mainpath.ai/en/docs/claude-code/

Claude Code is Anthropic's AI agent. It reads your project, writes changes and runs commands, either as a CLI in the terminal or as a desktop app with the same configuration. The [MainPath Toolbox]({{< relref "local-app" >}}) installs both variants during developer setup and opens projects in it with one click.

## Starting

Start Claude Code in the parent project folder, not inside a single repository. Only there does the agent know backend, app and configuration at the same time.

```bash
cd ~/Documents/MainPath/<organization-slug>/<project-slug>
claude
```

## Preconfiguration

MainPath rules come from the mp CLI agent plugin, not from files in `local-configuration`. `mp agent install` places the plugin and skills under `~/.claude/` and writes the MCP server `application-platform` into `~/.claude.json`. As a result the agent follows platform conventions: start applications via `mp run-local`, leave `.gitlab-ci.yml` and `env/*.generated.env` alone, put custom values in `env/*.custom.env`, and keep secrets out of commits and replies. Add project-specific rules in an `AGENTS.md` in the application repository, see [Your own rules for AI agents]({{< relref "ai-instructions" >}}).

## Install the agent plugin

```bash
mp agent install
mp login
```

A separate marketplace entry is not required. After installation, restart Claude Code. The MCP tools and failure cases are described in [CLI and agent plugin]({{< relref "cli-and-agent-plugin" >}}).

From then on a prompt in the project folder such as "Import this project into my MainPath account." or "Start the backend locally." is enough. What the agent does during an import is described in [Import an existing repository]({{< relref "agent-project-import" >}}).

