opencontext
Persistent memory and context management for AI agents using OpenContext. Keep context across sessions/repos/dates, store conclusions, and provide document search workflows.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o opencontext.zip https://jpskill.com/download/20913.zip && unzip -o opencontext.zip && rm opencontext.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/20913.zip -OutFile "$d\opencontext.zip"; Expand-Archive "$d\opencontext.zip" -DestinationPath $d -Force; ri "$d\opencontext.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
opencontext.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
opencontextフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] opencontext
OpenContext コンテキスト管理 (永続メモリ)
AIアシスタントに永続的なメモリを与えましょう。 説明を繰り返すのをやめ、よりスマートなアシスタントを構築しましょう。
このスキルを使用するタイミング
- セッション間でコンテキストを保持する必要がある場合
- プロジェクトの背景や決定を記録する必要がある場合
- 以前の結論や教訓を検索する必要がある場合
- マルチエージェントワークフローで知識共有が必要な場合
- 繰り返しの背景説明を減らしたい場合
1. コアコンセプト
問題
AIアシスタントと作業していると、コンテキストが失われます(セッション、リポジトリ、日付をまたいで)。その結果、背景を繰り返し説明したり、決定事項を再説明したりすることになり、時にはアシスタントが誤った仮定に基づいて作業を続けることもあります。
解決策
OpenContext は、AIアシスタント向けの軽量な個人用コンテキスト/知識ストアです。
[コンテキストをロード] → [作業を実行] → [結論を保存]
デフォルトパス
| 項目 | パス |
|---|---|
| コンテキスト | ~/.opencontext/contexts |
| データベース | ~/.opencontext/opencontext.db |
2. インストールと初期化
CLIのインストール
npm install -g @aicontextlab/cli
# またはnpxを使用
npx @aicontextlab/cli <command>
初期化(リポジトリ内で実行)
cd your-project
oc init
oc init の機能:
- グローバルコンテキストストアの準備(初回実行時)
- 選択したツール用のユーザーレベルコマンド/スキルとmcp.jsonの生成
- リポジトリのAGENTS.mdの更新
3. スラッシュコマンド
初心者向けコマンド
| コマンド | 目的 |
|---|---|
/opencontext-help |
どこから始めればよいかわからない場合 |
/opencontext-context |
(推奨デフォルト) 作業前に背景をロード |
/opencontext-search |
既存のドキュメントを検索 |
/opencontext-create |
新しいドキュメント/アイデアを作成 |
/opencontext-iterate |
結論と引用を保存 |
インストール場所
# スラッシュコマンド
Cursor: ~/.cursor/commands
Claude Code: ~/.claude/commands
# スキル
Cursor: ~/.cursor/skills/opencontext-*/SKILL.md
Claude Code: ~/.claude/skills/opencontext-*/SKILL.md
Codex: ~/.codex/skills/opencontext-*/SKILL.md
# MCP設定
Cursor: ~/.cursor/mcp.json
Claude Code: ~/.claude/mcp.json
4. コアCLIコマンド
フォルダー/ドキュメント管理
# フォルダーを一覧表示
oc folder ls --all
# フォルダーを作成
oc folder create project-a -d "My project"
# ドキュメントを作成
oc doc create project-a design.md -d "Design doc"
# ドキュメントを一覧表示
oc doc ls project-a
検索とマニフェスト
# 検索(キーワード/ハイブリッド/ベクトル)
oc search "your query" --mode keyword --format json
# マニフェストを生成(AIが読み込むべきファイルのリスト)
oc context manifest project-a --limit 10
検索モード
| モード | 説明 | 要件 |
|---|---|---|
--mode keyword |
キーワードベースの検索 | 埋め込みは不要 |
--mode vector |
ベクトル検索 | 埋め込みとインデックスが必要 |
--mode hybrid |
ハイブリッド(デフォルト) | 埋め込みとインデックスが必要 |
埋め込み設定(セマンティック検索用)
# APIキーを設定
oc config set EMBEDDING_API_KEY "<<your_key>>"
# (オプション) ベースURLを設定
oc config set EMBEDDING_API_BASE "https://api.openai.com/v1"
# (オプション) モデルを設定
oc config set EMBEDDING_MODEL "text-embedding-3-small"
# インデックスを構築
oc index build
5. MCPツール
OpenContext MCPツール
oc_list_folders # フォルダーを一覧表示
oc_list_docs # ドキュメントを一覧表示
oc_manifest # マニフェストを生成
oc_search # ドキュメントを検索
oc_create_doc # ドキュメントを作成
oc_get_link # 安定したリンクを生成
マルチエージェント統合
# Gemini: 大規模な分析
ask-gemini "Analyze the structure of the entire codebase"
# Codex: コマンドを実行
shell "docker-compose up -d"
# OpenContext: 結果を保存
oc doc create project-a conclusions.md -d "Analysis conclusions"
6. マルチエージェントワークフロー統合
オーケストレーションパターン
[Claude] 計画
↓
[Gemini] 分析/調査 + OpenContext検索
↓
[Claude] コードを記述
↓
[Codex] 実行/テスト
↓
[Claude] 結果を統合 + OpenContextに保存
実践例: API設計 + 実装 + テスト
# 1. [Claude] スキルを使用してAPI仕様を設計
/opencontext-context # プロジェクトの背景をロード
# 2. [Gemini] 大規模なコードベースを分析
ask-gemini "@src/ Analyze existing API patterns"
# 3. [Claude] 分析に基づいてコードを実装
# (OpenContextからロードされたコンテキストを使用)
# 4. [Codex] テストとビルド
shell "npm test && npm run build"
# 5. [Claude] 最終レポートを作成 + 結論を保存
/opencontext-iterate # 決定事項と学んだ教訓を保存
7. 推奨される日次ワークフロー
作業前(1分)
/opencontext-context
- プロジェクトの背景と既知の落とし穴をロード
作業中
/opencontext-search
- 不明な点がある場合は既存の結論を検索
作業後(2分)
/opencontext-iterate
- 決定事項、落とし穴、次のステップを記録
ROIの高いドキュメントタイプ
- Acceptance Criteria - 受け入れ基準
- Common Pitfalls - よくある落とし穴
- API Contracts - API契約
- Dependency Versions - 依存関係のバージョン
8. 安定したリンク (Stable Links)
ドキュメントIDを参照することで、名前の変更や移動があってもリンクを安定させます。
[label](oc://doc/<stable_id>)
CLI経由でリンクを生成
oc doc link <doc_path>
MCP経由でリンクを生成
oc_get_link doc_path="Product/api-spec"
9. デスクトップアプリとWeb UI
デスクトップアプリ(推奨)
- ネイティブUIでコンテキストを管理/検索/編集
- CLIなしで使用可能
- 自動インデックス構築(バックグラウンドで)
引用機能: | アクション | 方法 | 結果 | |------|------|------| | テキストスニペットを引用 | テキストを選択 → 右クリック → 「Copy Citation」 | エージェントがスニペットとソースを読み込む | | ドキュメントを引用 | ドキュメントタイトルの横にある引用アイコンをクリック | エージェントがドキュメント全体を読み込み、stable_idを取得 | | フォルダーを引用 | フォルダーを右クリック → 「Copy Folder Citation」 | エージェントが
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
OpenContext Context Management (Persistent Memory)
Give your AI assistant persistent memory. Stop repeating explanations, and build smarter.
When to use this skill
- When you need to keep context across sessions
- When you need to record project background/decisions
- When you need to search prior conclusions/lessons
- When you need knowledge sharing in a Multi-Agent workflow
- When you want to reduce repetitive background explanations
1. Core concepts
Problem
When working with an AI assistant, context gets lost (across sessions, repos, and dates). You end up repeating background, re-explaining decisions, and sometimes the assistant continues with incorrect assumptions.
Solution
OpenContext is a lightweight personal context/knowledge store for AI assistants.
[Load context] → [Do work] → [Store conclusions]
Default paths
| Item | Path |
|---|---|
| Contexts | ~/.opencontext/contexts |
| Database | ~/.opencontext/opencontext.db |
2. Install and initialize
Install CLI
npm install -g @aicontextlab/cli
# Or use npx
npx @aicontextlab/cli <command>
Initialize (run inside the repo)
cd your-project
oc init
What oc init does:
- Prepare the global context store (on first run)
- Generate user-level commands/skills + mcp.json for the selected tool
- Update the repo's AGENTS.md
3. Slash Commands
Beginner-friendly commands
| Command | Purpose |
|---|---|
/opencontext-help |
When you don't know where to start |
/opencontext-context |
(Recommended default) Load background before work |
/opencontext-search |
Search existing documents |
/opencontext-create |
Create a new document/idea |
/opencontext-iterate |
Store conclusions and citations |
Install locations
# Slash Commands
Cursor: ~/.cursor/commands
Claude Code: ~/.claude/commands
# Skills
Cursor: ~/.cursor/skills/opencontext-*/SKILL.md
Claude Code: ~/.claude/skills/opencontext-*/SKILL.md
Codex: ~/.codex/skills/opencontext-*/SKILL.md
# MCP Config
Cursor: ~/.cursor/mcp.json
Claude Code: ~/.claude/mcp.json
4. Core CLI commands
Folder/document management
# List folders
oc folder ls --all
# Create folder
oc folder create project-a -d "My project"
# Create document
oc doc create project-a design.md -d "Design doc"
# List documents
oc doc ls project-a
Search & manifest
# Search (keyword/hybrid/vector)
oc search "your query" --mode keyword --format json
# Generate a manifest (list of files the AI should read)
oc context manifest project-a --limit 10
Search modes
| Mode | Description | Requirements |
|---|---|---|
--mode keyword |
Keyword-based search | No embeddings required |
--mode vector |
Vector search | Embeddings + index required |
--mode hybrid |
Hybrid (default) | Embeddings + index required |
Embedding configuration (for semantic search)
# Set API key
oc config set EMBEDDING_API_KEY "<<your_key>>"
# (Optional) Set base URL
oc config set EMBEDDING_API_BASE "https://api.openai.com/v1"
# (Optional) Set model
oc config set EMBEDDING_MODEL "text-embedding-3-small"
# Build index
oc index build
5. MCP Tools
OpenContext MCP Tools
oc_list_folders # List folders
oc_list_docs # List documents
oc_manifest # Generate manifest
oc_search # Search documents
oc_create_doc # Create document
oc_get_link # Generate stable link
Multi-Agent integration
# Gemini: large-scale analysis
ask-gemini "Analyze the structure of the entire codebase"
# Codex: run commands
shell "docker-compose up -d"
# OpenContext: store results
oc doc create project-a conclusions.md -d "Analysis conclusions"
6. Multi-Agent workflow integration
Orchestration Pattern
[Claude] Plan
↓
[Gemini] Analysis/research + OpenContext search
↓
[Claude] Write code
↓
[Codex] Run/test
↓
[Claude] Synthesize results + store in OpenContext
Practical example: API design + implementation + testing
# 1. [Claude] Design API spec using the skill
/opencontext-context # Load project background
# 2. [Gemini] Analyze a large codebase
ask-gemini "@src/ Analyze existing API patterns"
# 3. [Claude] Implement code based on the analysis
# (Use context loaded from OpenContext)
# 4. [Codex] Test and build
shell "npm test && npm run build"
# 5. [Claude] Create final report + store conclusions
/opencontext-iterate # Store decisions and lessons learned
7. Recommended daily workflow
Before work (1 min)
/opencontext-context
- Load project background + known pitfalls
During work
/opencontext-search
- Search existing conclusions when unsure
After work (2 min)
/opencontext-iterate
- Record decisions, pitfalls, and next steps
High-ROI document types
- Acceptance Criteria - acceptance criteria
- Common Pitfalls - common pitfalls
- API Contracts - API contracts
- Dependency Versions - dependency versions
8. Stable links (Stable Links)
Keep links stable across renames/moves by referencing document IDs:
[label](oc://doc/<stable_id>)
Generate a link via CLI
oc doc link <doc_path>
Generate a link via MCP
oc_get_link doc_path="Product/api-spec"
9. Desktop App & Web UI
Desktop App (recommended)
- Manage/search/edit context with a native UI
- Use without the CLI
- Automatic index builds (in the background)
Citation features: | Action | How | Result | |------|------|------| | Cite text snippet | Select text → right-click → "Copy Citation" | Agent reads the snippet + source | | Cite document | Click the citation icon next to the document title | Agent reads the full document + obtains stable_id | | Cite folder | Right-click folder → "Copy Folder Citation" | Agent bulk-reads all docs in the folder |
Web UI
oc ui
# Default URL: http://127.0.0.1:4321
Quick Reference
Essential workflow
Before: /opencontext-context (load background)
During: /opencontext-search (search)
After: /opencontext-iterate (store)
Core CLI commands
oc init # Initialize project
oc folder ls --all # List folders
oc doc ls <folder> # List documents
oc search "query" # Search
oc doc create ... # Create document
MCP Tools
oc_list_folders list folders
oc_list_docs list documents
oc_search search
oc_manifest manifest
oc_create_doc create document
oc_get_link generate link
Paths
~/.opencontext/contexts context store
~/.opencontext/opencontext.db database