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

# Installation

> Install the taskgraph-ai npm package, run taskgraph init in your project, and add the Claude Code plugin for /taskgraph: slash commands.

With Claude Code and Node.js in place, install TaskGraph and set it up in your project.

## 1. Install the CLI

```bash theme={null}
npm install -g taskgraph-ai
```

This gives you the `taskgraph` command and `taskgraph-mcp`, the optional MCP server. To skip the install, run any command through npx, for example `npx -y -p taskgraph-ai taskgraph list`.

## 2. Initialize your project

From your project folder:

```bash theme={null}
taskgraph init
```

This creates `.taskgraph/` (tasks, docs, config), and a `CLAUDE.md` import with TaskGraph's workflow guide. Pass `--no-claude` to skip the `CLAUDE.md` import. `init` does not install slash commands (step 3 does) and doesn't register the MCP server unless you pass `--mcp` (step 4).

> [!WARNING]
>
> Don't run `init` twice. It only re-adds the same files.

## 3. Install the plugin

The Claude Code plugin is the only way to get slash commands. It adds the `/taskgraph:` slash commands and two agents (`task-executor`, `task-checker`):

```txt theme={null}
/plugin marketplace add stephennmiller/taskgraph-ai
/plugin install taskgraph@taskgraph
```

The plugin also adds two hooks and a `taskgraph` skill. In a project with a `.taskgraph/` folder, each Claude Code session (and each resume after compaction) starts with the output of [`taskgraph prime`](https://taskgraph-ai.com/capabilities/cli-viewing-commands#prime-a-coding-agent): the task in progress, what's ready next, and the workflow rules. Elsewhere the hook does nothing. It needs a CLI with the `prime` command, so update the CLI when you update the plugin.

When Claude finishes a turn and a task is still in progress with no note from this session, the Stop hook reminds Claude once per session to log what it did with `taskgraph note`, or to close the task. The session starts when the session hook runs: it saves that time in a private folder in your temp folder (`$TMPDIR/taskgraph-<your user ID>/session-<session ID>`, readable only by you), and compacting the conversation keeps it. The `taskgraph` skill tells Claude to use TaskGraph when you ask what to do next or plan work in a project that has `.taskgraph/`.

## 4. (Optional) Add the MCP server

The slash commands (from the plugin) and the CLI do everything without MCP. Add the server only if you want to drive TaskGraph in plain language:

```bash theme={null}
claude mcp add taskgraph-ai --scope user \
  --env TASKGRAPH_TOOLS=standard \
  -- npx -y taskgraph-ai
```

Restart Claude Code and run `/mcp`. `taskgraph-ai` should show as connected. If you see `0 tools enabled`, restart Claude Code and confirm `npx -y taskgraph-ai` starts on its own in a terminal.

The equivalent `.mcp.json` entry is:

```json theme={null}
{
  "mcpServers": {
    "taskgraph-ai": {
      "command": "npx",
      "args": ["-y", "taskgraph-ai"],
      "env": { "TASKGRAPH_TOOLS": "standard" }
    }
  }
}
```

## Upgrading from Task Master or before 0.47

See the [upgrade guide](https://taskgraph-ai.com/upgrading.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.