Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add thedotmack/claude-mem --skill knowledge-agent -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/knowledge-agent/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/knowledge-agent/

From the same set15

The whole set →
mem-search thedotmack Searches memory for solutions and context from previous coding sessions when you need to recall past work. Claude Code CX Codex Cursor +1 8,900installs smart-explore thedotmack Uses tree-sitter to map code structure and find symbols. Useful when you need to explore a codebase without loading every full file. Claude Code CX Codex Cursor +1 7,300installs make-plan thedotmack Turns a feature request into a phased plan built on real documentation instead of guesses. Useful right before you run do. Claude Code CX Codex Cursor +1 7,200installs do thedotmack The skill runs an implementation plan in phases through subagents. Use it when a plan needs execution with checks after each phase. Claude Code CX Codex Cursor +1 7,000installs learn-codebase thedotmack Instructs the agent to read every source file in full before starting work. Built for onboarding on unfamiliar repositories. Claude Code CX Codex Cursor +1 5,300installs how-it-works thedotmack Explains how claude-mem works behind the scenes. It covers tool observation logging, local file storage, and memory injection timing. Claude Code CX Codex Cursor +1 5,100installs pathfinder thedotmack This skill maps feature flows, finds duplicated concerns, and proposes a unified architecture. Use it to inspect a codebase before a refactor. Claude Code CX Codex Cursor +1 5,100installs wowerpoint thedotmack Turns a single text document into a kawaii NotebookLM slide deck via CLI. Helpful when you need to render an architecture doc or report into clear, shareable slides. Claude Code CX Codex Cursor +1 4,400installs

Similar

agents-sdk cloudflare Helps build, debug, and review Cloudflare Agents SDK applications using the agents package and official documentation. Claude Code CX Codex Cursor +1 105,700installs documentation official anthropics A skill for technical writing that drafts READMEs, API references, runbooks, architecture docs and onboarding guides. Useful when the code exists but the description does not. Claude Code CX Codex Cursor +1 10,300installs firebase-basics official google This skill sets up the Firebase CLI, handles sign-in, creates or switches projects, and downloads Android or iOS app configuration files. Claude Code Gemini CLI CX Codex 14,100installs remember rohitg00 Saves insights, decisions, and learnings to agentmemory long-term storage with concept tags so agents can retrieve them later. Claude Code CX Codex Cursor +1 14,000installs forget rohitg00 Deletes selected durable memories from agentmemory after explicit confirmation. Useful when scrubbing secrets or obsolete notes. Claude Code CX Codex Cursor +1 13,800installs session-history rohitg00 Shows recent project sessions as a clean timeline. Use it to recover past decisions, observations, and session status. Claude Code CX Codex Cursor +1 13,800installs setup-matt-pocock-skills Matt Pocock This skill configures a repository for Matt Pocock's engineering skills by setting its issue tracker, triage labels, and domain docs layout. Run it before using the other skills. Claude Code 1,052,851installs to-tickets Matt Pocock Turns a plan, spec, or conversation into small end-to-end tickets with explicit blockers. Use it to agree on the work breakdown before tickets go to a tracker. Claude Code 711,230installs

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

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor