Skip to content

Alexu0317-FATHER/contour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contour (知界)

English | 中文

Fine-grained cognitive state tracking for Claude Code.

Most AI tools treat you as either an expert or a beginner. Contour tracks exactly what you know, what you partially understand, and what you don't — per knowledge point, per domain — and keeps that state synchronized across sessions.

Prerequisites

  • Node.js environment installed
  • Ability to run npx commands
  • Claude Code installed and configured

Installation

Quick Install (Recommended)

npx skills add Alexu0317-FATHER/contour

Install in Claude Code

  1. Run /plugin in Claude Code
  2. Switch to the Marketplaces tab
  3. Select Add Marketplace, enter Alexu0317-FATHER/contour
  4. It will switch back to the Discover tab, listing the plugins in contour
  5. Select Install for you (user scope) so Contour works across all your sessions

Update Skills

To update Contour to the latest version:

  1. Run /plugin in Claude Code
  2. Switch to Marketplaces tab (use arrow keys or Tab)
  3. Select contour
  4. Choose Update marketplace

You can also Enable auto-update to get the latest versions automatically.

How it works

Contour uses four local files per domain:

  • Core Profile ({user}-core.md) — Your communication profile. Loaded globally, rarely changes.
  • Domain State ({user}-{domain}.md) — Your cognitive state snapshot for a domain. Updated continuously.
  • Extract Buffer (extract-buffer.md) — Cross-session signal buffer.

Two update mechanisms work at different time scales:

  1. Live monitoring (current session) — A Stop hook fires after every assistant response, calls a lightweight Haiku model to classify your message for cognitive signals, and writes directly to Domain State. Fully automatic — no user action needed. A CLAUDE.md prompt layer provides backup coverage if hooks are unavailable.
  2. Historical backfill (past sessions)/contour:extract scans a past session for signals the hook didn't cover; /contour:sync distributes them to Domain State. Run manually when needed.

Example

What your Domain State looks like

After a few sessions, Contour builds a picture of your cognitive state per domain:

# Alex — coder Domain State

Last synced: 2026-02-22

## Cognitive State

| Knowledge Point                          | Partial | Mastered | Updated |
|------------------------------------------|---------|----------|---------|
| Claude Code session file structure       |         | ✓        | 2026-02 |
| MCP server config on Windows             | ✓       |          | 2026-02 |
| Claude Code plugin install format        |         | ✓        | 2026-02 |

## Communication Rules

- When explaining Claude Code internals, verify against docs — don't rely on memory

Claude loads this file at session start and adjusts how it communicates — no over-explaining mastered concepts, no skipping necessary context for partial ones.

After a work session — /contour:extract

extract output

Syncing to permanent state — /contour:sync

sync output

Available Commands

Command When to run What it does
/contour:setup Once, after install Initializes your Core Profile, Domain State, and Extract Buffer files and injects monitoring into CLAUDE.md
/contour:extract End of a significant session Scans the session for cognitive signals, writes to buffer
/contour:sync In a new dedicated session Reads buffer, updates Domain State, surfaces thinking patterns and core candidates, clears buffer
/contour:uninstall When you want to remove Contour Removes monitoring injection from CLAUDE.md, optionally deletes data files

/contour:setup

Initializes the Contour environment for your workspace.

/contour:setup

What it does:

  • Creates the necessary data files (Core Profile, Domain State, etc.) in your local directory.
  • Injects the live monitoring instructions into your workspace's CLAUDE.md file.
  • Note: Restart Claude Code after setup completes to activate the live monitoring instruction.

/contour:extract

Extracts cognitive signals from your current session.

/contour:extract

When to use: Run this at the end of a significant working session where you've learned new concepts or demonstrated mastery of existing ones. It scans the conversation history and writes detected signals to the Extract Buffer.

/contour:sync

Synchronizes extracted signals into your permanent cognitive state.

/contour:sync

When to use: Run this in a new, dedicated session (to avoid context pollution). It reads the Extract Buffer, updates your Domain State, surfaces any thinking patterns and Core Profile candidates for your review, and then clears the buffer.

/contour:uninstall

Removes Contour from your workspace.

/contour:uninstall

What it does:

  • Removes the Contour monitoring instructions from your CLAUDE.md.
  • Optionally prompts you to delete the local data files.

Environment Configuration & Data Files

Contour stores your data at ~/.claude/contour/ by default. All files are plain Markdown — readable, editable, and yours.

Changing the storage location (optional)

You might want to move the storage folder if you'd like to sync it with a cloud drive (e.g., OneDrive, Dropbox, iCloud) or keep it somewhere more accessible.

macOS / Linux

  1. Open your shell config file in any text editor:

    • If you use Zsh (default on macOS): ~/.zshrc
    • If you use Bash: ~/.bashrc
  2. Add this line at the end of the file (replace the path with your chosen folder):

    export AI_INFRA_DIR="/Users/yourname/Library/CloudStorage/OneDrive/contour"
  3. Save the file, then restart your terminal (or run source ~/.zshrc).

  4. Run /contour:setup — Contour will create the data files in your new folder.

Windows

  1. Press Win + R, type sysdm.cpl, and press Enter.
  2. Click AdvancedEnvironment Variables.
  3. Under User variables, click New.
  4. Set:
    • Variable name: AI_INFRA_DIR
    • Variable value: C:\Users\YourName\OneDrive\contour (use your actual path)
  5. Click OK to save.
  6. Restart Claude Code for the change to take effect.
  7. Run /contour:setup — Contour will create the data files in your new folder.

Note: If you already ran /contour:setup before changing the path, your existing data files won't move automatically. You'll need to manually copy the files from ~/.claude/contour/ to your new folder, or run /contour:setup again to create fresh files in the new location.

Customization

Because Contour stores your cognitive state in plain Markdown files, you can manually edit them at any time.

  • Want to force Claude to treat you as an expert in a specific domain? Open your {user}-{domain}.md file and manually update the status of concepts to mastered.
  • Want to adjust your communication preferences? Edit your {user}-core.md file.

Contour will respect your manual edits during the next session.

Disclaimer

  • File Modification: The /contour:setup command will modify the CLAUDE.md file in your current workspace to inject monitoring instructions.
  • Data Privacy: All cognitive state tracking happens locally on your machine. No data is sent to external servers by Contour itself (though Claude Code sends prompts to Anthropic's API as usual).

Version

v0.3.0 — Pre-release. In active testing.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors