This repo contains the MEGA-Code plugin surfaces:
- Claude Code skills in
skills/ - lifecycle hooks in
hooks/ - helper scripts in
scripts/ - client/runtime code in
mega_code/
Keep changes scoped to those areas. If a task requires core extraction logic,
prefer editing mega_code/ rather than duplicating logic in skill docs or shell
scripts.
skills/wisdom-gen/ -> /mega-code:wisdom-gen
skills/status/ -> /mega-code:status
skills/profile/ -> /mega-code:profile
skills/login/ -> /mega-code:login
skills/help/ -> /mega-code:help
Session ingestion is hook-less: wisdom-gen triggers an on-demand sync
that scans ~/.claude/projects/ directly, filters by the user's cwd,
and uploads matching transcripts. State lives in
~/.local/share/mega-code/projects/<folder>/claude-sync-ledger.json.
Every Claude skill that runs uv must set:
MEGA_DIR="${CLAUDE_PLUGIN_ROOT:-$(cat ~/.local/share/mega-code/plugin-root 2>/dev/null)}"Every uv run command must include:
--directory "$MEGA_DIR"Before Python commands that depend on credentials or server config, load .env:
set -a && . "$MEGA_DIR/.env" 2>/dev/null && set +aIf a command talks to the MEGA-Code server, check MEGA_CODE_API_KEY first and
fail with a clear message when it is missing.
If a skill depends on variables such as MEGA_DIR, LOG, or exported project
context, keep the commands in one Bash block so state is preserved.
Claude skills live in skills/*/SKILL.md.
Required frontmatter:
description:allowed-tools:
Optional but expected when relevant:
argument-hint:disable-model-invocation: truefor skills that only orchestrate Bash
Authoring rules:
- Prefer the smallest
allowed-tools:set that still works. - Use
Bash, Readby default; addWrite,Edit, orAskUserQuestiononly when needed. - Keep command examples copy-pastable.
- Do not hardcode plugin install paths; use
${CLAUDE_PLUGIN_ROOT}in hooks andMEGA_DIRin skills. - If a skill invokes Python entry points, prefer existing modules in
mega_code.clientor scripts inscripts/.
When adding or updating behavior:
- Put reusable logic in
mega_code/orscripts/. - Keep
SKILL.mdfiles focused on invocation workflow and operator guidance. - Reuse existing commands and paths where possible.
Before finishing a change, verify:
- referenced files and commands actually exist in this repo
- Claude skills use the
MEGA_DIRpattern when callinguv - hook commands use
${CLAUDE_PLUGIN_ROOT} - new server-facing commands document the required auth/env assumptions
- instructions do not mention commands or skills that are absent from this repo
- Duplicating Python business logic in
SKILL.md - hardcoded absolute paths in hooks or skills
- leaving stale references in docs after renaming files or commands