---
title: "§11 Lifecycle"
description: "Normative pack lifecycle (lint, install, activate, connect, exec), the four availability flags, and the store."
canonical: https://harnesscontextprotocol.io/docs/specification/lifecycle
---

# §11 Lifecycle

> Normative pack lifecycle (lint, install, activate, connect, exec), the four availability flags, and the store.

## 11.1 Stages

| Stage | Precondition | Effect | Capability |
|-------|-------------|--------|------------|
| lint | Directory readable | Validates §2 to §5; no state change | none |
| install | Lint passes | Pack present in the runtime's catalog or store | `pack.install` |
| activate | Installed | Pack's commands loadable for the session; Skill copied (§5.4) | none |
| connect | Activated; Binding not `public` | Binding established (§8.5) | `pack.connect` |
| exec | Activated; connected if Binding requires; grants | Command runs (§6) | `verb.exec.read` / `verb.exec.write` |
| deactivate | none | Removes activation and connection for the session | none |
| uninstall | none | Removes from catalog or store | `pack.install` |

1. A runtime MUST NOT execute a command of a pack that is not activated.
2. A runtime MUST NOT skip lint on install. A pack that fails lint MUST NOT be
   installed.
3. A runtime MAY treat `install` and `activate` as a single user action, but
   MUST expose both states in availability (§11.2).
4. Deactivate MUST also drop `connected` for the session.
5. A runtime MUST refuse to uninstall its own bootstrap pack, if it has one.
6. Activation MUST NOT require an MCP configuration or new host tools (§12.2.1).

## 11.2 Availability

For each pack a runtime MUST be able to report:

| Flag | Meaning |
|------|---------|
| `installed` | Present in the store |
| `activated` | Loaded for the current session |
| `connected` | Binding established (always `true` for `public`) |
| `executable` | Per command: `activated` ∧ (`connected` ∨ Binding `public`) ∧ Principal holds the required grant ∧ Adapter runnable in this runtime |

1. `executable` is computed per command, not per pack.
2. A pack's `status` MUST be one of `available`, `installed`, `activated`,
   `connected`, `executable`, or `unavailable`, reflecting the highest reached
   stage. Runtimes MAY report more than one.
3. A `sense_only` pack MUST report `executable: false` for Execute while still
   being valid; Sense activation is reported separately (§7.4).

## 11.3 Store

*Informative.* The reference store is `$HCP_HOME` (default `~/.hcp`):

```text
~/.hcp/
  packs/<pack_id>/       installed pack directories
  skills/<pack_id>/      SKILL.md copies (§5.4)
  state.json             { activated: [], connected: [], grants? }
```

A conforming runtime MAY use any store, including a database. It MUST preserve
the semantics of §11.1 and §11.2.

## 11.4 Bootstrap

1. A runtime MAY ship a bootstrap pack whose commands describe the runtime's own
   lifecycle (`doctor`, `list`, `install`, `activate`, `connect`,
   `availability`, `exec`, …).
2. A bootstrap pack follows every rule of this specification. One that manages
   the runtime's local store is a `runtime`-plane pack with Binding `local`; one
   that acts on an operator's fleet is a `control`-plane pack (§2.5).
3. The reference bootstrap pack is `hcp-cli`; it is installed automatically on
   first use and cannot be uninstalled.

## 11.5 Reference CLI (informative)

The reference binary is `hcpx`, also installed as `hcp`.

```text
hcpx lint <pack_dir>
hcpx install <pack_dir>
hcpx activate <pack_id> [pack_id…]
hcpx connect <pack_id>
hcpx exec <pack_id> <verb_key> [-- k=v …]
hcpx availability [pack_id]
hcpx deactivate <pack_id> [pack_id…]
hcpx uninstall <pack_id>
```

Every command accepts `--json`.

## Sitemap

- [Documentation](https://harnesscontextprotocol.io/docs)
- [Packs](https://harnesscontextprotocol.io/packs)
- [Glossary](https://harnesscontextprotocol.io/docs/reference/glossary)
- [llms.txt](https://harnesscontextprotocol.io/llms.txt)
- [llms-full.txt](https://harnesscontextprotocol.io/llms-full.txt)
- [OpenAPI](https://harnesscontextprotocol.io/openapi.json)
- [MCP](https://harnesscontextprotocol.io/mcp)
