---
name: common-concept
description: Use Common Concept to learn, author and publish learning Patches from your agent.
---

Your agent hosts the conversation; Common Concept keeps your competency Profile, Missions, learning Materials and published Patches.

Sign in at https://co.mmon.co/ncept/ and select your learning Profile through **Profile and account**, or a Scratch Profile for authoring experiments.

For product questions, read https://mmon.co/ncept/docs/llms.txt and the relevant page it lists, give the learner that page’s link, and link to https://co.mmon.co/ncept/ or the specific web surface when the task is better done there.

## Connect

Claude Code:

```sh
claude mcp add-json --scope user common-concept '{"type":"http","url":"https://co.mmon.co/ncept/mcp","oauth":{"scopes":"patches learn publish"}}'
claude mcp login common-concept
```

Login needs an interactive terminal. Inside Claude Code, **/mcp** also offers authentication; complete the browser's sign-in and consent, then continue.

Pi:

```sh
pi mcp add common-concept --url https://co.mmon.co/ncept/mcp
```

In your agent directory's `mcp.json` (normally `~/.pi/agent/mcp.json`), set that server's `oauth` to `{"clientRegistration":"cimd","scope":"patches learn publish"}`. Then run `pi mcp login common-concept` and complete browser consent. Use `/reload` in an existing pi session.

## Use

In Claude Code, the current conversation file is `~/.claude/projects/<project>/<session>.jsonl`; in Codex it is `~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl`; in pi it is `~/.pi/agent/sessions/<cwd-slug>/<timestamp>_<session-id>.jsonl`. Identify the current file and run `wc -l <file>` immediately before `open` (PowerShell: `(Get-Content <file> | Measure-Object -Line).Lines`). Pass that count as `fileLine` and remember the path. If the current file cannot be identified, omit `fileLine` and do not offer an import.

Open a Session with the learner's chosen mode and entry, reporting your model id in optional `model`. For free learning use `open {mode:'empty',model:'<your model id>'}`; for authoring use `mode:'authoring'`. The opening schema also accepts goals, Missions and their lesson stops, targets and reviews, as on the web. Use the selected Profile, or pass `profileId` explicitly.

Read `context` for the opened Session. On each read after the first, pass the previous turn's completed exchange: `exchange:{learner:'<the learner message you answered last turn>',tutor:'<your reply to it>'}`, both verbatim. Never the message you are answering now, which belongs to the next read. This applies in every MCP client, pi included. It saves the completed exchange in the Session conversation; omitted exchanges stay gaps. To continue an existing web Session, pass its `profileId` and `sessionId` to `context`; its recent conversation is returned.

Its mounted catalog supplies the prompt, Skill index and tool schemas; use those schemas rather than a separate tool list or old-call adapter. Load a Skill with `skill {name}` or one declared format with `skill {name:'material',resource:'quiz.md'}`. Author uses `read`/`query`/`theory` for context, `edit_graph_draft` and `propose {op:'graph-diff',input}` for approved graph changes, and `material {kind,op,input}` for content; it records no personal evidence or Mission. Read context again after a mode switch or accepted graph change. Ask for approval in your local conversation before proposing a change.

For files, give `upload` the SHA-256 hash (`sha256:` prefix), media type and byte length. POST the original bytes to its returned URL:

```sh
curl --fail-with-body -X POST -H 'Content-Type: <mediaType>' --data-binary @<file> '<upload URL>'
```

Keep only the returned `{hash, mediaType}` descriptor in the conversation. Give the learner the matching URL from `context.links` when they want the Session, its Mission, the Map or due-card Practice in the browser. Use returned Material links for interactive quizzes and applets. Learning calls save evidence into the same Profile, independently of transcript capture; the Full trial and subscription are shared with the web: the first Session on your own Mission starts the trial, and `open` after it ends is refused until you subscribe.

The web Session shows **From {client}**, the reported model, captured exchanges and accepted calls in its normal conversation, and can be continued there. Its model picker selects the reported model when it is in the web catalog, otherwise the account default. Close the Session when finished. If `close` returns `fileLine`, offer to import its exact conversation. Explain that only the lines appended since `open` leave the machine, including any coding done while this Session was open. The learner's approval of the shell upload is consent.

Compute the SHA-256 (`sha256:` prefix) and byte length of the suffix locally, with no file contents through the model. Request `upload` with that metadata, `mediaType:'application/x-ndjson'` and `session:{profileId,sessionId}`. POST only that suffix:

```sh
tail -n +$((fileLine+1)) '<session file>' | curl --fail-with-body -X POST -H 'Content-Type: application/x-ndjson' --data-binary @- '<upload URL>'
```

PowerShell: form the suffix with `Get-Content '<session file>' | Select-Object -Skip <fileLine>` and encode it as UTF-8 for the byte count, hash and POST. Use the same bytes for all three; the returned URL is single-use. The file keeps growing, so freeze the suffix in a temporary local file before hashing if necessary, upload those exact bytes, then remove the temporary file.

Call `import {profileId,sessionId,uploadId,format:'claude-code'}` (or `format:'codex'`, `format:'pi'`) with the upload response. The server keeps speech only within the Session's lifetime, matches Common Concept calls to accepted calls, drops other tools and deletes the upload whether imported or refused. A refusal leaves the reported exchanges unchanged. Without `fileLine`, never upload the whole conversation file. Other harnesses keep reporting exchanges instead. For pi the server follows the last message's parent chain, so branches abandoned with `/tree` are dropped, though they are in the uploaded lines.

Saved releases are in **Hub → Yours**.
