---
title: Code Channels in Slack with Bits Code
description: >-
  Learn how to create and work in temporary code channels in Slack, where you
  can steer Bits Code, view code diffs, and create PRs.
breadcrumbs: Docs > Bits AI > Bits Code > Code Channels in Slack with Bits Code
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Code Channels in Slack with Bits Code

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Code channels are dedicated, temporary Slack channels for working with a coding agent on a specific task. When you ask [Bits Chat](https://docs.datadoghq.com/bits_ai/bits_chat.md#slack) in Slack to make a code change, [Bits Code](https://app.datadoghq.com/code) creates a code channel for that task. You and your team can follow the work, steer it, and review the result there, without cluttering the original conversation.

{% image
   source="https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/code_channel.6e981bd903ca2f2dfc52778a7b4fb962.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/code_channel.6e981bd903ca2f2dfc52778a7b4fb962.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A Slack code channel showing a conversation with Bits Code alongside a diff view of proposed code changes" /%}

Learn more about code channels in the [Slack documentation](https://slack.com/help/articles/54310833022355-Build-with-AI-as-a-team-using-Slack-Code).

## Create a code channel{% #create-a-code-channel %}

After [setting up Bits Code and enabling code channels](https://docs.datadoghq.com/bits_ai/bits_code/setup.md), create a code channel by mentioning `@Datadog` in Slack and describing a code change you'd like to make. If Bits Chat determines the request requires code changes, it hands the task off to Bits Code, which creates a code channel. Bits posts a link to the new code channel in the location where it was originally prompted.

{% image
   source="https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/code_channel_creation.9471ee8a73fb75ab0cbc20547d9d761d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/code_channel_creation.9471ee8a73fb75ab0cbc20547d9d761d.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A Slack message mentioning @Datadog, followed by a card showing the resulting code channel that was created" /%}

Bits Code names the code channel automatically based on your initial request. Find your code channels in a dedicated Code channels section in your Slack sidebar.

### Permissions and access{% #permissions-and-access %}

Only the user who prompted `@Datadog` is added to the new code channel automatically. Code channels match the visibility of the channel from which they are created (that is, if you mentioned `@Datadog` in a public channel, the resulting code channel is also public).

{% alert level="warning" %}
Bits Code can access source code repositories with the permissions of the user who prompted `@Datadog` and created the channel. It can access all Datadog telemetry (with [Data Access Control](https://docs.datadoghq.com/account_management/rbac/data_access.md) restrictions applied) of all users in the channel. Bits Code may bring this repository data and telemetry into the code channel. As the creator of a code channel, it is your responsibility to ensure that anyone who can view a code channel is authorized to view its contents, and that anyone who can join a code channel is authorized to steer Bits Code.
{% /alert %}

Any user who wants to steer the agent must have a Datadog account connected to Slack. (If you post in a code channel but do not have a connected Datadog account, Bits ignores your message.)

## Work in a code channel{% #work-in-a-code-channel %}

In other Slack channels, when you want a response from Bits Chat, you must `@`-mention it every time. A code channel works differently: Bits Code listens to each message posted. You don't need to mention `@Datadog` again to keep steering the agent.

As Bits Code works, the code channel shows:

- A diff view of proposed code changes
- Datadog graph widgets, when relevant to the task
- A Create PR button to open a pull request from the changes

After Bits Code has generated a code diff, you can comment on specific lines directly in the code channel.

{% image
   source="https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/commenting_on_code.12dcfc234f56df3906e0ffbb7176c989.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/bits_ai/dev_agent/slack_code_channels/commenting_on_code.12dcfc234f56df3906e0ffbb7176c989.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A question is drafted for specific lines of code" /%}

The work in every code channel is also reflected in a [Bits Code session](https://docs.datadoghq.com/bits_ai/bits_code.md#sessions) in Datadog. To view it, at the bottom-right corner of the code channel, click </> Code session.

Learn more about how to work in a code channel in the [Slack documentation](https://slack.com/help/articles/54310833022355-Build-with-AI-as-a-team-using-Slack-Code).

### How auto-push works in code channels{% #how-auto-push-works-in-code-channels %}

When the [auto-push setting](https://docs.datadoghq.com/bits_ai/bits_code/setup.md#enable-auto-push) is set to Always allow auto-push, Bits Code can push changes agentically—that is, without a human clicking a button. When pushing agentically, Bits uses the code channel creator's source code identity to author the commits and pull request.

Bits Code can only push code agentically from a code channel when the channel creator and every user who has sent a message in the channel has a source control account linked to Datadog with:

- Write access to every repository with a pull request in the channel, and any repository receiving changes
- Read access to all other repositories attached to the channel

(These permissions are not verified for users who have joined the channel but not sent a message.)

If any user who has sent a message in the code channel lacks the required repository permissions, or Bits cannot verify them, Bits does not agentically push changes. In this scenario, a user with the required permissions can still click Create PR or Update PR. These buttons check only that single user's permissions across the code channel's attached repositories. The user who clicks Create PR is the author of the resulting pull or merge request.

## Limitations{% #limitations %}

The overall [Bits Code limitations](https://docs.datadoghq.com/bits_ai/bits_code.md#limitations) also apply to code channels.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Bits Code](https://docs.datadoghq.com/bits_ai/bits_code.md)
- [Bits Chat in Slack](https://docs.datadoghq.com/bits_ai/bits_chat.md#slack)
- [Slack integration](https://docs.datadoghq.com/integrations/slack.md)
- [Code channels](https://slack.com/features/code-channels)
