Skip to content

Bootstrap Hadron in Claude Code

This page is the one-stop setup for using Hadron with a coding agent. After following it you can save knowledge to Hadron memories from any Claude Code session, and you can publish Hadron task nodes as Claude Code skills with a single instruction to the agent.

This page is for the coding-agent use case specifically. It uses OAuth and a user-level MCP configuration, so a single sign-in gives Claude Code access to every Hadron app, agent, and memory on your account, regardless of which project directory you open. If you're looking to wire Hadron into a single project directory with an app key instead, see Install Hadron with the install script — that path is appropriate for non-coding MCP hosts, not for coding agents.

The steps below can be followed by you, or by an AI coding agent acting on your behalf. You'll still need to do two things yourself: click Approve in your browser when the OAuth window opens during Step 1, and restart Claude Code at the end. Everything else — running the install command and writing the skill file — can be done by you or by an agent you've pointed at this page.

What you'll have at the end

  • A user-level hadron MCP server registered in Claude Code with the h-* tools available in every session.
  • A bootstrap skill at ~/.claude/skills/hadron-export-task-as-claude-skill/SKILL.md that lets you publish any Hadron task node as a Claude Code skill by asking the agent in plain English.
  • A row in your portal API-keys page with a source badge reading OAuth: dcr_…<client> — the token Claude Code is using.

What you need

Step 1 — Add the Hadron MCP server

Register Hadron as a user-level MCP server in Claude Code. Run this from any terminal:

claude mcp add --transport http hadron https://srv.hadronmemory.com/mcp

This adds hadron to your user-level Claude Code config (it applies across all projects on your machine). No project directory needs to be involved.

