aiox-master
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/aiox-master/SKILL.md --> <!-- Source:…
Run a comprehensive diagnostic of the SYNAPSE context engine, comparing expected vs. actual pipeline state, including **session performance analysis** with exact timing data.
$ npx -y skills add SynkraAI/aiox-core --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/diagnose-synapseContext preview
What this command does when you run it.
Run a comprehensive diagnostic of the SYNAPSE context engine, comparing expected vs. actual pipeline state, including **session performance analysis** with exact timing data.
Run a comprehensive diagnostic of the SYNAPSE context engine, comparing expected vs. actual pipeline state, including **session performance analysis** with exact timing data.
Execute the following steps in order:
node -e "const {runDiagnostics}=require('./.aiox-core/core/synapse/diagnostics/synapse-diagnostics');console.log(runDiagnostics(process.cwd()))"Show the full markdown report output to the user.
If the report contains any FAIL or WARN items: 1. List each gap with its severity 2. Provide the recommended fix from the report 3. Ask the user if they want to apply any fixes
Run the timing analyzer to get **exact execution data** for this session:
node -e "
const fs = require('fs');
const path = require('path');
const os = require('os');
const LOG_DIR = path.join(os.homedir(), '.claude', 'logs');
const today = new Date().toISOString().slice(0, 10);
const logFile = path.join(LOG_DIR, 'timing-' + today + '.jsonl');
if (!fs.existsSync(logFile)) {
console.log('NO_TIMING_DATA');
process.exit(0);
}
const lines = fs.readFileSync(logFile, 'utf8').trim().split('\n');
const entries = lines.map(l => { try { return JSON.parse(l); } catch { return null; } }).filter(Boolean);
// Group by session
const sessions = {};
entries.forEach(e => {
if (!sessions[e.session]) sessions[e.session] = [];
sessions[e.session].push(e);
});
// Find the latest session (most likely current)
const sessionIds = Object.keys(sessions);
const latestSessionId = sessionIds[sessionIds.length - 1];
const currentEvents = sessions[latestSessionId] || [];
// Build JSON output for analysis
const result = {
date: today,
logFile,
totalSessions: sessionIds.length,
currentSession: {
id: latestSessionId ? latestSessionId.slice(0, 12) : null,
totalEntries: currentEvents.length,
firstEvent: currentEvents[0] ? currentEvents[0].timestamp : null,
lastEvent: currentEvents.length ? currentEvents[currentEvents.length - 1].timestamp : null,
wallClockMs: currentEvents.length >= 2
? currentEvents[currentEvents.length - 1].epochMs - currentEvents[0].epochMs
: 0,
timeline: [],
toolSummary: {},
gaps: [],
totalToolTimeMs: 0,
totalThinkingTimeMs: 0,
},
};
// Build timeline
let prevEpoch = null;
currentEvents.forEach(e => {
const gap = prevEpoch ? e.epochMs - prevEpoch : 0;
const item = {
time: e.timestamp ? e.timestamp.slice(11, 23) : '',
event: e.event === 'PreToolUse' ? 'START' : 'END',
tool: e.tool,
durationMs: e.durationMs || null,
gapMs: gap,
input: e.input || null,
};
result.currentSession.timeline.push(item);
prevEpoch = e.epochMs;
});
// Tool duration summary
currentEvents.filter(e => e.durationMs).forEach(e => {
if (!result.currentSession.toolSummary[e.tool]) {
result.currentSession.toolSummary[e.tool] = { calls: 0, totalMs: 0, maxMs: 0, durations: [] };
}
const ts = result.currentSession.toolSummary[e.tool];
ts.calls++;
ts.totalMs += e.durationMs;
ts.maxMs = Math.max(ts.maxMs, e.durationMs);
ts.durations.push(e.durationMs);
result.currentSession.totalToolTimeMs += e.durationMs;
});
// Gap analysis (thinking time between PostToolUse → PreToolUse)
for (let i = 1; i < currentEvents.length; i++) {
if (currentEvents[i].event === 'PreToolUse' && currentEvents[i - 1].event === 'PostToolUse') {
const gapMs = currentEvents[i].epochMs - currentEvents[i - 1].epochMs;
result.currentSession.gaps.push({
from: currentEvents[i - 1].tool,
to: currentEvents[i].tool,
gapMs,
});
result.currentSession.totalThinkingTimeMs += gapMs;
}
}
// Sort gaps descending
result.currentSession.gaps.sort((a, b) => b.gapMs - a.gapMs);
console.log(JSON.stringify(result, null, 2));
"Using the JSON output from Step 4, present a **Session Performance Report** with these sections:
| Metric | Value | |--------|-------| | Wall Clock Total | (firstEvent → lastEvent) | | Tool Execution Time | sum of all durationMs | | Thinking/Processing Time | total gaps between PostToolUse → PreToolUse | | Overhead Ratio | thinkingTime / wallClock as % |
Show every tool call in chronological order:
HH:MM:SS.mmm START ToolName — input summary HH:MM:SS.mmm END ToolName [Xms] (+Yms gap)
Highlight any gaps > 5 seconds with a warning marker.
Table sorted by total time descending:
| Tool | Calls | Total | Avg | Max | |------|-------|-------|-----|-----| | ... | | | | |
Show top 10 gaps (PostToolUse → PreToolUse), sorted descending:
| Gap | From → To | Analysis | |-----|-----------|----------| | Xs | Tool A → Tool B | (explain likely cause) |
For the Analysis column, infer causes:
Based on the data, provide a concrete diagnosis: 1. What % of total time was spent in tool execution vs thinking? 2. Which specific tool call or gap was the single largest time consumer? 3. Actionable recommendations to reduce total time
If Step 4 outputs `NO_TIMING_DATA`: 1. Inform the user that the timing hooks are not yet capturing data 2. Explain that timing data requires the `PreToolUse`/`PostToolUse` hooks in `~/.claude/settings.json` 3. Check if hooks are registered:
node -e "const s=require(require('os').homedir()+'/.claude/settings.json');console.log(JSON.stringify({pre:!!s.hooks?.PreToolUse,post:!!s.hooks?.PostToolUse}))"4. If hooks are missing,
🌐 README por idioma: EN | PT | ES | ZH Devolvendo às pessoas o poder de criar — Framework open source de orquestração de IA que devolve o controle a quem tem coragem de construir.
Repo: SynkraAI/aiox-core
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/aiox-master/SKILL.md --> <!-- Source:…
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/analyst/SKILL.md --> <!-- Source:…
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/architect/SKILL.md --> <!-- Source:…
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/data-engineer/SKILL.md --> <!-- Source:…
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/dev/SKILL.md --> <!-- Source:…
<!-- ACORE-CLAUDE-AGENT-COMMAND: legacy-shim --> <!-- Canonical Skill: .claude/skills/AIOX/agents/devops/SKILL.md --> <!-- Source:…