knowledge-agent — Claude Code skill: what it does, how to install
Builds focused knowledge corpora from claude-mem observations and lets you query them in an AI session. Useful for reviewing past work by topic or project.
npx skills add thedotmack/claude-mem --skill knowledge-agent -a claude-codeWhat knowledge-agent does
knowledge-agent turns selected claude-mem observations into a separate knowledge corpus, loads that corpus into an AI session, and answers questions about it. Records can be filtered by project, change type, concept tags, file paths, semantic query, or date range. The default limit is 500 observations.
The workflow uses four operations: build_corpus creates a corpus, prime_corpus loads it into a session, query_corpus accepts questions, and list_corpora shows available corpora with their status. To refresh the data, use rebuild_corpus, then run reprime_corpus for a fresh session.
A focused corpus such as hook architecture is easier to query than an everything corpus. Large corpora take a moment to prime, so corpus size affects the waiting time before questions can be answered.
What it helps with
- build project knowledge from recorded observations
- filter past work by concepts and change types
- search earlier decisions with a semantic query
- ask follow-up questions while keeping corpus context
- refresh a corpus after new observations are added
Example prompts for the agent
- Build a corpus named `hooks-expertise` for project `claude-mem`, using the `hooks` concept and a limit of `500`.
- Prime `hooks-expertise` and explain which hooks belong to its lifecycle.
- Rebuild `hooks-expertise`, reprime it, and compare the recorded bugfix decisions.
How to install knowledge-agent
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill knowledge-agent -a claude-code2Manually: put the files in place
~/.claude/skills/knowledge-agent/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/knowledge-agent/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill knowledge-agent -a codex2Manually: put the files in place
.agents/skills/knowledge-agent/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill knowledge-agent -a cursor2Manually: put the files in place
.cursor/skills/knowledge-agent/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install thedotmack/claude-mem knowledge-agent2Manually: put the files in place
.github/skills/knowledge-agent/SKILL.md1Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill knowledge-agent -a gemini-cli2Platform CLI
gemini skills install https://github.com/thedotmack/claude-mem --path plugin/skills/knowledge-agentManually: put the files in place
.devin/skills/knowledge-agent/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add thedotmack/claude-mem --skill knowledge-agent -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set15
The whole set →Similar
Questions about knowledge-agent
How do I install knowledge-agent in Claude Code?
Run npx skills add thedotmack/claude-mem --skill knowledge-agent -a claude-code, run the same command again, then check ~/.claude/skills/knowledge-agent/SKILL.md.
What does knowledge-agent do?
The skill builds corpora from claude-mem observations, loads them into an AI session, and answers questions about the selected data. Follow-up queries keep the session context.
How do I refresh a knowledge-agent corpus?
Run rebuild_corpus name="hooks-expertise" to include new observations, then run reprime_corpus name="hooks-expertise" to load the refreshed corpus into a new session.
Source text
SKILL.md · Apache-2.0
--- name: knowledge-agent description: Build and query AI-powered knowledge bases from claude-mem observations. Use when users want to create focused "brains" from their observation history, ask questions about past work patterns, or compile expertise on specific topics. --- # Knowledge Agent Build and query AI-powered knowledge bases from claude-mem observations. ## What Are Knowledge Agents? Knowledge agents are filtered corpora of observations compiled into a conversational AI session. Build a corpus from your observation history, prime it (loads the knowledge into an AI session), then ask it questions conversationally. Think of them as custom "brains": "everything about hooks", "all decisions from the last month", "all bugfixes for the worker service". ## Workflow ### Step 1: Build a corpus ```text build_corpus name="hooks-expertise" description="Everything about the hooks lifecycle" project="claude-mem" concepts="hooks" limit=500 ``` Filter options: - `project` — filter by project name - `types` — comma-separated: decision, bugfix, feature, refactor, discovery, change - `concepts` — comma-separated concept tags - `files` — comma-separated file paths (prefix match) - `query` — semantic search query - `dateStart` / `dateEnd` — ISO date range - `limit` — max observations (default 500) ### Step 2: Prime the corpus ```text prime_corpus name="hooks-expertise" ``` This creates an AI session loaded with all the corpus knowledge. Takes a moment for large corpora. ### Step 3: Query ```text query_corpus name="hooks-expertise" question="What are the 5 lifecycle hooks and when does each fire?" ``` The knowledge agent answers from its corpus. Follow-up questions maintain context. ### Step 4: List corpora ```text list_corpora ``` Shows all corpora with stats and priming status. ## Tips - **Focused corpora work best** — "hooks architecture" beats "everything ever" - **Prime once, query many times** — the session persists across queries - **Reprime for fresh context** — if the conversation drifts, reprime to reset - **Rebuild to update** — when new observations are added, rebuild then reprime ## Maintenance ### Rebuild a corpus (refresh with new observations) ```text rebuild_corpus name="hooks-expertise" ``` After rebuilding, reprime to load the updated knowledge: ### Reprime (fresh session) ```text reprime_corpus name="hooks-expertise" ``` Clears prior Q&A context and reloads the corpus into a new session.
© thedotmack · Apache-2.0 · thedotmack/claude-mem