Spaces & Workspaces

A Space is a workspace where agents do their work. It's a sandboxed project directory with files, installed tools, skills, secrets, and optionally a Git repository.

Every conversation runs inside a Space. When an agent reads files, runs commands, or uses tools — it all happens within the Space's sandbox.


What's Inside a Space

ComponentDescription
FilesA sandboxed filesystem where agents can read, write, and edit files
SkillsInstalled capabilities (e.g., core:research-assistant)
MCPsTool integrations (e.g., Google Analytics, Ahrefs)
AgentsCharacters/agents assigned to this workspace
SecretsEncrypted environment variables (API keys, tokens)
GitOptional Git repository (clone, pull, commit)
CLAUDE.mdPersistent instructions loaded into every conversation

Create a Space

Via Web App

  1. Click + New Space from the dashboard
  2. Enter a name and optional description
  3. Choose the type:
    • Empty — blank workspace
    • Git — clone from a repository URL
  4. Set visibility: private, organization, or public
  5. Click Create

Via CLI

# Empty space
teamday spaces create --name "Marketing Hub"

# Space from a Git repo
teamday spaces create --name "Backend API" --type git --git-url https://github.com/your-org/repo.git

Via API

curl -X POST "https://us.teamday.ai/api/v1/spaces" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Hub",
    "description": "Content creation and SEO workspace",
    "visibility": "organization"
  }'

Response:

{
  "success": true,
  "space": {
    "id": "abc123",
    "name": "Marketing Hub",
    "visibility": "organization",
    "skillRefs": ["core:research-assistant", "core:data-analyst", ...]
  }
}

New spaces automatically include core skills.


Install Resources

Add skills, MCP integrations, and agents to your Space.

Add Skills

teamday spaces add-skill <space-id> core:research-assistant core:data-analyst

Via API:

curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"addSkills": ["core:research-assistant", "core:data-analyst"]}'

Add MCPs

teamday spaces add-mcp <space-id> google-analytics ahrefs

Via API:

curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"addMcps": ["mcp-id-1", "mcp-id-2"]}'

Add Agents

teamday spaces add-agent <space-id> <agent-id>

When you add a Character to a Space, TeamDay automatically:

  1. Writes the agent definition to .claude/agents/{name}.md
  2. Installs the Character's skill dependencies
  3. Installs the Character's subagent dependencies

Via API:

curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"addAgents": ["agent-id"]}'

Remove Resources

teamday spaces remove-skill <space-id> core:data-analyst
teamday spaces remove-mcp <space-id> ahrefs
teamday spaces remove-agent <space-id> <agent-id>

Via API:

curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"removeSkills": ["core:data-analyst"]}'

Secrets

Secrets are encrypted environment variables available to agents at runtime. Use them for API keys, tokens, and other credentials.

Store Secrets

teamday spaces set-secret <space-id> OPENAI_API_KEY=sk-abc123 SLACK_TOKEN=xoxb-456

Via API:

curl -X POST "https://us.teamday.ai/api/v1/spaces/<space-id>/secrets" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "secrets": {
      "OPENAI_API_KEY": "sk-abc123",
      "SLACK_TOKEN": "xoxb-456"
    }
  }'

Secret names must be UPPER_SNAKE_CASE. Values are encrypted at rest.

List Secrets

teamday spaces secrets <space-id>

Returns key names only — values are never exposed.

Remove Secrets

teamday spaces remove-secret <space-id> OPENAI_API_KEY

Via API:

curl -X DELETE "https://us.teamday.ai/api/v1/spaces/<space-id>/secrets" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"keys": ["OPENAI_API_KEY"]}'

How Agents Access Secrets

Secrets are injected as environment variables in the agent's sandbox. If an MCP or skill configuration references ${API_KEY}, it's resolved from the Space's secrets.

In .mcp.json:

{
  "mcpServers": {
    "my-tool": {
      "command": "node",
      "args": ["tool.js"],
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

Files and Filesystem

Each Space has a sandboxed filesystem at:

/sandbox/{orgId}/spaces/s-{spaceId}/

Agents use built-in tools to interact with files:

ToolOperation
ReadRead file contents
WriteCreate or overwrite files
EditMake targeted string replacements
GlobFind files by pattern
GrepSearch file contents
BashRun shell commands

Browse Files (CLI)

teamday spaces ls <space-id> /
teamday spaces ls <space-id> /src/

CLAUDE.md

Place a CLAUDE.md file in the Space root to provide persistent instructions to all agents:

# Project Context

This is a Node.js API project using Express and PostgreSQL.

## Coding Standards
- Use TypeScript strict mode
- Write tests for all new endpoints
- Follow REST conventions

## Important Files
- src/routes/ — API routes
- src/models/ — Database models
- .env.example — Required environment variables

CLAUDE.md is loaded automatically at the start of every conversation. Use it for project-specific context that doesn't belong in the agent's system prompt.

Special Directories

PathPurpose
CLAUDE.mdPersistent instructions for all agents
.claude/agents/Subagent definitions (markdown files)
.claude/skills/Skill definitions
.mcp.jsonMCP server configuration
.git/Git repository (if connected)

Git Integration

Connect a Space to a Git repository for version-controlled workspaces.

Clone a Repo

Create a Space with a Git URL:

teamday spaces create --name "Backend" --type git --git-url https://github.com/org/repo.git

Git Operations (CLI)

teamday spaces git <space-id> status
teamday spaces git <space-id> pull

In-Chat Git

Agents can use Git through the Bash tool:

git status
git add .
git commit -m "Add feature X"
git push

The web app also provides a Git panel for viewing diffs, staging changes, and committing.


Chat in a Space

Via Web App

Open a Space and select an agent from the chat panel. The agent automatically has access to all the Space's resources.

Via CLI

teamday spaces chat <space-id> --agent <agent-id>

Via API

curl -X POST "https://us.teamday.ai/api/v1/agents/<agent-id>/execute" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Review the files in src/",
    "spaceId": "<space-id>"
  }'

View Space Details

Via CLI

teamday spaces get <space-id>

Shows the full profile including installed skills, MCPs, agents, and secret keys.

Via API

curl "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN"

Update a Space

Update metadata, cover image, or installed resources:

# Update name
teamday spaces get <space-id>  # not yet available via CLI update

Via API:

curl -X PATCH "https://us.teamday.ai/api/v1/spaces/<space-id>" \
  -H "Authorization: Bearer $TEAMDAY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Hub v2",
    "description": "Updated workspace",
    "instructions": "Focus on SEO content",
    "coverImage": "https://images.unsplash.com/photo-123"
  }'

Disable Built-in Tools

Restrict which tools agents can use in this Space:

{
  "disabledTools": ["Bash", "WebSearch"]
}

This prevents all agents in the Space from using the listed tools.


Delete a Space

teamday spaces delete <space-id>

Spaces are soft-deleted (archived), not permanently removed. Execution history is preserved.


Next Steps