Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Sandboxed code execution + FTS5 knowledge base for Claude Code.
Write code. console.log() only the answer. Raw output stays in a sandbox — out of your context window.
| Tool | Use when |
|---|---|
execute(language, code) | Data processing — analyze, filter, transform, count |
batch_execute(commands, queries) | Research — explore codebase, index, search |
search(queries, source?) | Follow-up queries on indexed content; returns snippets by default |
get_chunk(chunkId) | Expand one exact indexed chunk after a snippet proves relevance |
fetch_and_index(url, queries?) | Web research — fetch, index, query |
Hooks auto-enforce the pattern. If you reach for the wrong tool, Claude redirects you with examples.
claude plugin add kianwoon/context-mode
Requires Node.js 18+.
Bash for research:❌ Before (raw output floods context):
Bash: git log
Bash: git diff
Bash: git branch -a
✓ After (indexed + searchable):
batch_execute({
commands: [
{label: "log", command: "git log --oneline -20"},
{label: "diff", command: "git diff --stat"},
{label: "branches", command: "git branch -a | head -30"}
],
queries: ["what changed in the last commit", "any pending migrations"]
})
Read on data files:❌ Before (raw file floods context):
Read: results.csv # 50MB CSV
Read: app.log # unbounded log
✓ After (only the answer enters context):
execute({
language: "javascript",
code: `
const fs = require('fs');
const lines = fs.readFileSync('results.csv', 'utf8').split('\\n').filter(l => l.includes('ERROR'));
console.log(lines.length);
`
})
WebFetch:❌ Before (raw HTML floods context — 5K-50K+ tokens):
WebFetch: https://docs.example.com/api
✓ After (indexed + searchable):
fetch_and_index({url: "https://docs.example.com/api", queries: ["rate limit", "auth"]})
Runs code in 11 languages. Only console.log() output returns — everything else stays sandboxed.
execute({language: "javascript", code: `
const data = JSON.parse(fs.readFileSync('package.json', 'utf8'));
console.log(Object.keys(data.dependencies).join(', '));
`})
Runs shell commands, auto-indexes output into FTS5, runs search, and returns ranked evidence snippets by default.
batch_execute({
commands: [
{label: "src", command: "find src -name '*.ts' | head -50"},
{label: "tests", command: "find . -name '*.test.ts'"},
],
queries: ["auth middleware", "API routes"]
})
Search over previously indexed content. Works across all batch_execute and fetch_and_index output in the session. Defaults to evidence snippets with chunkId; set outputMode: "full" only when you need complete chunks immediately.
search({queries: ["where is the login handler", "what does the auth middleware do"]})
Expands one exact chunk returned by search, batch_execute, or fetch_and_index.
get_chunk({chunkId: 42})
Fetches a URL, converts HTML→markdown, indexes into FTS5, returns a compact summary and optional search snippets. Section inventory and links are opt-in.
fetch_and_index({url: "https://github.com/kianwoon/context-mode", queries: ["features", "install"]})
Hooks auto-enforce the pattern — you don't need to memorize when to use what.
| Trigger | What happens |
|---|---|
Bash with dangerous command (bare git log, git diff, etc.) | Denied with redirect to execute/batch_execute example |
First Bash call in session (safe command) | Guidance with pattern examples (once/session) |
Read on data file (.log, .csv, .json >100KB) | Denied with redirect to execute example |
First Read call in session (safe file) | Guidance with pattern examples (once/session) |
WebFetch / webReader | Denied with redirect to fetch_and_index |
batch_execute / execute / fetch_and_index with large output | Indexed to FTS5, output replaced with search summary |
Plugin self-manages — no config needed.
context-mode-{pid}.db in tmpdir, deleted on session endnpm run build # outputs build/index.js (~607KB, committed to repo)
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub kianwoon/context-mode --plugin context-modePlugins from other owners that cover similar ground