This template turns any repository — any language, any purpose — into a Cognosis-tracked project. Sessions in a tracked repo get the project's knowledge index injected at start, and durable findings are captured back into the central vault at session end. The repo itself stays clean: all knowledge lives in the Cognosis vault, not here.
| File | Role |
|---|---|
.cognosis-project |
One-line marker file; its content is the project tag attached to every note. Its presence gates all hooks — repos without it are untouched. |
.claude/settings.json |
Wires the SessionStart and SessionEnd hooks into Claude Code. |
.claude/hooks/cognosis-session-start-inject.sh |
Injects the project-scoped knowledge index at session start (cognosis context inject). |
.claude/hooks/cognosis-session-end-nudge.sh |
Runs one headless turn at session end nudging the agent to persist durable findings as notes or reflections. |
.claude/hooks/cognosis-post-commit.sh |
Opt-in git commit capture. Not active until you install it into .git/hooks/post-commit (see below). |
A running Cognosis daemon and the MCP server registered in Claude Code. Full setup (Postgres + pgvector, Ollama, configuration) is covered in the Cognosis setup guide. The short version:
cognosis start
claude mcp add --transport http cognosis http://127.0.0.1:7433 \
--header "Authorization: Bearer $(cat ~/.local/state/cognosis/local-token)"-
Use this repo as a template (or clone it and remove the git history).
-
Set the project tag — this is the name notes will be filed under:
echo "my-project-name" > .cognosis-project
-
Replace this README and start building. The hooks need no further setup.
- Copy
.cognosis-projectand the.claude/directory into the repo root. - Set the project tag in
.cognosis-projectas above. - If the repo already has a
.claude/settings.json, merge thehooksentries from this template's copy instead of overwriting.
Each commit can be captured as a structured entry in the vault. Enable it per repo:
cp .claude/hooks/cognosis-post-commit.sh .git/hooks/post-commit
chmod +x .git/hooks/post-commitThe hook is marker-gated and never fails a commit — a broken capture prints a warning and moves on.
COGNOSIS_INJECT_BUDGET— token budget for the injected knowledge index (default2000).
Both session hooks are gated by the .cognosis-project marker: outside a
marked repo they exit silently and never contact the daemon. Inside a marked
repo the start hook fails loud if the daemon is unreachable — a context-less
session that looks normal is worse than one that visibly fails.
The project tag flows into the frontmatter of every note the agent writes.
During a session the agent reads and writes memory through the Cognosis MCP
tools (query_knowledge, write_note, edit_note, write_reflection, …).
The vault is a central, git-versioned markdown tree under
$XDG_DATA_HOME/cognosis/kb/ — nothing knowledge-related is stored in this
repository. See the
Cognosis architecture docs
for the full picture.
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to https://unlicense.org/