When to use
- Persist context about a project across sessions (briefs, known issues, changelogs)
- Read what a previous session documented about a project
- Track changes over time with full version history
How it differs from metadata documents
Metadata documents are deployment snapshots — frozen copies of config.ts and workflow JSON archived when you deploy. They cannot be updated after deployment. Project notes are living knowledge — updated any time, independently versioned, meant to accumulate context over the project’s lifetime. Multiple agents can read and write the same project’s documents across sessions.Prerequisites
codikaCLI installed and authenticated- A project ID
Commands
Upsert a document
Create a new document type or update an existing one. First call creates v0.0.0, subsequent calls increment the patch version.List documents
Get a document
Options
Upsert options
| Flag | Description |
|---|---|
--type <type> | (Required) Document type ID (lowercase with hyphens) |
--summary <summary> | (Required) What changed in this version |
--title <title> | Document title (defaults to type ID) |
--content <content> | Markdown content |
--file <path> | Read content from a file instead of --content |
echo "..." | codika notes upsert <projectId> --type <type> --summary "..."
| --agent-id <id> | Agent identifier for tracking |
| --major-change | Bump minor version instead of patch |
| --api-key <key> | API key override |
| --json | JSON output |
Get options
| Flag | Description |
|---|---|
--type <type> | (Required) Document type ID |
--target-version <version> | Get a specific version (e.g. 0.1.0) |
--history | Show all versions |
--api-key <key> | API key override |
--json | JSON output |
What happens on upsert
- If no document of that type exists for the project, creates version
0.0.0 - If a current version exists, increments patch (
0.0.0->0.0.1) - Marks the previous version as
superseded(immutable, still queryable) - Updates the version history
Versioning
- Patch (default):
0.0.0->0.0.1->0.0.2 - Minor (
--major-change):0.0.5->0.1.0 - Previous versions are never deleted — full history is preserved
Examples
Record a project brief:Output
Upsert success:Suggested document types
These are conventions, not enforced — use any lowercase-hyphenated name:| Type | Purpose |
|---|---|
brief | What the project does, who it’s for, key decisions |
known-issues | Bugs, edge cases, gotchas discovered during development |
changelog | What changed and why across deployments |
debugging-log | Diagnostic trail for ongoing issues |
deployment-notes | Current deployment state and configuration |
architecture | Key architectural decisions and rationale |
Agent workflow patterns
Start of session: read existing context
After building/deploying: record what you did
After debugging: document the fix
Diagnosing issues: check history
Error handling
| Error | Cause | Fix |
|---|---|---|
| ”API key is required” | Not authenticated | Run codika login |
| ”Project not found” | Invalid project ID | Verify with codika get project <id> |
| ”documentTypeId must be lowercase” | Invalid type format | Use lowercase with hyphens |
| ”content is required” | Missing content | Provide --content or --file |
| ”content must be less than 500,000 characters” | Content too large | Split into multiple documents |
Exit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Failure |