Sync filesystem changes into the Graphonomous knowledge graph.
Optional path or flags: $ARGUMENTS
No arguments: sync only files changed during this session (tracked by the PostToolUse hook)
<path>: scan a specific directory (uses scan_directory for full traversal)
--full: force full directory scan even if change tracking is available
--consolidate: run consolidation after ingestion
This skill bridges the gap between AI-driven file editing and Graphonomous memory. When Claude writes or edits files, those changes should be reflected in the knowledge graph so that future retrieval includes the latest state.
The PostToolUse hook on Write/Edit tools records changed file paths in a session file at /tmp/graphonomous-changed-files.jsonl. This skill reads that file and batch-ingests only the changed files.
Steps:
Read the change tracker file (/tmp/graphonomous-changed-files.jsonl)
For each changed file, call act(action: "store_node", ...) with:
content: first 16KB of file content
node_type: "episodic"
source: "filesystem_sync"
confidence: 0.65
metadata: {"path": "<absolute_path>", "extension": "<ext>", "sync_reason": "file_changed"}
After all nodes are stored, create edges between related files using act(action: "store_edge", ...):
Files in the same directory get related edges (weight 0.4)
Files that import/reference each other get derived_from edges (weight 0.6)
Clear the change tracker file
Report: files synced, nodes created, edges created
Example — sync tracked changes:
/graphonomous:sync
When given a path, performs a full scan_directory-style ingestion.
Steps:
List files in the target directory (respecting .gitignore, max 1MB per file)
For each file matching supported extensions (.ex, .exs, .ts, .js, .tsx, .md, .html, .css, .json, .yml, .yaml, .toml, .svelte):
Read first 16KB
Call act(action: "store_node", ...) with file content and path metadata
Create inter-file edges based on import/reference patterns
Report ingestion stats
Example — scan a specific directory:
/graphonomous:sync graphonomous/lib/
Example — full scan with consolidation:
/graphonomous:sync graphonomous/ --full --consolidate
If --consolidate is passed, run consolidation after ingestion:
consolidate(action: "run")
Before storing, check if a node with the same path already exists:
consolidate(action: "query", operation: "similarity_search", query: "<file path>", limit: 1)
If a high-similarity node exists (score > 0.9), update it via learn(action: "from_feedback", feedback_type: "correction") rather than creating a duplicate.
After storing nodes, create edges for detected references:
Elixir: alias Foo.Bar / import Foo / use Foo / require Foo -> derived_from edge
JS/TS: import ... from './foo' / require('./foo') -> derived_from edge
Markdown: backtick file paths, cross-project names -> related edge
act(action: "store_edge", source_id: "<importer_node>", target_id: "<imported_node>", edge_type: "derived_from", weight: 0.6)
Don't sync every tiny edit in real-time — batch at natural breakpoints
Don't ingest binary files, node_modules, _build, deps, or .git directories
Don't set confidence above 0.65 for file content (it's raw, not curated knowledge)
Don't skip edge extraction — edges are what make the graph useful for retrieval