Requirements
| Requirement | Notes |
|---|---|
| VS Code with Copilot Chat | Agent mode must be available. |
Node.js >= 20 | Runs the hook runner and MCP server. |
| MCP access | Organizations can disable MCP. |
| Hook access | Organizations can disable agent hooks. |
Install
From VS Code Marketplace, run:Goal System custom agent in Copilot Chat.
After Marketplace extension updates, VS Code compares the bundled runtime version with the local files in ~/.copilot/extensions/goal-system/. If local files are stale, the status bar changes to Goal Update and VS Code prompts you to update them.
Updating local files replaces the installed runtime snapshot, so stale files from older releases do not keep running.
Installed files
| Path | Purpose |
|---|---|
~/.copilot/extensions/goal-system/ | Shared package, core, adapters, tests, docs, and dependencies. |
~/.copilot/agents/goal-system.agent.md | VS Code custom agent instructions. |
~/.copilot/hooks/goal-system-vscode.json | VS Code hook config with PascalCase lifecycle events. |
VS Code profile mcp.json | Adds the goalSystem stdio MCP server. |
~/.copilot/session-state/goal-system/ | Shared persisted goal state. |
Enforcement
The VS Code Chat adapter uses official VS Code hook events:| Hook | Behavior |
|---|---|
SessionStart | Injects the current sessionId, cwd, and active goal context. |
UserPromptSubmit | Creates a persisted draft goal for explicit /goal activation, injects active-goal context, and loads one unambiguous same-directory goal on explicit continuation. |
PreToolUse | Warns and then denies non-goal tools after repeated goal-state drift. |
PostToolUse | Records non-goal tool history into the persisted goal. |
PreCompact | Writes a compact snapshot before conversation compaction. |
SubagentStart | Gives subagents a boundary message without exposing goal state. |
SubagentStop | Lets subagents finish without taking goal ownership. |
Stop | Blocks premature completion while an active goal remains open. |
sessionId and cwd. Multiple same-directory sessions do not silently merge.
If the same goal has been resumed into another session, same-directory continuation treats those duplicate records as one goal and picks the newest copy.
Renamed, merged, duplicate, superseded, and clearer-worded discovered issues must be recorded as evidence-backed issueResolutions. They do not disappear from completion checks just because the wording changed.
MCP Tools
The local MCP server exposes:sessionId and cwd that the hook injects into the chat context. This keeps VS Code Chat sessions isolated even when several sessions share one workspace.
Limits
- VS Code hooks are Preview and can change.
- Organizations can disable hooks or MCP.
- The adapter cannot force goal behavior if you do not select the
Goal Systemagent and Copilot ignores available MCP tools. - Hook output depends on VS Code honoring the documented lifecycle events.
Troubleshooting
Goal tools do not appear
Run:goalSystem server is present and starts without errors.
Hooks do not run
Open theGitHub Copilot Chat Hooks output channel in VS Code. If no goal hook runs, check:
~/.copilot/hooks/goal-system-vscode.json- VS Code setting
chat.hookFilesLocations - organization policy for agent hooks
Stop is blocked
An active goal is still open. The stop hook returns a hard continuation directive: reloadgoal_system_status, continue the next concrete remaining item, update persisted state with evidence, and call goal_system_close only as complete, blocked, or cancelled with exact evidence.