Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.coconut.dev/llms.txt

Use this file to discover all available pages before exploring further.

nut context

Manage context documents (role, agents, team, memory) for your Coconut instance.
nut context [command]

Overview

Context documents provide essential information to AI skills about the role they should play, the agents available to them, the team they are collaborating with, and any memory that should persist across sessions. These documents help skills make better decisions and produce more relevant results.
nut context manages context documents in the current local workspace. To read context from a remote peer Coconut through the Coconut Dashboard, use nut coconut context.

Context Types

  • role - Role definitions and expectations for AI skills
  • agents - Agent definitions and capabilities available in the instance
  • team - Team structure, members, and collaboration conventions
  • memory - Long-lived notes and memory to carry across sessions

nut context get

Read a context document.
nut context get <type> [options]
Arguments:
  • type - Context type (role, agents, team, or memory)
Options:
  • --json - Output as JSON
Examples:
# Read role definition
nut context get role

# Read agents as JSON
nut context get agents --json

# Read team context
nut context get team

# Read memory
nut context get memory

nut context update

Replace the entire content of a context document.
nut context update <type> [options]
Arguments:
  • type - Context type to update
Options:
  • --file <path> - Path to file containing new content
  • --content <text> - Direct content to set
Examples:
# Update with direct content
nut context update role --content "# Role Definition\n\nAI skills should focus on code quality and testing..."

# Update agents from file
nut context update agents --file ./agents.md

# Replace team document
nut context update team --file ./docs/team.md
Using update replaces the entire document. Use append to add content without replacing existing text.

nut context append

Append content to a context document.
nut context append <type> [content] [options]
Arguments:
  • type - Context type to append to
  • content - Text to append (optional if using --file)
Options:
  • --file <path> - Path to file to append
Examples:
# Append text directly
nut context append team "## New Section\n\nContent here..."

# Append from file
nut context append memory --file ./additional-notes.md

# Add role clarifications
nut context append role "## Additional Guidelines\n\n- Always write tests\n- Follow the style guide"
Appending is useful for incrementally building up context without having to re-specify everything.

nut context replace

Find and replace text in a context document.
nut context replace <type> --old <text> --new <text>
Arguments:
  • type - Context type to modify
Options:
  • --old <text> - Text to find (required)
  • --new <text> - Replacement text (required)
Examples:
# Update role description
nut context replace role --old "old text" --new "new text"

# Fix terminology in agents
nut context replace agents --old "assistant" --new "agent"

# Update a team reference
nut context replace team --old "code reviewer" --new "senior code reviewer"

Context Document Examples

Role Context

# AI Skill Roles

## General Guidelines
- Write clean, maintainable code
- Include comprehensive tests
- Follow existing code patterns
- Document complex logic

## Code Review Focus
- Security vulnerabilities
- Performance implications
- Error handling
- Test coverage

## Communication
- Explain changes clearly
- Ask for clarification when needed
- Suggest improvements proactively

Agents Context

# Agents

## Planner
Breaks high-level goals into ordered, reviewable tasks.

## Implementer
Executes tasks, writes code, and opens proposals for review.

## Reviewer
Audits proposals for correctness, security, and style before merge.

Team Context

# Team

## Members
- Engineering: builds and maintains services
- Design: owns UX and visual design
- Product: prioritizes roadmap and requirements

## Working Agreements
- Changes land via reviewed proposals
- Prefer small, incremental PRs
- Document architectural decisions

Memory Context

# Memory

## Recent Decisions
- Chose PostgreSQL over MySQL for JSONB support
- Standardized on Next.js App Router

## Ongoing Considerations
- Evaluating queue options for background jobs
- Monitoring bundle size on the marketing site

Best Practices

Regularly update context documents as your project evolves. Outdated information can lead to AI skills making incorrect assumptions.
The more detail you provide, the better AI skills can understand your project and make appropriate decisions. Include coding standards, architectural patterns, and specific requirements.
Structure your context documents with clear headings and sections. Markdown formatting makes documents easier to read and parse.
Begin with basic context and expand over time. You don’t need perfect, comprehensive context on day one—add details as you discover what information skills need most.

Context Workflow

1

Define skill roles

nut context update role --content "# Role Definition\n\nAI skills should..."
2

Describe available agents

nut context update agents --file ./AGENTS.md
3

Add team context

nut context update team --file ./TEAM.md
4

Refine incrementally

nut context append memory "## New Notes\n\n..."
5

Review and update

nut context get role
nut context replace role --old "outdated info" --new "current info"