The OAuth dance happens on the first Hadron tool call — Claude Code opens your browser, you sign in to Hadron (via GitHub if you haven't already), review the consent screen, click Approve, and Claude Code stores the access token. You will not be asked again until the token is revoked.

For deeper detail on the OAuth flow, local-development tunnels, and multi-App users, see Install Hadron in Claude Code.

Step 2 — Install the bootstrap skill

The skill is a single file you save to a known location. You have two ways to install it:

  • Manually. Create the directory ~/.claude/skills/hadron-export-task-as-claude-skill/ and save the content below as SKILL.md inside it.
  • Via an AI coding agent. Ask Claude Code (or another coding agent with web-fetch and file-write tools) to install the skill for you. Example prompt:

    Read https://docs.hadronmemory.com/how-to/bootstrap-claude-code/ and install the skill file from Step 2 to my user-level Claude Code skills directory.

    The agent fetches this page, reads the content below, and writes it to the right location for you.

The file content is exactly this:

---
name: hadron-export-task-as-claude-skill
description: Export a Hadron task node as an Anthropic Claude Code skill (SKILL.md file). Use when the user says "export this Hadron task as a skill", "publish <node> as a skill", "generate a SKILL.md from <urn>", "sync skill from <node>", or similar. Requires the source node to have nodeType=task and properties.claudeSkill.{name,description} set. Handles the gotchas — missing properties stop the export, overwrites existing SKILL.md (source of truth is the node), and writes user-global by default.
---

<!-- Generated from hrn:node:hadronmemory.com::hadron-mcp::export-task-as-claude-skill -->
<!-- Edit the source node and re-export; do not edit this file directly. -->

# Export a Hadron Task Node as a Claude Skill

Procedure for converting a Hadron `task` node into an Anthropic Claude Code
skill — a `SKILL.md` file inside a `.claude/skills/<name>/` directory.

## When to use

When the user asks to export, publish, sync, or generate a skill from a
Hadron node — e.g. "export `<urn>` as a skill," "publish this task as a
SKILL.md," "sync the `<name>` skill from Hadron."

## Inputs

- **Source URN** (required) — the Hadron node to export. Always fully
  qualified, e.g. `hrn:node:hadronmemory.com::hadron-mcp::add-node`.
- **Target location** (optional, default user-global):
    - `user``~/.claude/skills/<name>/SKILL.md` (default; persists across
      projects, doesn't ship in repos).
    - `project``<repo-root>/.claude/skills/<name>/SKILL.md`
      (version-controlled with the codebase).

## Prerequisites the source node MUST satisfy

1. `nodeType == "task"`.
2. `properties.claudeSkill.name` — kebab-case, used as the skill name and
   directory name.
3. `properties.claudeSkill.description` — trigger-shaped description ("Use
   when… Handles the gotchas…"), used as the SKILL.md `description`
   frontmatter that drives auto-trigger.

If any of these are missing or malformed, **stop and report to the user**.
Do not invent values; the node is the source of truth.

## Procedure

### Step 1 — Read the source node

```
h-read-node urn:<source>
```

### Step 2 — Validate

Confirm all three prerequisites above. On failure, report which prerequisite
is missing and stop.

### Step 3 — Determine output path

Resolve `<name>` from `properties.claudeSkill.name`. Resolve
`<skills-root>` from the target-location argument:

- `user``$HOME/.claude/skills`
- `project``<current-repo-root>/.claude/skills`

Final path: `<skills-root>/<name>/SKILL.md`.

Create parent directories if missing.

### Step 4 — Compose the SKILL.md content

```markdown
---
name: <properties.claudeSkill.name>
description: <properties.claudeSkill.description>
---

<!-- Generated from <source URN> -->
<!-- Edit the source node and re-export; do not edit this file directly. -->

<node `content` body, verbatim>
```

Preserve the node body exactly. Do not reflow, summarize, or add headings.

### Step 5 — Write the file

Write to the resolved absolute path. Overwrite if the file exists — the
node is the source of truth, and editing the SKILL.md directly is
explicitly discouraged by the provenance comment.

### Step 6 — Report to the user

Tell the user:

- The absolute path that was written.
- The skill `name` and `description` that will trigger it.
- Reminder: Claude Code loads skills at session start; existing sessions
  may need to restart to pick up a new or updated skill.

## Gotchas

- **Source of truth is the node, not the SKILL.md.** If the user wants to
  edit a skill's behavior, edit the node and re-export. The provenance
  comment in the generated file makes this contract visible.
- **Don't write back into the node from the SKILL.md.** This is a one-way
  publishing pipeline.
- **Preserve case.** Skill names are case-sensitive; use the exact
  `properties.claudeSkill.name` verbatim.
- **No frontmatter in the node body.** The node's `content` is the SKILL.md
  body, not the whole SKILL.md. Frontmatter is composed from `properties`.
- **Missing properties → stop.** A node that hasn't declared
  `properties.claudeSkill.*` is not exportable; this is a feature, not a
  bug. It prevents accidental publication of nodes that weren't designed as
  skills.

## Future extension

When other publishing targets are added (Cursor rules, Continue rules,
Custom GPT instructions, etc.), each gets its own `properties.<target>.*`
namespace and its own exporter task node. The source node body remains
vendor-agnostic; only the wrapper format changes per target.

This file is published from a canonical source node in Hadron (hrn:node:hadronmemory.com::hadron-mcp::export-task-as-claude-skill). If you want to change how the export procedure works, edit the source node and re-publish — don't edit the local SKILL.md, since it will be overwritten on the next sync.

Step 3 — Restart Claude Code

Claude Code reads skills at session start. Quit any running session and relaunch (claude) so the new skill is picked up.

Verify

Open Claude Code in any directory:

claude

Ask the agent to list your Hadron memories:

List my Hadron memories with h-list-memories.

You should see the memories your account can reach. If this is the first Hadron tool call from this machine, the browser opens for OAuth — sign in and approve.

Then verify the bootstrap skill is loaded by asking:

Export the Hadron task node hrn:node:hadronmemory.com::hadron-mcp::add-node as a skill.

The hadron-export-task-as-claude-skill skill should trigger. The agent reads the node, generates a SKILL.md, and writes it to ~/.claude/skills/hadron-add-node/SKILL.md. After another Claude Code restart you'll have a second skill — the Hadron node-conventions guide — loaded and auto-triggered whenever the LLM is about to call an h-* tool.

What's next

  • Adding nodes to a memory — create your first Hadron memory and add nodes from the portal.
  • Install Hadron in Claude Code — deeper reference for the OAuth install: local-development tunnels via cloudflared, pinning a Hadron App per project via CLAUDE.md, revoking tokens.
  • Architecture — how apps, agents, and memories fit together.

Troubleshooting

The browser never opens for OAuth

Claude Code uses the system default browser. If nothing appears, run claude --log-level debug and open the OAuth-authorize URL printed in the log manually.

claude mcp add says the server already exists

You've installed Hadron before. List registered servers with claude mcp list, then either keep the existing entry or remove it with claude mcp remove hadron before re-adding.

The export skill doesn't trigger

Confirm ~/.claude/skills/hadron-export-task-as-claude-skill/SKILL.md exists and contains the YAML frontmatter from Step 2. Skills are only loaded at session start — restart Claude Code if you wrote the file mid-session.

Exporting a node fails with "missing properties"

The source node is missing properties.claudeSkill.name or properties.claudeSkill.description. Open the node and add those properties — the skill is intentionally strict here to prevent accidental publication of nodes that weren't designed as skills.

For OAuth-specific issues (multi-App users, local-dev tunnels, revoking tokens), see Install Hadron in Claude Code.