> /plugin marketplace add metraton/gaia> /plugin install gaia@gaia-marketplace
FAQ
gaia is a Claude Code plugin with 37 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes agent-approval-protocol, agent-contract-handoff, agent-creation. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Repo: metraton/gaia
Generative AI Architecture
Gaia is event-driven. Every capability in the codebase is attached to a moment in the Claude Code lifecycle โ a prompt arriving, a tool being called, an agent completing. Reading the folder structure without that lens makes it look like a collection of files. Reading it with that lens, everything clicks into place.
The flow is this: a user sends a prompt, the UserPromptSubmit hook fires and injects the orchestrator's identity and a routing recommendation. The orchestrator picks a specialist agent and dispatches it. Before that agent's first tool call lands, the PreToolUse hook intercepts it โ injecting context, validating permissions, blocking dangerous commands. The agent does its work and returns a agent_contract_handoff. The SubagentStop hook fires, validates the contract, records metrics, and writes to episodic memory.
UserPromptSubmit -> routing -> PreToolUse -> agent -> PostToolUse -> SubagentStop
| | | | | |
identity surface- security agent_contract_handoff audit log metrics +
injection routing.json gate + memory
context
injection
That pipeline is the spine. Everything else in this repo is either a component of that pipeline (hooks/, agents/, skills/, config/) or infrastructure that supports it (build/, bin/, tests/). Start with the folder that matches the behavior you want to understand, and its README will tell you where it fits in the flow.
Gaia is a security-first multi-agent orchestration plugin for Claude Code. It classifies every command by risk, gates state-changing operations behind consent, injects project context, and routes work to specialist agents. It ships as a single, unified plugin named gaia โ one artifact carrying the full orchestrator, all agents, all skills, all hooks, all tools, and all config.
agents/gaia-orchestrator.md, activated via settings.json agent config; skills loaded on-demandbash -c, eval, python -c wrappers that bypass regex patternsask dialoggaia memory CLI: FTS5 search, episode inspection, session context orientation, and curated-note curation (append/add/edit/reclassify/delete/link)Gaia is one plugin reaching a workspace through two surfaces. Pick the one that matches how you run Claude Code.
# Add the marketplace
/plugin marketplace add metraton/gaia
# Install the unified plugin
/plugin install gaia
npm install @jaguilar87/gaia # or: pnpm add @jaguilar87/gaia
gaia install # wires the workspace
There is no postinstall hook. The install is non-invasive and works identically under npm and pnpm. The DB is bootstrapped lazily on the first gaia CLI use (_ensure_db_bootstrapped in bin/gaia); the workspace .claude/ structure is written by running gaia install explicitly, or by the SessionStart hook. Run gaia doctor afterward to verify.
# Install the package
npm install @jaguilar87/gaia # or: pnpm add @jaguilar87/gaia
# Wire the workspace (no postinstall does this for you)
gaia install
To scan your project stack after install:
gaia scan
gaia install will:
~/.gaia/gaia.db) with the current schema (lazy on first use, or here explicitly).claude/ directory with 5 symlinks + a CHANGELOG.md link to this packagesettings.local.json (preserves existing user config)plugin-registry.json with installed[].name == "gaia"gaia scan (run separately, on-demand) will:
~/.gaia/gaia.db (DB is canonical; no project-context.json file is generated)No CLAUDE.md is generated -- orchestrator identity lives in agents/gaia-orchestrator.md and is activated via settings.json: { "agent": "gaia-orchestrator" }.
How Gaia's config reaches the workspace depends on the surface:
| File | Content | Strategy |
|---|---|---|
settings.local.json | Permissions (allow + deny), env vars, agent identity, and โ on the npm surface โ the 12 hook event entries | Union merge โ never removes user config |
settings.json | Created if missing; Gaia does not overwrite user hooks here | Left to the user |
hooks/hooks.json | The hook registrations Claude Code loads on the plugin surface (generated from build/gaia.manifest.json at pack time) | Regenerated at pack time |
On the npm/pnpm surface, gaia install merges the hook event entries from hooks.json into settings.local.json. On the plugin surface, Claude Code reads hooks directly from the package root's hooks/hooks.json โ the settings.local.json merge is skipped. Either way, the union merge into settings.local.json ensures your personal customizations (MCP servers, extra permissions) survive updates. The permission set itself is owned by hooks/modules/core/plugin_setup.py (OPS_PERMISSIONS), not by a template.
gaia install writes these for you; the manual equivalent is:
npm install @jaguilar87/gaia
Then create the 5 directory symlinks plus the CHANGELOG file link:
mkdir -p .claude && cd .claude
ln -s ../node_modules/@jaguilar87/gaia/agents agents
ln -s ../node_modules/@jaguilar87/gaia/tools tools
ln -s ../node_modules/@jaguilar87/gaia/hooks hooks
ln -s ../node_modules/@jaguilar87/gaia/config config
ln -s ../node_modules/@jaguilar87/gaia/skills skills
ln -s ../node_modules/@jaguilar87/gaia/CHANGELOG.md CHANGELOG.md
Once installed, the agent system is ready:
claude
The orchestrator identity is defined in agents/gaia-orchestrator.md and activated via settings.json agent config. Skills are loaded on-demand.
Skill loading and overall installation health are checked via:
gaia doctor
Gaia enforces a 6-layer security pipeline:
| Layer | Mechanism | Bypassable? |
|---|---|---|
| Indirect execution detection | bash -c, eval, python -c wrappers | No (hook-level) |
| Blocked commands (regex) | Regex patterns for irreversible commands | No (enforced from plugin source) |
| Blocked commands (semantic) | Ordered-token / mutative-verb rules | No (enforced from plugin source) |
| Cloud pipe validator | Credential piping detection | No (hook-level) |
| Mutative verb detection | ask dialog for state-changing ops | User approves via native dialog |
| Settings deny rules | 100+ deny rules generated at install into settings.local.json | Self-healing (restored each session) |
gaia/
โโโ agents/ # Agent definitions (9 agents) โ specialist identities + tool grants
โโโ skills/ # Skill modules (37 skills) โ injected procedural knowledge
โโโ hooks/ # Claude Code hooks โ the event-driven pipeline
โโโ config/ # Configuration โ routing, contracts, rules, git standards
โโโ build/ # Plugin manifests โ hook + agent registration for Claude Code
โโโ bin/ # Single `gaia` CLI; subcommands discovered from bin/cli/
โโโ tests/ # Test suite โ 3-layer pyramid (pytest, LLM eval, e2e)
โโโ tools/ # Context provisioning tools
import { getAgentPath, getToolPath, getConfigPath } from '@jaguilar87/gaia';
const agentPath = getAgentPath('gitops-operator');
const toolPath = getToolPath('context_provider.py');
This package follows Semantic Versioning:
See CHANGELOG.md for version history.
Gaia uses ~/.gaia/gaia.db (SQLite) as the canonical store for project context. Run gaia scan inside a workspace to detect and record the project stack, GitOps layout, Terraform layout, and other structural facts. Context is scoped per-workspace and survives reinstalls. View it with:
gaia context show
MIT License - See LICENSE for details.
.claude-plugin/
marketplace.json
plugin.json
.env.example
.eslintrc.json
.github/
ISSUE_TEMPLATE/
bug_report.md
feature_request.md
PULL_REQUEST_TEMPLATE.md
workflows/
ci.yml
publish.yml
.gitignore
.npmignore
agents/
cloud-troubleshooter.md
developer.md
gaia-operator.md
gaia-orchestrator.md
gaia-planner.md
gaia-system.md
gaia-verifier.md
gitops-operator.md
platform-architect.md
README.md
architecture-viewer.html
architecture.json
ARCHITECTURE.md
bin/
cli/
__init__.py
_converge.py
_install_helpers.py
_pack_helpers.py
ac.py
approvals.py
brief.py
cleanup.py
context.py
contract.py
defects.py
dev.py
doctor.py
evidence.py
history.py
install.py
memory_story.py
memory.py
metrics.py
milestone.py
notifications.py
paths.py
plan.py
query.py
release.py
scan.py
schedule.py
status.py
task.py
uninstall.py
update.py
workspace.py
gaia
plugin-dryrun.sh
pre-publish-validate.js
python-detect.js
README.md
validate-sandbox.sh
build/
gaia.manifest.json
README.md
CHANGELOG.md
CODE_OF_CONDUCT.md
config/
README.md
CONTRIBUTING.md
evidence/
incidents/
agent-collision-a9f31e2/
a9f31e2.a8dae04f0cee.json
NOTES.md
gaia/
__init__.py
approvals/
__init__.py
chain.py
display.py
store.py
briefs/
__init__.py
serializer.py
store.py
contract/
__init__.py
crosscheck.py
drafts.py
validator.py
view.py
dev_builds.py
evidence/
__init__.py
fs.py
store.py
hooks_build.py
identity_shape.py
paths/
__init__.py
layout.py
README.md
resolver.py
snapshot.py
project.py
README.md
schedulers/
__init__.py
base.py
cron.py
reconcile.py
state/
__init__.py
check_clauses.py
gate_oracle.py
gate_validation.py
permissions.py
task_closure_condition.py
task_closure_derivation.py
task_closure_event.py
task_closure_identity.py
task_closure.py
transitions.py
store/
__init__.py
NOTICE.md
provider.py
reader.py
schema.sql
writer.py
hooks/
adapters/
__init__.py
base.py
channel.py
claude_code.py
host_session.py
host_transcript.py
registry.py
types.py
utils.py
elicitation_result.py
hooks.json
modules/
__init__.py
agents/
__init__.py
artifact_skill_map.py
artifact_skill_reminder.py
contract_validator.py
defect_capture.py
dispatch_binding.py
dispatch_identity.py
handoff_persister.py
rejected_turn_relay.py
response_contract.py
skill_injection_verifier.py
state_tracker.py
task_info_builder.py
task_result_observer.py
transcript_analyzer.py
transcript_reader.py
audit/
__init__.py
event_detector.py
logger.py
metrics.py
workflow_auditor.py
workflow_recorder.py
context/
__init__.py
agentic_loop_detector.py
anchor_tracker.py
compact_context_builder.py
context_freshness.py
context_injector.py
context_writer.py
contracts_loader.py
core/
__init__.py
filelock.py
hook_entry.py
hook_trace.py
logging_setup.py
operational_errors.py
paths.py
plugin_mode.py
plugin_setup.py
state.py
stdin.py
workspace_bootstrap.py
events/
__init__.py
event_writer.py
install_detector.py
memory/
__init__.py
episode_writer.py
orchestrator/
__init__.py
delegate_mode.py
README.md
scanning/
__init__.py
scan_trigger.py
security/
__init__.py
approval_cleanup.py
approval_constants.py
approval_grants.py
approval_messages.py
approval_scopes.py
blocked_commands.py
blocked_message_formatter.py
capability_classes.py
command_semantics.py
composition_rules.py
flag_classifiers.py
gaia_cli_only_guard.py
gaia_db_write_guard.py
inline_ast_analyzer.py
mutative_verbs.py
network_hosts.py
prompt_validator.py
protected_path_guard.py
shell_unwrapper.py
source_lexer.py
subagent_memory_write_guard.py
tiers.py
session/
__init__.py
contract_drafts_gc.py
db_backup.py
pending_scanner.py
session_context_writer.py
session_event_injector.py
session_manager.py
session_manifest.py
session_registry.py
tools/
__init__.py
bash_validator.py
cloud_pipe_validator.py
hook_response.py
shell_parser.py
stage_decomposer.py
task_validator.py
validation/
__init__.py
commit_validator.py
post_compact.py
post_tool_use.py
pre_compact.py
pre_tool_use.py
README.md
session_end_hook.py
session_start.py
stop_hook.py
subagent_start.py
subagent_stop.py
task_completed.py
user_prompt_submit.py
index.js
INSTALL.md
LICENSE
package-lock.json
package.json
pyproject.toml
README.md
scripts/
bootstrap_database.py
bootstrap_database.sh
build-plugin.py
check_contract_history_revalidation.py
check_hooks_drift.py
check_schema_drift.py
migrations/
README.md
schema.checksum
v18_to_v19.sql
v19_to_v20.sql
v20_to_v21.sql
v21_to_v22.sql
v22_to_v23.sql
v23_to_v24.sql
v24_to_v25.sql
v25_to_v26.sql
v26_to_v27.sql
v27_to_v28.sql
v28_to_v29.sql
v29_to_v30.sql
v30_to_v31.sql
v31_to_v32.sql
v32_to_v33.sql
v33_to_v34.sql
v34_to_v35.sql
v35_to_v36.sql
v36_to_v37.sql
v37_to_v38.sql
v38_to_v39.sql
v39_to_v40.sql
release-prepare.mjs
seed_agent_permissions.py
SECURITY.md
settings.json
skills/
agent-approval-protocol/
reference.md
SKILL.md
agent-contract-handoff/
SKILL.md
agent-creation/
examples.md
reference.md
SKILL.md
agent-protocol/
examples.md
SKILL.md
agent-response/
SKILL.md
agentic-loop/
reference.md
SKILL.md
blog-writing/
reference.md
SKILL.md
brief-spec/
SKILL.md
coding-standards/
reference.md
SKILL.md
command-execution/
reference.md
SKILL.md
diagram-builder/
assets/
data/
data.generated.js
document.yaml
pages/
overview.yaml
p1-merged-cell.yaml
p2-cells-or-zones.yaml
p3-sequence.yaml
p4-slots.yaml
p5-channels.yaml
p6-relations.yaml
p7-structure.yaml
p8-does-not-fit.yaml
p9-the-hole.yaml
engine/
build-data.mjs
engine.js
index.html
package-lock.json
package.json
README.md
tools/
check-layout.mjs
contrast-audit.cjs
static-census.cjs
test-guards.mjs
validate-layout.cjs
verify.mjs
GLOSSARY.md
reference.md
SKILL.md
execution/
SKILL.md
fast-queries/
SKILL.md
gaia-audit/
SKILL.md
gaia-compact/
SKILL.md
gaia-patterns/
reference.md
SKILL.md
gaia-planner/
reference.md
SKILL.md
gaia-release/
reference.md
SKILL.md
gaia-verify/
reference.md
SKILL.md
git-conventions/
SKILL.md
gmail-policy/
reference.md
SKILL.md
... 711 moreยฉ 2026 Flowy ยท Free and open source
Built for Claude Code ยท Not affiliated with Anthropic