> For the complete documentation index, see [llms.txt](https://kerno.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerno.gitbook.io/docs/references/ports-and-file-paths.md).

# Ports and file paths

### Ports

| Service                                            | Default port | Override           |
| -------------------------------------------------- | ------------ | ------------------ |
| Agent REST API (used by the IDE extension and CLI) | `8085`       | `PORT` env var     |
| MCP server (used by coding agents)                 | `8086`       | `MCP_PORT` env var |

Both ports listen on localhost only and are not reachable from other machines on your network.

If the default port is taken, Kerno auto-allocates a free one. The actual port is always printed in the output of `kerno mcp`. Always copy the URL from the terminal rather than assuming the default.

### File paths

Kerno uses three locations on your filesystem.

#### `~/.kerno/`

Installed agent binaries, runtime state, and per-workspace data.

| Path                                            | Purpose                                             |
| ----------------------------------------------- | --------------------------------------------------- |
| `~/.kerno/assets/agent/{version}/aicore-agent/` | Installed agent JAR                                 |
| `~/.kerno/assets/runtime/{version}/custom-jre/` | Custom JRE bundled with the agent                   |
| `~/.kerno/workspaces/`                          | Per-workspace snapshots and indexed data            |
| `~/.kerno/` (top level)                         | Agent port, PID, workspace, and version state files |

#### `.kerno/` (in your repository)

Per-app directory Kerno creates inside your repository. In a monorepo, each enabled app has its own `.kerno/` under that app's root.

Kerno auto-writes a `.kerno/.gitignore` that ignores `hooks/*` and `mcp-jobs/*`, so you do not need to add anything to your repo's own `.gitignore` for those. The rest of `.kerno/` is intended to be committed alongside your code.

**Persistent state**

| Path                                   | Purpose                                                                                                   |
| -------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `scenarios/endpoints/<METHOD>/<path>/` | Generated TypeScript scenario files (`*.scenario.ts`), grouped by endpoint                                |
| `analysis/`                            | Markdown reports from Kerno's analysis (workspace, endpoints, environment), reused as context across runs |
| `hooks/`                               | Git hooks Kerno installs in your repo (ignored)                                                           |
| `mcp-jobs/<job_id>.log`                | Logs for in-flight MCP async jobs (ignored)                                                               |

**Build artifacts**

Written when you build the environment for the app. Kerno regenerates them when you apply feedback and rebuild.

| File                             | Purpose                                                                                                                                              |
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Dockerfile`                     | Dockerfile Kerno generates to build your app                                                                                                         |
| `docker-compose.yml`             | Main orchestration compose that ties all services together                                                                                           |
| `docker-compose.sut.yaml`        | Compose definition for your app (the system under test)                                                                                              |
| `docker-compose.<service>.yaml`  | Compose definition for each detected dependency, for example `docker-compose.postgres.yaml`                                                          |
| `docker-compose.ts-sandbox.yaml` | Compose definition for Kerno's sandbox container, which transparently intercepts outbound HTTPS from your app so external APIs can be mocked locally |
| `.env`                           | Environment variables for your app                                                                                                                   |
| `.env.<service>`                 | Environment variables for each dependency, for example `.env.postgres`                                                                               |

#### `/tmp/kerno/`

Temporary working directory for compose projects and scenario workspaces.

| Path                                | Purpose                                 |
| ----------------------------------- | --------------------------------------- |
| `/tmp/kerno/compose/...`            | Generated Docker Compose projects       |
| `/tmp/kerno/scenario-workspace/...` | Working directory for scenario planning |

### Removing Kerno

To stop the agent and remove the installed binaries, run:

```bash
kerno uninstall

This stops the running agent and clears ~/.kerno/assets/ (the agent JAR and bundled JRE). Other state — ~/.kerno/workspaces/, your repository's .kerno/ directory, and any /tmp/kerno/ data — is preserved unless you delete it manually.
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kerno.gitbook.io/docs/references/ports-and-file-paths.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
