Skip to content

feat(core): make chunk limit configurable via CHUNK_LIMIT environment variable#264

Open
micari wants to merge 1 commit intozilliztech:masterfrom
micari:feature/configurable-chunk-limit
Open

feat(core): make chunk limit configurable via CHUNK_LIMIT environment variable#264
micari wants to merge 1 commit intozilliztech:masterfrom
micari:feature/configurable-chunk-limit

Conversation

@micari
Copy link

@micari micari commented Feb 5, 2026

Summary

Makes the hardcoded chunk limit of 450,000 configurable through the CHUNK_LIMIT environment variable, following the same pattern as other configuration options like EMBEDDING_BATCH_SIZE.

Motivation

The chunk limit was previously hardcoded at 450,000, which limited flexibility for different use cases. Users with larger codebases or different performance requirements can now configure this value to suit their needs.

Changes

  • ✅ Read CHUNK_LIMIT from environment variable with default of 450000
  • ✅ Add validation to ensure minimum value of 1
  • ✅ Add logging to display configured chunk limit value
  • ✅ Update docs/getting-started/environment-variables.md with new variable
  • ✅ Add CHUNK_LIMIT to .env.example
  • ✅ Update MCP help message with advanced configuration section

Usage Examples

Global configuration (~/.context/.env):
```bash
CHUNK_LIMIT=1000000
```

Process environment variable:
```bash
CHUNK_LIMIT=1000000 npx @zilliz/claude-context-mcp@latest
```

Default behavior (no configuration):

  • Falls back to 450000 (maintains backward compatibility)

Testing

  • Follows the same pattern as EMBEDDING_BATCH_SIZE
  • Backward compatible (defaults to 450000)
  • Input validation (minimum value of 1)
  • Logging added for debugging

Checklist

  • Follows conventional commit format
  • Documentation updated
  • No breaking changes
  • Consistent with existing codebase patterns

🤖 Generated with Claude Code

… variable

Previously, the chunk limit was hardcoded to 450000. This change makes it
configurable through the CHUNK_LIMIT environment variable, following the
same pattern as other configuration options like EMBEDDING_BATCH_SIZE.

Changes:
- Read CHUNK_LIMIT from environment variable with default of 450000
- Add validation to ensure minimum value of 1
- Add logging to display configured chunk limit
- Update documentation in environment-variables.md
- Add CHUNK_LIMIT to .env.example
- Update MCP help message with advanced configuration section

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant