agent-context-skill
v0.2.1
Published
Claude Code plugin and CLI that keep context across agents and sessions: project map (project-graph, conventions), question format, event-sourced project diary and team leader.
Downloads
518
Maintainers
Readme
agent-context-skill
A Claude Code plugin that keeps Claude's context across agents and sessions. With it, a big project can be worked on by many agents over many sessions without Claude forgetting things, making things up, or needing everything explained again. It also works as a command-line tool.
| Part | Skill | What it does |
|---|---|---|
| Project map | /agent-context-skill:project-map | Graph JSON of a project's structure, imports and symbol relationships (map), plus its coding conventions and style (conventions). Runs only when the user asks. |
| Question format | /agent-context-skill:ask-format | One format for every question Claude asks the user. The user confirms it once, and every answer is recorded as a decision. |
| Project diary | /agent-context-skill:project-diary | Event-sourced memory. Hooks record prompts, file changes, commands, helpers, questions and decisions with times. Checkpoints store the git commit, and a size-capped digest is offered at session start. |
| Team leader | /agent-context-skill:team-lead <goal> | Splits a goal into tasks with exact, hash-checked instructions and runs helper agents in parallel. Helpers can message each other, and every result is checked against the recorded events. |
The parts work together:
- Your answers to the question format are stored in the diary.
- A project map you ask for is saved in the diary, so the team leader and new sessions can read it.
- The team leader uses all of them.
Requirements
- Claude Code (tested with 2.1.318)
- Node.js 18 or newer, and git
- On Windows, Git Bash. The plugin's commands run in Claude's Bash tool.
Install
As a Claude Code plugin
This installs the skills, the hooks, the helper agent, and the agent-context-skill command.
claude plugin marketplace add iNew-b-yte/agent-context-skill
claude plugin install agent-context-skill@agent-contextOr inside a Claude Code session:
/plugin marketplace add iNew-b-yte/agent-context-skill
/plugin install agent-context-skill@agent-contextWhile the plugin is enabled, agent-context-skill is on the PATH of Claude's Bash tool.
Plugins run code on your computer, so read hooks/hooks.json before
installing.
To try it in one session without installing it:
git clone https://github.com/iNew-b-yte/agent-context-skill.git
cd agent-context-skill && npm install
claude --plugin-dir /path/to/agent-context-skillAs a command-line tool
npm install -g agent-context-skill # npm
pip install agent-context-skill # pip: runs the same-version npm package (Node.js 18+ on PATH)
npx agent-context-skill --help # run without installingThe npm package also contains the whole plugin. After npm install -g agent-context-skill,
you can load it into one Claude Code session with:
claude --plugin-dir "$(npm root -g)/agent-context-skill"From a clone of the repository, run npm install and use node bin/agent-context-skill.js
in place of agent-context-skill.
Using it in Claude Code
- Start a session in your project.
- If the project already has a diary, Claude asks first whether to load it: this time, always, never, or not now.
- Your answer is saved; "always" and "never" stop the question.
- First question. The first time Claude asks you something, it shows the question format and asks you to confirm it once. Every later question uses that format, and every answer is recorded as a decision.
- Project map. Ask for it when you want it, for example: "map this project and save it". It is not run on its own.
- Checkpoints. At milestones, Claude records a checkpoint with the current git commit. The next session rechecks only the files changed after it.
- Team work. Run
/agent-context-skill:team-lead <goal>.- The lead shows you the task split for approval, then runs the helpers.
- When a helper is unsure, its question is passed to you and your answer is sent back.
- The lead checks every result against what was recorded.
- Joining from another session. To work on an existing task from another session of the
same project, run
/agent-context-skill:team-lead join <task ID> <helper name>.
The diary lives in ~/.agent-context-skill/ (one per git repository, shared by all its
worktrees). It stores prompts, commands and their output, file paths with hashes, and
decisions, locally on this computer only. To stop loading it into sessions, run
agent-context-skill diary setting set memory.load never.
Development
npm install
npm test # all Node tests
python -m unittest discover -s python/tests # pip launcher version check
claude plugin validate . --strictTwo tests depend on language tools: the Java semantic test needs a JDK, and the Rust test is
skipped without rust-analyzer. Hook tests replay real Claude Code hook payloads from
scripts/project-diary/tests/fixtures/hooks/.
Commands
agent-context-skill <command> [options]
Commands:
map Graph JSON of a project's structure, imports and symbol relationships (project-graph)
conventions Coding conventions and style of a project, with counts and examples (project-conventions)
diary Event-sourced project memory: checkpoints, decisions, settings, digest, saved maps (project-diary)
ask-format The one question format: show it, check or record the user's confirmation (ask-format)
team Tasks with exact, hash-checked instructions, messages between helpers, and verification (team)
Options:
--help, -h Show this help
--version, -v Show package version
Run "agent-context-skill <command> --help" for the options of a command.Errors are printed as agent-context-skill: <message> on stderr with exit code 1.
project-graph: agent-context-skill map
Analysis reads the target project without building it, running its scripts, installing its dependencies, or modifying its files.
# Folder and file hierarchy
agent-context-skill map --structure ./my-project
# Standalone file/module imports
agent-context-skill map --imports ./my-project
# Standalone symbols and their source references
agent-context-skill map --symbols ./my-project
# Combined graph
agent-context-skill map --structure --imports --symbols ./my-project
# Save the graph JSON to a file
agent-context-skill map --structure --imports --symbols ./my-project > graph.jsonThe graph JSON is always written to stdout. The path defaults to the current
directory. Quote paths containing spaces. Use --help for options and --version
for the installed version.
Commands and options
The exact map --help output (the top-level help is under "Commands" above):
$ agent-context-skill map --help
project-graph — optional source analysis
agent-context-skill map --structure [path] Folder/file hierarchy
agent-context-skill map --imports [path] File/module imports
agent-context-skill map --symbols [path] Declarations and symbol references
agent-context-skill map --structure --imports --symbols [path]
Options can be combined; path defaults to the current directory.
--json No effect; graph JSON is always written to stdout
--help, -h Show this help
--version, -v Show package version
Analysis reads source without building or executing the project.
Dependency directories and configured build output are excluded; hidden paths and
symbolic-link targets are included with cycle detection.Errors, such as an unknown option, a missing path or no command, are printed to
stderr as agent-context-skill: <message>, and the exit code is 1.
Graph JSON
The output is one JSON object (graph schema version 1):
{ schemaVersion, project, modes, nodes, edges, diagnostics, stats, coverage, engines }.
nodeshave stable path-based IDs, kind (folder/file/module/class/function/method/struct/interface/trait/enum/type), name, path, parent and optional language, source location, or unresolved status.edgeshave stable IDs, from, to, kind (contains/imports/references), status (resolved/possible/unresolved), and optional source location, specifier, evidence and engine.containsedges have no status, and animportsorreferencesedge without a status is counted as resolved incoverage. Imports never imply symbol usage.coveragerecords file counts by language, relationship outcome counts (resolved/possible/unresolved/skipped) and active semantic engines.diagnosticsentries are{ code, path, message }, some withline. Ambiguous, dynamic and unsupported resolution is reported rather than represented as a verified connection.- Installed third-party dependencies are omitted from nodes and edges.
Language and exclusion coverage
Folder/file discovery is language-independent. Source analysis supports JavaScript/Node (including CommonJS), TypeScript/TSX, Python, Java, Go, and Rust. Declarations include classes, functions, methods, interfaces, structs, traits, enums, types, and Rust modules where applicable. An import relationship does not imply that an imported symbol is used.
| Language | Import/config resolution | Symbol binding engine and verified cases |
| --- | --- | --- |
| JavaScript / TypeScript / TSX | Relative modules, CommonJS, baseUrl, paths, local workspace packages and supported package entries | Bundled TypeScript checker; constructor, instance, static and inherited calls, aliases, interfaces, unions, and explicit Nest/Angular DI registrations |
| Python | Relative/absolute source packages and configured setuptools package roots | Bundled Pyright plus an installed Python interpreter; receiver/inherited methods and Protocol-annotated dependencies |
| Java | Declared packages/types, including types whose filename differs | Installed JDK 17+ compiler API with processing and emission disabled; constructors, receiver methods, inheritance and interfaces |
| Go | Local modules, go.work, and local replace precedence | Built-in conservative source binder; explicit concrete receivers and interface-typed dependencies. No Go installation or target build is required |
| Rust | File modules, Cargo workspaces, local path dependencies and custom library roots | Installed rust-analyzer; receiver/trait calls. Cargo build scripts, procedural macros, checks, sysroot discovery and target execution are disabled |
Tool requirements and how each tool is found:
| Language | Tool | Lookup |
| --- | --- | --- |
| JavaScript / TypeScript / TSX | TypeScript (bundled) | Nothing to install |
| Python | Pyright (bundled) and a Python interpreter | PROJECT_GRAPH_PYTHON (interpreter command or path), otherwise python |
| Java | JDK 17 or newer | JDK_HOME, JAVA_HOME, PROJECT_GRAPH_JAVA (path to the java executable), then java on PATH; on Windows, also Android Studio's bundled JBR |
| Go | Built-in source binder | Nothing to install |
| Rust | rust-analyzer | PROJECT_GRAPH_RUST_ANALYZER (path to the executable), then rust-analyzer on PATH |
If a tool is missing, the graph gets a semantic-tool-unavailable diagnostic,
engines marks that language unavailable-or-failed, and the rest of the analysis
still runs. PROJECT_GRAPH_PYTHON_EXECUTABLE is set internally for the bundled
Pyright process; it is not a user setting.
Installed third-party packages are never graph nodes or edges. Type/declaration metadata may inform a project-owned relationship, while only project-owned files, classes and interfaces appear in the graph.
Dependency conventions are centralized in scripts/project-graph/lib/constants.js,
including node_modules, virtual environments, site-packages, package caches and
generated binary extensions. Ambiguous names such as build, out, and target
remain source unless a declarative project configuration identifies them as output.
The scanner reads TypeScript, Cargo, Maven, literal Gradle, Python, and literal Vite
output settings without executing configuration code. .project-graph.json can
declare literal include and exclude paths for other outputs. Hidden
source/configuration directories and symbolic-link targets are included; repeated
directory targets are represented once with aliases.
.project-graph.json
{ "exclude": ["generated-custom"], "include": ["src/build"] }- Optional. It is read in every scanned folder, as JSON or JSONC.
exclude: paths that are never analyzed.include: paths kept as source even when a project configuration marks them as build output. It does not override dependency directories orexclude.- Each entry is a literal child path relative to the folder that contains the file:
no
*or?, not the folder itself, and not outside it. - An invalid file in the project root stops the analysis with an error. In a
subfolder, it is reported as a
scan-readdiagnostic and that folder's contents are not scanned.
Analysis limits
This is static source analysis, so it cannot prove every runtime target. Resolved edges have a verified source declaration, possible edges preserve multiple valid static targets, and unresolved/skipped counts remain visible. Reflection, runtime-computed imports, monkey patching, native/plugin loading, generated source that is absent during scanning, and dispatch decided only at runtime can remain unresolved. Rust macro expansion is intentionally disabled. Syntax errors and read failures are reported. There is no fixed source or configuration file-size cutoff.
Resolution supports relative imports, TypeScript baseUrl/paths and relative
configuration inheritance, local package entries/exports, Python package roots,
Java package imports, scanned Go modules and file-based Rust modules. Conditional
exports use the supported types/import/require/default entries. Package-based
TypeScript configuration inheritance is not loaded from excluded dependencies.
Executable configuration is not run; output paths and aliases that exist only as
runtime configuration cannot be discovered automatically. Unknown language files
remain visible in the structure and are counted as unsupported for relationship
analysis. External dependencies are omitted from the graph and counted as skipped;
unresolved local imports and ambiguous symbols are explicitly reported.
The implementation boundaries and graph contract are documented in ARCHITECTURE.md.
project-conventions: agent-context-skill conventions
Reports a project's coding conventions and style. Like project-graph, it reads the target project without building or running it and never writes into it.
agent-context-skill conventions ./my-project > conventions.jsonproject-conventions — coding conventions and style of a project
agent-context-skill conventions [path]
The path defaults to the current directory. JSON is written to stdout:
declared settings read from configuration files (never executed)
observed per-language measurements with counts and file:line examples
coverage files analyzed per language
Options:
--help, -h Show this help
--version, -v Show package version
Analysis reads source without building or executing the project and never writes into it.- declared:
.editorconfig, Prettier (.prettierrc,.prettierrc.json,.prettierrc.toml,package.jsonprettier), ESLint (.eslintrc,.eslintrc.json:extendsand style rules),package.json(type, test/lint/format scripts, known test/lint/format tools),tsconfig*.json(strict,module,target),pyproject.toml([tool.black|ruff|isort|pytest|mypy|flake8]),setup.cfg([flake8],[pycodestyle],[isort],[tool:pytest]),rustfmt.tomlandcheckstyle*.xml(presence). Configuration written as code and YAML files are listed as"present, not read". - observed per language: indentation style and width, line endings, final newline, line length (max and 95th percentile), quotes (JS/TS/Python), semicolons and module system (JS/TS), declaration naming per kind and file-name style; plus test file patterns and locations.
- Each observed item is
{ value, share, counts, examples }. A value is stated only when one choice reaches 80% of the counted cases; otherwise it is"mixed". Strings that contain a quote character, JSX attribute values and Python docstrings are not counted for quote style. Single-word names are counted aslowercase/UPPERCASEand left out of the share. - Design or architecture patterns are not detected.
The implementation is documented in ARCHITECTURE.md.
project-diary: agent-context-skill diary
project-diary — event-sourced memory of a project (one diary per git repository)
agent-context-skill diary status Counts, settings, last checkpoint and map (JSON)
agent-context-skill diary digest Session-start digest (Markdown, size-capped)
agent-context-skill diary compact [--full] Process new events into state (--full rebuilds)
agent-context-skill diary checkpoint "<summary>" Record a checkpoint with the current git commit
agent-context-skill diary decide --question <q> --answer <a> [--header <h>]
Record a decision by the user
agent-context-skill diary setting get <key> Read a setting (JSON)
agent-context-skill diary setting set <key> <value> Change a setting (recorded as an event)
agent-context-skill diary memory <this-time|always|never|no>
Record the user's memory choice; always/never also set memory.load
agent-context-skill diary save-map [--structure] [--imports] [--symbols] [--conventions] [path]
Run project-graph and/or conventions and save the result
agent-context-skill diary log [--since <id|time>] [--type <type>] [--agent <id|type>] [--limit <n>]
Events in time order (JSON lines)
agent-context-skill diary blob <sha256> Print stored full text
Common options:
--project <path> Project folder (default: current directory)
--session <id> Session ID to record events under (default: cli)
--help, -h Show this help
Settings: memory.load (ask | always | never), question_format.confirmed (JSON).
Diary location: AGENT_CONTEXT_SKILL_HOME, or ~/.agent-context-skill.- Where: one diary per git repository (all its worktrees share it), in
~/.agent-context-skill/projects/<name>-<hash>/or underAGENT_CONTEXT_SKILL_HOME. A folder without git gets its own diary. - What is recorded (by the plugin's hooks, automatically): session start and end, every prompt submitted (this includes scheduled tasks, background reports and cross-session messages, which Claude Code also submits as prompts), file changes by Write/Edit (path, SHA-256 and size, not the contents), commands with their output (up to 20,000 characters), tool failures, helper agents (start, stop, the exact delegation prompt), questions asked with AskUserQuestion, and the end of each turn with the git commit. Commands of this tool add checkpoints, decisions, settings, saved maps, tasks and messages. Every event has a UUID, an ISO time, the session, the agent (for helpers) and the actor.
- Memory at session start (
memory.load):ask(default; Claude asks whether to load the diary this time, always or never),always(the digest is added to the session), ornever. Turn loading off withagent-context-skill diary setting set memory.load never. Recording stops only when the plugin is disabled. - Digest: built by code from recorded events (no language-model summary), at most 8,000 characters, most important first: settings, decisions, last checkpoint and the files changed after it, open tasks, last saved map, recent activity. Every entry line carries its event ID.
- Speed: new events are processed incrementally (only bytes after the last offset). With 100,000 synthetic test events, processing 100 new events and building the digest took 29 ms.
- Privacy: prompts, commands and their output, file paths and decisions are stored on this computer in the user's profile. Nothing is sent anywhere.
The implementation is documented in ARCHITECTURE.md.
ask-format: agent-context-skill ask-format
ask-format — the one question format, confirmed by the user once
agent-context-skill ask-format show Print the question format (FORMAT.md)
agent-context-skill ask-format status Whether the user confirmed the current format (JSON)
agent-context-skill ask-format confirm [--from-project <id>]
Record the user's confirmation in this project's diary
Options:
--project <path> Project folder (default: current directory)
--session <id> Session ID to record under (default: cli)
--help, -h Show this helpThe format itself is skills/ask-format/FORMAT.md (version in its
title). The user's confirmation is the setting question_format.confirmed
({ version, sha256 }); a changed format needs a new confirmation. A confirmation of the same
format in another project counts as well and is recorded in the current project.
team: agent-context-skill team
team — tasks and messages of the team leader and its helpers, kept in the project diary
agent-context-skill team task create --owner <name> --paths <glob,glob> --title "<title>" [--source <event-id>] [--force]
Store the exact instructions read from stdin; prints the task ID and SHA-256
agent-context-skill team task get <id> [--hash <sha256>] [--as <name>]
Print the exact instructions; fails if they do not match the hash
agent-context-skill team task update <id> --status <open|claimed|in-progress|blocked|done|cancelled> [--note "<text>"]
agent-context-skill team task list [--open]
agent-context-skill team send --to <name> [--from <name>]
Send the message read from stdin (default sender: lead)
agent-context-skill team inbox --for <name> [--peek]
Unread messages with exact text; marks them read unless --peek
agent-context-skill team verify <task-id> Recorded files, commands and failures of the agent(s) that fetched the task
Options:
--project <path> Project folder (default: current directory)
--session <id> Session ID to record under (default: cli)
--help, -h Show this help- Instructions are stored once as content-addressed text;
task getprints them byte for byte and refuses a mismatching hash, so a helper acts on exactly what the lead wrote. - Owned paths are globs (
**,*,?; a folder owns its contents). Overlapping open tasks are refused unless--force. verifylists what the hooks recorded for the agent(s) that fetched the task: files with hashes, commands with output, failures, files outside the owned paths, and whether the delegation prompt carried the task hash. A claim not backed by these records is unverified.- Helpers in the same session, in git worktrees and in other sessions of the same project use the same diary, so the channel works across all of them.
The implementation is documented in ARCHITECTURE.md.
License
MIT. See LICENSE.
