[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69BGT14VQD1M3P12WZGTQCS":3,"skill-same:01M69BGT14VQD1M3P12WZGTQCS":49},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M69BGT14VQD1M3P12WZGTQCS","context-intelligence-session-navigation",null,"Use for workspace-scoped local session discovery and event, tool, error, or capture inspection in JSONL files, independent of graph availability.","microsoft\u002Famplifier-bundle-context-intelligence","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69BGBVCCWXG1MNNF1E8TCWN",5,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-session-navigation\u002FSKILL.md",[],[19],"context intelligence session navigation","2026-11-10 10:12:30",false,"---\nname: context-intelligence-session-navigation\ndescription: 'Use for workspace-scoped local session discovery and event, tool, error, or capture inspection in JSONL files, independent of graph availability.'\nversion: 0.2.0\nlicense: MIT\n---\n\n# Context Intelligence Session Navigation\n\nThis skill covers bounded navigation of local JSONL captures written by the\n`LoggingHandler`. Capture presence must be observed, not assumed: logging may not\nhave been enabled, the root may differ, or retained data may be incomplete.\nLocal inspection needs no graph health check. For user\u002Fassistant conversation,\nuse the mounted `session_transcript` tool rather than shell-extracting message\nbodies; preserve its capture-selection errors instead of silently switching readers.\nUse shell tools (`jq`, `grep`, `wc`, `head`) for bounded event and metadata work.\n\nNative CI captures use the nested `context-intelligence\u002Fevents.jsonl` path below.\nFoundation session files outside that directory are a different evidence source,\nnot interchangeable CI captures. Report which source and scope you inspected.\nA stored lifecycle label such as `running` is not proof of current liveness;\nneither that label nor the newest observed event timestamp guarantees completeness.\nState observed freshness and coverage, not an inferred current state.\n\nFor the complete event-by-event field reference, see `context\u002Fevent-schema.md`.\nFor ready-to-use jq\u002Fgrep recipes, see `context\u002Fsafe-extraction-patterns.md`.\n\n---\n\n## Disk Layout\n\nResolve the root once before any discovery:\n\n```bash\nCONTEXT_INTELLIGENCE_ROOT=\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"\n```\n\n```\n$CONTEXT_INTELLIGENCE_ROOT\u002F{project-slug}\u002Fsessions\u002F{session_id}\u002Fcontext-intelligence\u002F\n├── events.jsonl      # one JSON object per line, append-only\n└── metadata.json     # session metadata, written on start, updated on end\n```\n\n- `$CONTEXT_INTELLIGENCE_ROOT` — resolved from the idiom `\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"` (unset → legacy default). **Relocation is reader-visible ONLY via this env var.** The hook's `config.base_path` moves where the *writer* stores captures, but readers (this skill, `discover.py`, the recipe) resolve the root solely from the env var — so always relocate via `AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH`, not `config.base_path` alone, or readers will look in the wrong place.\n- `{project-slug}` — derived from the full working directory path (see Project Slug Algorithm below)\n- `{session_id}` — unique session identifier (UUID or UUID with agent suffix for child sessions)\n- `context-intelligence\u002F` — subdirectory containing the session data files\n- `events.jsonl` — append-only log of every event the kernel emits during the session\n- `metadata.json` — compact session metadata for quick lookup without parsing the full event log\n\nExample paths (with root resolved):\n\n```\n$CONTEXT_INTELLIGENCE_ROOT\u002F-home-user-myapp\u002Fsessions\u002F55c8841a-1234-5678-9abc-def012345678\u002Fcontext-intelligence\u002Fevents.jsonl\n$CONTEXT_INTELLIGENCE_ROOT\u002F-home-user-myapp\u002Fsessions\u002F55c8841a-1234-5678-9abc-def012345678\u002Fcontext-intelligence\u002Fmetadata.json\n```\n\n> **⚠ MARKER RULE — the defect this prevents:** Every discovery glob MUST include the\n> `context-intelligence\u002F` path segment and MUST NOT stop at `sessions\u002F\u003Cid>\u002F`:\n>\n> ```\n> CORRECT:  \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl\n> WRONG:    \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fmetadata.json   # catches Amplifier core's files\n> ```\n>\n> **Why:** Amplifier core writes `sessions\u002F\u003Cid>\u002Fmetadata.json` with NO `context-intelligence\u002F`\n> segment. Globbing one level too shallow latches onto core's files and produces a confident\n> wrong count.\n>\n> **Canonical marker = `events.jsonl`.** The Python readers (`discover.py`, the workflow\n> recipe) treat `context-intelligence\u002Fevents.jsonl` as the single discriminator of a real\n> capture. `metadata.json` is used here only to read fields (`workspace`, `status`, …); both\n> files are written together, so either glob includes the `context-intelligence\u002F` segment and\n> avoids the false-positive. When you need a strict capture count that matches the code,\n> glob `events.jsonl`, not `metadata.json`.\n\n> **⚠ FAIL-LOUD RULE:** When zero captures are found, say exactly `\"looked in \u003Croot>, found 0\"` —\n> never report a confident count from a shallower glob, never silently fall back to a different path.\n\n---\n\n## Record Format\n\nEach line in `events.jsonl` is a single JSON object with exactly **four** fields, always in this order:\n\n```json\n{\"event\":\"tool:pre\",\"workspace\":\"my-project\",\"timestamp\":\"2026-03-10T11:13:09.792+00:00\",\"data\":{...}}\n```\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `event` | string | Event name in `{namespace}:{action}` format |\n| `workspace` | string | Workspace scope — always present, empty string `\"\"` when not configured |\n| `timestamp` | string | ISO 8601 timestamp of when the event was recorded |\n| `data` | object | Raw event payload, exactly as the kernel emitted it |\n\n**Key principle:** No field promotion, no level classification, no payload mutation. What the kernel emits is exactly what gets stored in `data`. The `workspace` field is the only addition the hook makes — it is injected at write time from `ConfigResolver.workspace`.\n\n---\n\n## metadata.json\n\nWritten on `session:start` or `session:fork`, updated on `session:end`.\n\n### Required Fields (always present)\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `format` | string | Schema family identifier, always `\"context-intelligence\"` |\n| `version` | string | Schema version, always `\"1.0.0\"` |\n| `session_id` | string | Unique session identifier |\n| `workspace` | string | Workspace scope — same value as in `events.jsonl`, empty string if not configured |\n| `parent_id` | string | Parent session identifier (empty string for root sessions) |\n| `started_at` | string | ISO 8601 timestamp |\n| `status` | string | `\"running\"` \u002F `\"completed\"` \u002F `\"failed\"` \u002F `\"cancelled\"` |\n| `working_dir` | string | Working directory path |\n\n### Optional Fields (omitted when absent — no nulls)\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `agent_name` | string | Agent name (e.g., `\"foundation:explorer\"`) |\n| `parallel_group_id` | string | Parallel execution group identifier |\n| `recipe_name` | string | Recipe name if in recipe context |\n| `recipe_step` | string | Recipe step if in recipe context |\n| `ended_at` | string | ISO 8601 timestamp (added on `session:end`) |\n\nOptional fields are omitted entirely when absent — no null values, compact JSON.\n\nExample (minimal root session):\n\n```json\n{\"format\":\"context-intelligence\",\"version\":\"1.0.0\",\"session_id\":\"55c8841a-...\",\"workspace\":\"my-project\",\"parent_id\":\"\",\"started_at\":\"2026-03-10T11:13:09.000+00:00\",\"status\":\"running\",\"working_dir\":\"\u002Fhome\u002Fuser\u002Fmyapp\"}\n```\n\nExample (child session with optional fields):\n\n```json\n{\"format\":\"context-intelligence\",\"version\":\"1.0.0\",\"session_id\":\"55c8841a-...-foundation:explorer\",\"workspace\":\"my-project\",\"parent_id\":\"1cb9e5f5-...\",\"started_at\":\"2026-03-10T11:13:09.000+00:00\",\"status\":\"completed\",\"ended_at\":\"2026-03-10T11:15:42.000+00:00\",\"working_dir\":\"\u002Fhome\u002Fuser\u002Fmyapp\",\"agent_name\":\"foundation:explorer\",\"recipe_name\":\"code-review\",\"recipe_step\":\"analyze\"}\n```\n\n---\n\n## Workspace and Project Slug\n\n**Workspace** scopes all event data. It is written into every `events.jsonl` line and `metadata.json`. Two concepts work together:\n\n| Concept | Purpose | Where used |\n|---------|---------|------------|\n| `project_slug` | Directory name under `$CONTEXT_INTELLIGENCE_ROOT\u002F` | On-disk path |\n| `workspace` | Field in every record | Querying and filtering |\n\nBy **default** workspace equals `project_slug` (both derived from the working directory). They can differ when workspace is set explicitly via `settings.yaml` or env var — for example, workspace `\"my-api\"` while project_slug is `\"-home-user-myapp\"`.\n\n**Consequence for navigation:**\n- **Directory-first lookup** — when workspace matches the project_slug, all sessions for that workspace live under `$CONTEXT_INTELLIGENCE_ROOT\u002F{workspace}\u002Fsessions\u002F`. This is fast and the common case.\n- **Field-based filtering** — when workspace was set explicitly (overriding the slug default), scan across all project directories and filter records by `jq 'select(.workspace == \"TARGET\")'`.\n\nAlways check both: attempt directory lookup first, then fall back to cross-project field scan.\n\n---\n\n## Project Slug Algorithm\n\nThe project slug is derived from the **full absolute path** of the working directory:\n\n1. Take the resolved absolute path of `working_dir`\n2. Replace every `\u002F` with `-` and every `\\` with `-`\n3. Remove `:` (Windows drive letters)\n4. If the result does not start with `-`, prepend `-`\n5. Use `\"default\"` if the result is empty\n\nExamples:\n\n| Working Directory | Slug |\n|-------------------|------|\n| `\u002Fworkspace` | `-workspace` |\n| `\u002Fhome\u002Fuser\u002Fmy-api` | `-home-user-my-api` |\n| `\u002Fhome\u002Fuser\u002Frepos\u002Famplifier-core` | `-home-user-repos-amplifier-core` |\n\n> Note: the slug encodes the **full path**, not just the basename. `\u002Fhome\u002Falice\u002Fmyapp` and `\u002Fhome\u002Fbob\u002Fmyapp` get different slugs: `-home-alice-myapp` and `-home-bob-myapp`.\n\n---\n\n## Safe Extraction Discipline\n\nSession event files can contain lines with 100k+ tokens (e.g., `llm:response` with full model output). Four golden rules protect against context overflow:\n\n1. **Never `cat` an events.jsonl file.** A single line can be larger than your entire context window. Always use targeted extraction.\n\n2. **Use `jq -c` for structured queries.** The `-c` flag keeps output compact (one line per result). Always filter to specific fields rather than dumping entire records.\n\n3. **Use `grep -n | cut` for line-targeted extraction.** First find matching line numbers with `grep -n`, then extract specific lines with `sed` or `head`\u002F`tail`. Never pipe raw grep output of event data into your context.\n\n4. **Preview with `wc -l` and `head` before extracting.** Always check file size and peek at the first few lines before running any extraction. This prevents accidentally pulling in massive files.\n\n---\n\n## Common Navigation Patterns\n\nResolve the root once before all discovery snippets in this section:\n\n```bash\nCONTEXT_INTELLIGENCE_ROOT=\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"\n```\n\n### Resolve workspace to a project directory\n\n```bash\n# If workspace == project_slug (common default), sessions are here:\nls \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F{workspace}\u002Fsessions\u002F\n\n# If workspace was set explicitly and differs from project_slug,\n# find all directories containing sessions tagged with this workspace:\ngrep -rl '\"workspace\":\"{workspace}\"' \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fmetadata.json \\\n  | sed 's|\u002Fcontext-intelligence\u002Fmetadata.json||'\n```\n\n### List all sessions for a workspace\n\n```bash\n# Fast path: workspace matches directory name (default case)\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002Fmy-project\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r '[.session_id, .status, .started_at, .agent_name \u002F\u002F \"(root)\"] | join(\"\\t\")' \"$f\" 2>\u002Fdev\u002Fnull\ndone | sort -t$'\\t' -k3\n\n# Scoped path: workspace set explicitly — scan all projects, filter by field\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.workspace == \"my-project\") | [.session_id, .status, .started_at, .agent_name \u002F\u002F \"(root)\"] | join(\"\\t\")' \"$f\" 2>\u002Fdev\u002Fnull\ndone | sort -t$'\\t' -k3\n```\n\n### Check what workspace a session belongs to\n\n```bash\njq -r '.workspace' metadata.json\n# or from events.jsonl (first line only — safe):\nhead -1 events.jsonl | jq -r '.workspace'\n```\n\n### Filter events by workspace across a project\n\n```bash\n# Count events per workspace across all sessions in a project directory:\njq -r '.workspace' \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F-home-user-myapp\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl \\\n  | sort | uniq -c | sort -rn\n```\n\n### Find sessions by status within a workspace\n\n```bash\n# Within a single project directory:\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002Fmy-project\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.status == \"running\") | .session_id' \"$f\" 2>\u002Fdev\u002Fnull\ndone\n\n# Cross-project, scoped to workspace:\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.workspace == \"my-project\" and .status == \"running\") | .session_id' \"$f\" 2>\u002Fdev\u002Fnull\ndone\n```\n\n### Event summary for a session\n\n```bash\n# Count total events\nwc -l \u003C events.jsonl\n\n# Count events by type\njq -c '.event' events.jsonl | sort | uniq -c | sort -rn\n```\n\n### Find errors in a session\n\n```bash\n# Find error event line numbers only (never output the full lines)\ngrep -n '\"event\":\"orchestrator:error\"\\|\"event\":\"tool:error\"' events.jsonl | cut -d: -f1\n```\n\n### Extract a specific event by line number\n\n```bash\nsed -n '42p' events.jsonl | jq -c '{event, workspace, ts: .timestamp}'\n```\n\n### Count events by type in a session\n\n```bash\ngrep -c '\"event\":\"tool:pre\"' events.jsonl\n```\n\n---\n\n## Event Name Taxonomy\n\nAll events follow the `{namespace}:{action}` naming convention:\n\n| Namespace | Events | Description |\n|-----------|--------|-------------|\n| `session` | `start`, `fork`, `end` | Session lifecycle |\n| `prompt` | `submit` | User prompt submission |\n| `provider` | `request`, `response` | Provider API calls |\n| `llm` | `request`, `response` | LLM inference |\n| `tool` | `pre`, `post`, `error` | Tool execution lifecycle |\n| `orchestrator` | `start`, `complete`, `error` | Orchestrator run lifecycle |\n| `context` | `compaction` | Context window management |\n| `cancel` | `requested`, `completed` | Cancellation lifecycle |\n| `recipe` | `start`, `step`, `complete`, `approval`, `loop_iteration`, `loop_complete` | Recipe orchestration |\n| `delegate` | `agent_spawned`, `agent_completed`, `context_inherited`, `session_resumed` | Agent delegation |\n\nFor the complete field reference for each event, see `context\u002Fevent-schema.md`.\n","# Context Intelligence Session Navigation\n\nThis skill covers bounded navigation of local JSONL captures written by the\n`LoggingHandler`. Capture presence must be observed, not assumed: logging may not\nhave been enabled, the root may differ, or retained data may be incomplete.\nLocal inspection needs no graph health check. For user\u002Fassistant conversation,\nuse the mounted `session_transcript` tool rather than shell-extracting message\nbodies; preserve its capture-selection errors instead of silently switching readers.\nUse shell tools (`jq`, `grep`, `wc`, `head`) for bounded event and metadata work.\n\nNative CI captures use the nested `context-intelligence\u002Fevents.jsonl` path below.\nFoundation session files outside that directory are a different evidence source,\nnot interchangeable CI captures. Report which source and scope you inspected.\nA stored lifecycle label such as `running` is not proof of current liveness;\nneither that label nor the newest observed event timestamp guarantees completeness.\nState observed freshness and coverage, not an inferred current state.\n\nFor the complete event-by-event field reference, see `context\u002Fevent-schema.md`.\nFor ready-to-use jq\u002Fgrep recipes, see `context\u002Fsafe-extraction-patterns.md`.\n\n---\n\n## Disk Layout\n\nResolve the root once before any discovery:\n\n```bash\nCONTEXT_INTELLIGENCE_ROOT=\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"\n```\n\n```\n$CONTEXT_INTELLIGENCE_ROOT\u002F{project-slug}\u002Fsessions\u002F{session_id}\u002Fcontext-intelligence\u002F\n├── events.jsonl      # one JSON object per line, append-only\n└── metadata.json     # session metadata, written on start, updated on end\n```\n\n- `$CONTEXT_INTELLIGENCE_ROOT` — resolved from the idiom `\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"` (unset → legacy default). **Relocation is reader-visible ONLY via this env var.** The hook's `config.base_path` moves where the *writer* stores captures, but readers (this skill, `discover.py`, the recipe) resolve the root solely from the env var — so always relocate via `AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH`, not `config.base_path` alone, or readers will look in the wrong place.\n- `{project-slug}` — derived from the full working directory path (see Project Slug Algorithm below)\n- `{session_id}` — unique session identifier (UUID or UUID with agent suffix for child sessions)\n- `context-intelligence\u002F` — subdirectory containing the session data files\n- `events.jsonl` — append-only log of every event the kernel emits during the session\n- `metadata.json` — compact session metadata for quick lookup without parsing the full event log\n\nExample paths (with root resolved):\n\n```\n$CONTEXT_INTELLIGENCE_ROOT\u002F-home-user-myapp\u002Fsessions\u002F55c8841a-1234-5678-9abc-def012345678\u002Fcontext-intelligence\u002Fevents.jsonl\n$CONTEXT_INTELLIGENCE_ROOT\u002F-home-user-myapp\u002Fsessions\u002F55c8841a-1234-5678-9abc-def012345678\u002Fcontext-intelligence\u002Fmetadata.json\n```\n\n> **⚠ MARKER RULE — the defect this prevents:** Every discovery glob MUST include the\n> `context-intelligence\u002F` path segment and MUST NOT stop at `sessions\u002F\u003Cid>\u002F`:\n>\n> ```\n> CORRECT:  \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl\n> WRONG:    \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fmetadata.json   # catches Amplifier core's files\n> ```\n>\n> **Why:** Amplifier core writes `sessions\u002F\u003Cid>\u002Fmetadata.json` with NO `context-intelligence\u002F`\n> segment. Globbing one level too shallow latches onto core's files and produces a confident\n> wrong count.\n>\n> **Canonical marker = `events.jsonl`.** The Python readers (`discover.py`, the workflow\n> recipe) treat `context-intelligence\u002Fevents.jsonl` as the single discriminator of a real\n> capture. `metadata.json` is used here only to read fields (`workspace`, `status`, …); both\n> files are written together, so either glob includes the `context-intelligence\u002F` segment and\n> avoids the false-positive. When you need a strict capture count that matches the code,\n> glob `events.jsonl`, not `metadata.json`.\n\n> **⚠ FAIL-LOUD RULE:** When zero captures are found, say exactly `\"looked in \u003Croot>, found 0\"` —\n> never report a confident count from a shallower glob, never silently fall back to a different path.\n\n---\n\n## Record Format\n\nEach line in `events.jsonl` is a single JSON object with exactly **four** fields, always in this order:\n\n```json\n{\"event\":\"tool:pre\",\"workspace\":\"my-project\",\"timestamp\":\"2026-03-10T11:13:09.792+00:00\",\"data\":{...}}\n```\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `event` | string | Event name in `{namespace}:{action}` format |\n| `workspace` | string | Workspace scope — always present, empty string `\"\"` when not configured |\n| `timestamp` | string | ISO 8601 timestamp of when the event was recorded |\n| `data` | object | Raw event payload, exactly as the kernel emitted it |\n\n**Key principle:** No field promotion, no level classification, no payload mutation. What the kernel emits is exactly what gets stored in `data`. The `workspace` field is the only addition the hook makes — it is injected at write time from `ConfigResolver.workspace`.\n\n---\n\n## metadata.json\n\nWritten on `session:start` or `session:fork`, updated on `session:end`.\n\n### Required Fields (always present)\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `format` | string | Schema family identifier, always `\"context-intelligence\"` |\n| `version` | string | Schema version, always `\"1.0.0\"` |\n| `session_id` | string | Unique session identifier |\n| `workspace` | string | Workspace scope — same value as in `events.jsonl`, empty string if not configured |\n| `parent_id` | string | Parent session identifier (empty string for root sessions) |\n| `started_at` | string | ISO 8601 timestamp |\n| `status` | string | `\"running\"` \u002F `\"completed\"` \u002F `\"failed\"` \u002F `\"cancelled\"` |\n| `working_dir` | string | Working directory path |\n\n### Optional Fields (omitted when absent — no nulls)\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `agent_name` | string | Agent name (e.g., `\"foundation:explorer\"`) |\n| `parallel_group_id` | string | Parallel execution group identifier |\n| `recipe_name` | string | Recipe name if in recipe context |\n| `recipe_step` | string | Recipe step if in recipe context |\n| `ended_at` | string | ISO 8601 timestamp (added on `session:end`) |\n\nOptional fields are omitted entirely when absent — no null values, compact JSON.\n\nExample (minimal root session):\n\n```json\n{\"format\":\"context-intelligence\",\"version\":\"1.0.0\",\"session_id\":\"55c8841a-...\",\"workspace\":\"my-project\",\"parent_id\":\"\",\"started_at\":\"2026-03-10T11:13:09.000+00:00\",\"status\":\"running\",\"working_dir\":\"\u002Fhome\u002Fuser\u002Fmyapp\"}\n```\n\nExample (child session with optional fields):\n\n```json\n{\"format\":\"context-intelligence\",\"version\":\"1.0.0\",\"session_id\":\"55c8841a-...-foundation:explorer\",\"workspace\":\"my-project\",\"parent_id\":\"1cb9e5f5-...\",\"started_at\":\"2026-03-10T11:13:09.000+00:00\",\"status\":\"completed\",\"ended_at\":\"2026-03-10T11:15:42.000+00:00\",\"working_dir\":\"\u002Fhome\u002Fuser\u002Fmyapp\",\"agent_name\":\"foundation:explorer\",\"recipe_name\":\"code-review\",\"recipe_step\":\"analyze\"}\n```\n\n---\n\n## Workspace and Project Slug\n\n**Workspace** scopes all event data. It is written into every `events.jsonl` line and `metadata.json`. Two concepts work together:\n\n| Concept | Purpose | Where used |\n|---------|---------|------------|\n| `project_slug` | Directory name under `$CONTEXT_INTELLIGENCE_ROOT\u002F` | On-disk path |\n| `workspace` | Field in every record | Querying and filtering |\n\nBy **default** workspace equals `project_slug` (both derived from the working directory). They can differ when workspace is set explicitly via `settings.yaml` or env var — for example, workspace `\"my-api\"` while project_slug is `\"-home-user-myapp\"`.\n\n**Consequence for navigation:**\n- **Directory-first lookup** — when workspace matches the project_slug, all sessions for that workspace live under `$CONTEXT_INTELLIGENCE_ROOT\u002F{workspace}\u002Fsessions\u002F`. This is fast and the common case.\n- **Field-based filtering** — when workspace was set explicitly (overriding the slug default), scan across all project directories and filter records by `jq 'select(.workspace == \"TARGET\")'`.\n\nAlways check both: attempt directory lookup first, then fall back to cross-project field scan.\n\n---\n\n## Project Slug Algorithm\n\nThe project slug is derived from the **full absolute path** of the working directory:\n\n1. Take the resolved absolute path of `working_dir`\n2. Replace every `\u002F` with `-` and every `\\` with `-`\n3. Remove `:` (Windows drive letters)\n4. If the result does not start with `-`, prepend `-`\n5. Use `\"default\"` if the result is empty\n\nExamples:\n\n| Working Directory | Slug |\n|-------------------|------|\n| `\u002Fworkspace` | `-workspace` |\n| `\u002Fhome\u002Fuser\u002Fmy-api` | `-home-user-my-api` |\n| `\u002Fhome\u002Fuser\u002Frepos\u002Famplifier-core` | `-home-user-repos-amplifier-core` |\n\n> Note: the slug encodes the **full path**, not just the basename. `\u002Fhome\u002Falice\u002Fmyapp` and `\u002Fhome\u002Fbob\u002Fmyapp` get different slugs: `-home-alice-myapp` and `-home-bob-myapp`.\n\n---\n\n## Safe Extraction Discipline\n\nSession event files can contain lines with 100k+ tokens (e.g., `llm:response` with full model output). Four golden rules protect against context overflow:\n\n1. **Never `cat` an events.jsonl file.** A single line can be larger than your entire context window. Always use targeted extraction.\n\n2. **Use `jq -c` for structured queries.** The `-c` flag keeps output compact (one line per result). Always filter to specific fields rather than dumping entire records.\n\n3. **Use `grep -n | cut` for line-targeted extraction.** First find matching line numbers with `grep -n`, then extract specific lines with `sed` or `head`\u002F`tail`. Never pipe raw grep output of event data into your context.\n\n4. **Preview with `wc -l` and `head` before extracting.** Always check file size and peek at the first few lines before running any extraction. This prevents accidentally pulling in massive files.\n\n---\n\n## Common Navigation Patterns\n\nResolve the root once before all discovery snippets in this section:\n\n```bash\nCONTEXT_INTELLIGENCE_ROOT=\"${AMPLIFIER_CONTEXT_INTELLIGENCE_BASE_PATH:-$HOME\u002F.amplifier\u002Fprojects}\"\n```\n\n### Resolve workspace to a project directory\n\n```bash\n# If workspace == project_slug (common default), sessions are here:\nls \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F{workspace}\u002Fsessions\u002F\n\n# If workspace was set explicitly and differs from project_slug,\n# find all directories containing sessions tagged with this workspace:\ngrep -rl '\"workspace\":\"{workspace}\"' \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fmetadata.json \\\n  | sed 's|\u002Fcontext-intelligence\u002Fmetadata.json||'\n```\n\n### List all sessions for a workspace\n\n```bash\n# Fast path: workspace matches directory name (default case)\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002Fmy-project\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r '[.session_id, .status, .started_at, .agent_name \u002F\u002F \"(root)\"] | join(\"\\t\")' \"$f\" 2>\u002Fdev\u002Fnull\ndone | sort -t$'\\t' -k3\n\n# Scoped path: workspace set explicitly — scan all projects, filter by field\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.workspace == \"my-project\") | [.session_id, .status, .started_at, .agent_name \u002F\u002F \"(root)\"] | join(\"\\t\")' \"$f\" 2>\u002Fdev\u002Fnull\ndone | sort -t$'\\t' -k3\n```\n\n### Check what workspace a session belongs to\n\n```bash\njq -r '.workspace' metadata.json\n# or from events.jsonl (first line only — safe):\nhead -1 events.jsonl | jq -r '.workspace'\n```\n\n### Filter events by workspace across a project\n\n```bash\n# Count events per workspace across all sessions in a project directory:\njq -r '.workspace' \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F-home-user-myapp\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl \\\n  | sort | uniq -c | sort -rn\n```\n\n### Find sessions by status within a workspace\n\n```bash\n# Within a single project directory:\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002Fmy-project\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.status == \"running\") | .session_id' \"$f\" 2>\u002Fdev\u002Fnull\ndone\n\n# Cross-project, scoped to workspace:\nfor ev in \"$CONTEXT_INTELLIGENCE_ROOT\"\u002F*\u002Fsessions\u002F*\u002Fcontext-intelligence\u002Fevents.jsonl; do\n  f=\"${ev%\u002Fevents.jsonl}\u002Fmetadata.json\"   # canonical marker = events.jsonl; fields from sibling\n  jq -r 'select(.workspace == \"my-project\" and .status == \"running\") | .session_id' \"$f\" 2>\u002Fdev\u002Fnull\ndone\n```\n\n### Event summary for a session\n\n```bash\n# Count total events\nwc -l \u003C events.jsonl\n\n# Count events by type\njq -c '.event' events.jsonl | sort | uniq -c | sort -rn\n```\n\n### Find errors in a session\n\n```bash\n# Find error event line numbers only (never output the full lines)\ngrep -n '\"event\":\"orchestrator:error\"\\|\"event\":\"tool:error\"' events.jsonl | cut -d: -f1\n```\n\n### Extract a specific event by line number\n\n```bash\nsed -n '42p' events.jsonl | jq -c '{event, workspace, ts: .timestamp}'\n```\n\n### Count events by type in a session\n\n```bash\ngrep -c '\"event\":\"tool:pre\"' events.jsonl\n```\n\n---\n\n## Event Name Taxonomy\n\nAll events follow the `{namespace}:{action}` naming convention:\n\n| Namespace | Events | Description |\n|-----------|--------|-------------|\n| `session` | `start`, `fork`, `end` | Session lifecycle |\n| `prompt` | `submit` | User prompt submission |\n| `provider` | `request`, `response` | Provider API calls |\n| `llm` | `request`, `response` | LLM inference |\n| `tool` | `pre`, `post`, `error` | Tool execution lifecycle |\n| `orchestrator` | `start`, `complete`, `error` | Orchestrator run lifecycle |\n| `context` | `compaction` | Context window management |\n| `cancel` | `requested`, `completed` | Cancellation lifecycle |\n| `recipe` | `start`, `step`, `complete`, `approval`, `loop_iteration`, `loop_complete` | Recipe orchestration |\n| `delegate` | `agent_spawned`, `agent_completed`, `context_inherited`, `session_resumed` | Agent delegation |\n\nFor the complete field reference for each event, see `context\u002Fevent-schema.md`.\n",{"name":5,"license":15,"version":25,"description":7},"0.2.0","main","bf7cfbc82bdfd356e86f7a849622772537956b17","skills\u002Fcontext-intelligence-session-navigation",7,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-15 02:34:45",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add microsoft\u002Famplifier-bundle-context-intelligence --skill context-intelligence-session-navigation",{"tool":41,"command":42},"bunx","bunx skills add microsoft\u002Famplifier-bundle-context-intelligence --skill context-intelligence-session-navigation",{"tool":44,"command":45},"pnpm","pnpm dlx skills add microsoft\u002Famplifier-bundle-context-intelligence --skill context-intelligence-session-navigation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-session-navigation\u002FSKILL.md",true,[],[50,67,76,93,101,117],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":61,"publishedAt":20},"01M69BGZVPJBKSZV5N0WMVGR3N","workflow-pattern-analysis","Use when asked how a workflow is failing, what separates a successful run from a failing one, which steps are the most common failure points, or what patterns recur across sessions — analyses failure\u002Fsuccess patterns and signals across many runs using context-intelligence session data.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-pattern-analysis\u002FSKILL.md",[56],{"categoryNo":57,"categoryName":58,"taxonomyType":59,"taxonomyTypeDesc":60},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[62,63,64,65,66],"workflow pattern analysis","workflow","reasoning","run","sessions",{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":20},"01M69BGYAYC16BRSB0EGMCKMF5","transcript","Retrieve the prior user and assistant conversation verbatim from the current Context Intelligence capture, or named sessions. Use when a user asks to replay, quote, review, or act on a transcript.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Ftranscript\u002FSKILL.md",[],[69,74,66,75],"assistant","review",{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":90,"publishedAt":20},"01M69BGWQGCEN13DHHAQGTQ609","context-intelligence-tool-design","Use when selecting a detection strategy and implementation primitive for a context-intelligence signal. Classifies signals as deterministic, probabilistic, llm-evaluated, or hybrid, and applies the cheapest-sufficient-capability principle.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-tool-design\u002FSKILL.md",[82,85],{"categoryNo":83,"categoryName":84,"taxonomyType":59,"taxonomyTypeDesc":60},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":86,"categoryName":87,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[91,92,64],"design","context intelligence tool design",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":20},"01M69BGVHJJFCNZMGM21FNWMFS","context-intelligence-session-reconstruction","Use when local Amplifier session files are missing, broken, or incomplete — rebuilds events.jsonl, transcript.jsonl, and metadata.json from the context-intelligence graph server.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-session-reconstruction\u002FSKILL.md",[],[100],"context intelligence session reconstruction",{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":113,"publishedAt":20},"01M69BGRET24BR6PTYANVE57F4","context-intelligence-server-data-ops","Exact step order, wording, and the \"session details\" block format for the delete flows the server-data-ops agent drives — delete the current session, clean up every session from the current working directory, find-then-delete a session by description, and delete a session someone else created.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-server-data-ops\u002FSKILL.md",[107,110],{"categoryNo":108,"categoryName":109,"taxonomyType":59,"taxonomyTypeDesc":60},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":111,"categoryName":112,"taxonomyType":88,"taxonomyTypeDesc":89},"01JBSEEDCAT000000000000033","数据分析师",[114,115,116],"context intelligence server data ops","delete","directory",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":20},"01M69BGQ0B4G6VY99C6RGS8Z8T","context-intelligence-hill-climbing","Use when an investigation needs more than one step — track it in todo as a hill climb so progress and dead leads leave an audit trail. Governs HOW you track the climb, not how you query or extract — that stays in graph-query \u002F session-navigation.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Famplifier-bundle-context-intelligence\u002Fblob\u002Fmain\u002Fskills\u002Fcontext-intelligence-hill-climbing\u002FSKILL.md",[],[124],"context intelligence hill climbing"]